[wp-trac] [WordPress Trac] #58612: Invalid return type "void" for get_post_custom_keys

WordPress Trac noreply at wordpress.org
Sun Jun 25 16:37:54 UTC 2023


#58612: Invalid return type "void" for get_post_custom_keys
-------------------------+----------------------
 Reporter:  kesselb      |       Owner:  (none)
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  General      |     Version:  trunk
 Severity:  normal       |  Resolution:  invalid
 Keywords:  has-patch    |     Focuses:
-------------------------+----------------------
Changes (by johnbillion):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Thanks for the report @kesselb. In PHP,
 [https://www.php.net/manual/en/language.types.void.php void is a special
 return type which indicates that the function returns nothing]. It's not a
 real type, therefore it gets coerced to `null` as in your example, but
 `void` is the correct type here.

 Cheers!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58612#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list