[wp-trac] [WordPress Trac] #42814: PHP 7.2 Warning: ...wp-includes/post-template.php on line 284

WordPress Trac noreply at wordpress.org
Thu Feb 21 01:41:40 UTC 2019


#42814: PHP 7.2 Warning: ...wp-includes/post-template.php on line 284
-------------------------------------------------+-------------------------
 Reporter:  internetwerk                         |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.2
Component:  Posts, Post Types                    |     Version:  4.5
 Severity:  normal                               |  Resolution:
 Keywords:  dev-feedback has-patch 2nd-opinion   |     Focuses:
  php73 needs-refresh needs-unit-tests           |
-------------------------------------------------+-------------------------

Comment (by DrLightman):

 I just upgraded from PHP 5.6.40 to PHP 7.3 and I started to get the same
 warning too on WP 4.9.8

 I'm posting my xdebug's stack trace hoping it can be of any help. In my
 case the cause can be related to /amp/ plus /glue-for-yoast-seo-amp/
 plugins.


 {{{
 PHP Warning:  count(): Parameter must be an array or an object that
 implements Countable in /var/www/html/wp-includes/post-template.php on
 line 284
 PHP Stack trace:
 PHP   1. {main}() /var/www/html/index.php:0
 PHP   2. require() /var/www/html/index.php:17
 PHP   3. require_once() /var/www/html/wp-blog-header.php:19
 PHP   4. do_action() /var/www/html/wp-includes/template-loader.php:12
 PHP   5. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:453
 PHP   6. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-
 hook.php:310
 PHP   7. amp_render() /var/www/html/wp-includes/class-wp-hook.php:286
 PHP   8. amp_render_post() /var/www/html/wp-
 content/plugins/amp/amp.php:284
 PHP   9. AMP_Post_Template->load() /var/www/html/wp-
 content/plugins/amp/amp.php:333
 PHP  10. AMP_Post_Template->load_parts() /var/www/html/wp-
 content/plugins/amp/includes/templates/class-amp-post-template.php:200
 PHP  11. AMP_Post_Template->verify_and_include() /var/www/html/wp-
 content/plugins/amp/includes/templates/class-amp-post-template.php:211
 PHP  12. include() /var/www/html/wp-content/plugins/amp/includes/templates
 /class-amp-post-template.php:441
 PHP  13. AMP_Post_Template->load_parts() /var/www/html/wp-content/themes
 /my-theme/amp-template-0.7/single.php:19
 PHP  14. AMP_Post_Template->verify_and_include() /var/www/html/wp-
 content/plugins/amp/includes/templates/class-amp-post-template.php:211
 PHP  15. include() /var/www/html/wp-content/plugins/amp/includes/templates
 /class-amp-post-template.php:441
 PHP  16. do_action() /var/www/html/wp-content/plugins/amp/templates/html-
 start.php:19
 PHP  17. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:453
 PHP  18. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-
 hook.php:310
 PHP  19. YoastSEO_AMP_Frontend->extra_head() /var/www/html/wp-includes
 /class-wp-hook.php:286
 PHP  20. do_action() /var/www/html/wp-content/plugins/glue-for-yoast-seo-
 amp/classes/class-frontend.php:253
 PHP  21. WP_Hook->do_action() /var/www/html/wp-includes/plugin.php:453
 PHP  22. WP_Hook->apply_filters() /var/www/html/wp-includes/class-wp-
 hook.php:310
 PHP  23. WPSEO_OpenGraph->description() /var/www/html/wp-includes/class-
 wp-hook.php:286
 PHP  24. get_the_excerpt() /var/www/html/wp-content/plugins/wordpress-
 seo/frontend/class-opengraph.php:603
 PHP  25. apply_filters() /var/www/html/wp-includes/post-template.php:397
 PHP  26. WP_Hook->apply_filters() /var/www/html/wp-includes/plugin.php:203
 PHP  27. wp_trim_excerpt() /var/www/html/wp-includes/class-wp-hook.php:288
 PHP  28. get_the_content() /var/www/html/wp-includes/formatting.php:3308
 }}}

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


More information about the wp-trac mailing list