"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Permalink
Just did a brand new install of concrete5 8.5.1 on PHP 7.3.6 using Composer 1.8.5 perhttps://documentation.concrete5.org/developers/installation/installa...

composer create-project -n concrete5/composer hello_world
./vendor/bin/concrete5 c5:install -i


Front end is fine, but when logging on to backend usinghttp://example.com/index.php/dashboard/welcome,... get the following.

Whoops\Exception\ErrorException thrown with message ""continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?"


Stacktrace:
#39 Whoops\Exception\ErrorException in /var/www/hello_world/vendor/zendframework/zend-stdlib/src/ArrayObject.php:426
#38 Whoops\Run:handleError in /var/www/hello_world/vendor/composer/ClassLoader.php:444
#37 include in /var/www/hello_world/vendor/composer/ClassLoader.php:444
#36 Composer\Autoload\includeFile in /var/www/hello_world/vendor/composer/ClassLoader.php:322
#35 Composer\Autoload\ClassLoader:loadClass in [internal]:0
#34 spl_autoload_call in /var/www/hello_world/vendor/zendframework/zend-stdlib/src/Parameters.php:29
#33 Zend\Stdlib\Parameters:__construct in /var/www/hello_world/vendor/zendframework/zend-http/src/Request.php:306
.


..
/var/www/hello_world/vendor/zendframework/zend-stdlib/src/ArrayObject.php
        $ar                        = unserialize($data);
        $this->protectedProperties = array_keys(get_object_vars($this));
        $this->setFlags($ar['flag']);
        $this->exchangeArray($ar['storage']);
        $this->setIteratorClass($ar['iteratorClass']);
        foreach ($ar as $k => $v) {
            switch ($k) {
                case 'flag':
                    $this->setFlags($v);
                    break;
                case 'storage':
                    $this->exchangeArray($v);
                    break;


Note sure if this is relevant:

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package league/url is abandoned, you should avoid using it. Use league/uri instead.
Generating autoload files
Warning: Ambiguous class resolution, "Normalizer" was found in both "/var/www/hello_world/vendor/patchwork/utf8/src/Normalizer.php" and "/var/www/hello_world/vendor/voku/portable-utf8/src/Normalizer.php", the first will be used.
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
[michael@myserver hello_world]$

Recommendations?

 
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
I just checked that file on recently downloaded 8.5.1 and this is the code I found...
public function unserialize($data)
    {
        $ar                        = unserialize($data);
        $this->protectedProperties = array_keys(get_object_vars($this));
        $this->setFlags($ar['flag']);
        $this->exchangeArray($ar['storage']);
        $this->setIteratorClass($ar['iteratorClass']);
        foreach ($ar as $k => $v) {
            switch ($k) {
                case 'flag':
                    $this->setFlags($v);
                    break;
                case 'storage':
                    $this->exchangeArray($v);
                    break;
NotionCommotion replied on at Permalink Reply
Thanks ConcreteOwl, If I use the latest packages, I see how zendframework fixed this issue with 3.2.1 on Jul 10, 2018

https://packagist.org/packages/concrete5/composer
https://github.com/concrete5/composer
composer/composer.json
  "require": {
    ...
    "concrete5/core": "^8.2",
    ...
  },
https://packagist.org/packages/concrete5/core
https://github.com/concrete5/concrete5-core
concrete5-core/composer.json
  "require": {
    ...
   "concrete5/zend-queue": "0.9.*",
    ...

But If I look at the file dates for vendor/zendframework/zend-stdlib/src/* and CHANGELOG.md, I am using 2.7.7 - 2016-04-12. Maybe of interest, but 2.7 is its own branch release.

I first tried to fix the issue by modifying my local composer.json file to require zendframework/zend-stdlib 3.2.1, but it resulted in "Your requirements could not be resolved to an installable set of packages" error. I then changed vendor/concrete5/zend-queue/composer.json to require zendframework/zend-stdlib 3.2.1, but composer ignored it.

I will post this issue as an error athttps://github.com/concrete5/composer/issues.... In the interim, and short term workarounds?
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Yes edit the concrete/vendor/zendframework/zend-stdlib/src/ArrayObject.php file and change 'continue' to 'continue 2'
NotionCommotion replied on at Permalink Reply
Right after posting my previously reply asking for an interim solution, I can to that same conclusion (well, almost, I was going to use break). But then get this error. Then just got a comment on my github issue stating that I need to use the concrete5 dependency patches package, so will give it a try. I appreciate your help.

preg_match(): Compilation failed: invalid range in character class at offset 4
if (!preg_match("/^[\w-:]+$/", $tag)) { /*$tag is "div" */