[wp-trac] [WordPress Trac] #37227: PHP 7 compatibilty issues in twentythirteen and twentyfourteen

WordPress Trac noreply at wordpress.org
Wed Jun 29 13:39:24 UTC 2016


#37227: PHP 7 compatibilty issues in twentythirteen and twentyfourteen
---------------------------+-----------------------------
 Reporter:  xknown         |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Bundled Theme  |    Version:
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 While running the [https://github.com/sstalle/php7cc php7cc] tool, it
 reported two incompatibilities for the above mentioned themes.

 [http://php.net/manual/fr/migration70.incompatible.php#migration70.incompatible.foreach
 PHP 7 changes the behavior of the foreach loop]. It doesn't longer modify
 the internal array pointer, thus using it with current/reset/etc doesn't
 produce the expected results.

 You can see the different results for PHP 5.x vs PHP 7.x
 https://3v4l.org/oQiI9

 The problematic lines are in the following methods
  - `twentythirteen_the_attached_image` -
 [https://core.trac.wordpress.org/browser/trunk/src/wp-
 content/themes/twentythirteen/functions.php?rev=36709#L421 #]
  - `twentyfourteen_the_attached_image ` -
 [https://core.trac.wordpress.org/browser/trunk/src/wp-
 content/themes/twentyfourteen/functions.php?rev=37040#L322 #]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37227>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list