phpF
phpF copied to clipboard
`each()` function is deprecated in php 7.2.0
I just updating my php version to 7.2.0, and it seems the each function is deprecated in this version. http://php.net/manual/en/function.each.php
I replaced while \( list\( (.*), (.*) \) = each\( (.*) \) \) \{ with foreach ( $3 as $1 => $2 ) { in src/phpf.php to avoid this problem, but when I tried to run it with PHP 7.2.12, a fatal error occured:
Allowed memory size of 134217728 bytes exhausted (tried to allocate 16777224 bytes)
I don't know why nor how to fix it.
I tried the same thing and got the same error for PHP 7.3 Did you get any solution for this?
I replaced
while \( list\( (.*), (.*) \) = each\( (.*) \) \) \{withforeach ( $3 as $1 => $2 ) {in src/phpf.php to avoid this problem, but when I tried to run it with PHP 7.2.12, a fatal error occured:Allowed memory size of 134217728 bytes exhausted (tried to allocate 16777224 bytes)I don't know why nor how to fix it.
I can only guess that this is a memory leak issue (such as infinite recursion), but haven't researched how to fix it. Given that this project has lost maintenance, perhaps you can find an alternative to it.
I can only guess that this is a memory leak issue (such as infinite recursion), but haven't researched how to fix it. Given that this project has lost maintenance, perhaps you can find an alternative to it.
Any suggestions for alternatives?
Maybe this one: https://github.com/prettier/plugin-php#editor-integration
I will check it out :) Thanks
You're welcome :)