user image

Eslam Zedan
Published in : 2022-02-24

Warning appears in Zend framework

PHP & Mysql

Hello,

I am Working on Zend 2 and there are warning that appears in Zend framework itself:

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/html/vendor/zendframework/library/Zend/Stdlib/ArrayObject.php on line 426

And here is the code that returns the problem:

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;
                case 'iteratorClass':
                    $this->setIteratorClass($v);
                    break;
                case 'protectedProperties':
                    continue; #This is the line 426
                default:
                    $this->__set($k, $v);
            }
        }
    }

Comments

walid mahmoud Date : 2022-02-24

Best answers

4

Best answers

4

you can replace 
continue with continue 2 
the warning will disappear

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

PHP mail function goes to spam not inbox
Publish date: 2022-02-28 | Comments: 2

Tag: PHP & Mysql

ERROR 1410 (42000): You are not allowed to create a user with GRANT
Publish date: 2022-04-01 | Comments: 2

Tag: PHP & Mysql

MySQL - Lost connection to MySQL server during query - Required a solution.
Publish date: 2022-03-03 | Comments: 1

Tag: PHP & Mysql

Mysql query: How do I count the day streak of particular user?
Publish date: 2022-03-01 | Comments: 4

Tag: PHP & Mysql

mysql service start not exist
Publish date: 2022-02-23 | Comments: 4

Tag: PHP & Mysql

CodeIgniter route does not work
Publish date: 2022-02-22 | Comments: 4

Tag: PHP & Mysql

php difference between two times in hours
Publish date: 2022-02-25 | Comments: 2

Tag: PHP & Mysql