Eslam Zedan
Published in : 2022-02-24
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); } } }
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
walid mahmoud Date : 2022-02-24
Best answers
4
Best answers
4
you can replace
continue with continue 2
the warning will disappear