[wp-trac] [WordPress Trac] #53540: Use $image[0] instead of $image['0'] in media file

WordPress Trac noreply at wordpress.org
Mon Jun 28 21:05:29 UTC 2021


#53540: Use $image[0] instead of $image['0'] in media file
--------------------------+---------------------
 Reporter:  chintan1896   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.9
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by adamsilverstein):

 @chintan1896 thanks for the patch. I'm curious why you noticed this issue,
 did it create a warning or error in your system? Or was it more something
 you noticed when reviewing the source code?

 When using arrays, PHP will
 [https://www.php.net/manual/en/language.types.array.php automatically
 cast] the '0' string to 0 int, so this is more of a cosmetic fix than
 functional, is that right?

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


More information about the wp-trac mailing list