ArrayHash empty property problem
- ajda2
- Member | 66
Hi,
I found currious situation about \Nette\Utils\ArrayHash
.
ArrayHash
stores data as \stdClass
ArrayHash code from nette/utils v2.4.5, which require PHP min v5.6
When you try set empty $key
it work for PHP v 7.1, but not for
PHP 7.0 and less
If you are not lucky and run on older PHP you will get:
Fatal error: Cannot access empty property in /var/www/vhosts/darujspravne-new-dev.dark-side.cz/vendor/nette/utils/src/Utils/ArrayHash.php on line 67
It is OK, but you dont have any stacktrace or any instruction to find what cause the problem.
Summary
This works only in PHP 7.1
ArrayHash possible fix for older PHP:
I post this problem here, before create pull request with fix, because I want to ask, if Im missing some reason to not fix this.
What do you think?