[wp-trac] [WordPress Trac] #39048: undefined return array var being passed to wp_parse_str

WordPress Trac noreply at wordpress.org
Mon Feb 21 14:07:21 UTC 2022


#39048: undefined return array var being passed to wp_parse_str
--------------------------+----------------------
 Reporter:  pbearne       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------
Changes (by SergeyBiryukov):

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


Comment:

 Hi there, thanks for the patch!

 Unless I'm missing something, for variables passed by reference to there
 is no need to create them in advance.

 Per the [https://www.php.net/manual/en/language.references.whatdo.php PHP
 manual]:
 > If you assign, pass, or return an undefined variable by reference, it
 will get created.

 This is similar to the `$matches` parameter of `preg_match()`, we don't
 generally define that in advance either.

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


More information about the wp-trac mailing list