PHP 7.2 problems with count() function

I had an app written in PHP 7.0 and after migrating to PHP 7.2, I start seeing error 500 because I couldn't access the web interface. However, in my page, I was able to detect and error in the count function in one of my php files.

Long story short, you will waste hours and hours of your time, trying to find a solution to why PHP 7.2 is behaving this way. Also there are articles that said that this is a common error, and to fix it you will have to install the latest upgrade. Up to the time I am writing this article, even having the latest update, I was able to still see the dirty error.

If you are having several arrays and you were using count() in PHP 7.0 to add all the arrays, don't do it anymore. You can delete the count() function and add the arrays directly.

Done, don't waste your time trying to write your own count functions, or trying to install a patch that honestly doesn't exist until today.

I am disappointing with PHP 7.2 for not making this backward compatible and not giving a clear solution to the problem.




要查看或添加评论,请登录

Cesar Campana的更多文章

  • GKSU deprecation in Ubuntu 18.04

    GKSU deprecation in Ubuntu 18.04

    There are several articles online about several options to overcome the issues of not having GKSU in Ubuntu 18.04.

    1 条评论
  • LinkedIn member: This member chose to be shown as anonymous

    LinkedIn member: This member chose to be shown as anonymous

    In the same way I go and check several profiles for other members in Linkedin, I also receive some visits to my…

    3 条评论

社区洞察

其他会员也浏览了