Baikal: php 7.2 each() function is deprecated

Created on 29 Oct 2017  路  8Comments  路  Source: sabre-io/Baikal

As you can see here the each() function is deprecated in php7.2 so install is impossible

https://wiki.php.net/rfc/deprecations_php_7_2

error message

ErrorException: The each() function is deprecated. This message will be suppressed on further calls in /home/jf/git/Baikal/Core/Frameworks/Flake/Core/Render/Container.php:62
Stack trace:

0 [internal function]: Baikal\Framework::exception_error_handler(8192, 'The each() func...', '/home/jf/git/Ba...', 62, Array)

1 /home/jf/git/Baikal/Core/Frameworks/Flake/Core/Render/Container.php(62): each(Array)

2 /home/jf/git/Baikal/Core/Frameworks/Flake/Controller/Page.php(83): Flake\Core\Render\Container->execute()

3 /home/jf/git/Baikal/Core/Frameworks/BaikalAdmin/WWWRoot/install/index.php(83): Flake\Controller\Page->render()

4 {main}

Where to change in code

Function
each
Found usages (9 usages found)
Baikal (9 usages found)
Core/Frameworks/Flake (1 usage found)
Framework.php (1 usage found)
125 while (list($key, $val) = each($process)) {
Core/Frameworks/Flake/Controller (1 usage found)
Cli.php (1 usage found)
43 while (list($sKey, ) = each($this->aSequence)) {
Core/Frameworks/Flake/Core (1 usage found)
Collection.php (1 usage found)
66 list($key, $val) = each($this->aCollection);
Core/Frameworks/Flake/Core/Render (3 usages found)
Container.php (3 usages found)
62 while (list($sKey, ) = each($this->aSequence)) {
70 while (list($sKey, ) = each($this->aSequence)) {
76 while (list($sZone, ) = each($this->aBlocks)) {
Core/Frameworks/Flake/Util (2 usages found)
Router.php (1 usage found)
63 while (list($sRoute, ) = each($aRoutes)) {
Tools.php (1 usage found)
78 while (list($key, $val) = each($array_in)) {
vendor/friendsofphp/php-cs-fixer/Symfony/CS/Fixer/PSR2 (1 usage found)
PhpClosingTagFixer.php (1 usage found)
42 list($index, $token) = each($closeTags);

Most helpful comment

Just installed Ubuntu Server 18.04, which has default PHP 7.2. This issue is still present.

All 8 comments

"php" : ">=5.5", Its made a very old php version

FWIW, disabling PHP errors won't disable the Symfony framework from showing errors. Temporary workaround until Baikal is updated is to comment out throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); at the bottom of baikal/Core/Frameworks/Baikal/Framework.php

What is solution for D7? (7.5.9)

This is still happening. Cannot install on 7.2.

There wasn't any release since the merge, so to use it with PHP 7.2, you will need to use the master branch (https://github.com/sabre-io/Baikal/archive/master.zip)

@oliverpool I still get this error message (each is deprecated) with the version you linked. Is it required to change something else? I use PHP 7.2.5-0ubuntu0.18.04.1 (cli) on nginx/1.14.0

EDIT: It works for me now. Thanks!

luckily my VPS permit me to choose the php version
with PHP 7.2 this issue persist
with PHP 7.1 this issue is not present

Just installed Ubuntu Server 18.04, which has default PHP 7.2. This issue is still present.

Was this page helpful?
0 / 5 - 0 ratings