You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming a config like {"foo": "bar"}
Testing $config->has('foo.bar.baz')
will throw PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, string given in /.../vendor/hassankhan/config/src/AbstractConfig.php:127
A simple fix to make has() return expected false in this case could be to add is_array($root) && .. before running the array_key_exists($segment, $root) statement
The text was updated successfully, but these errors were encountered:
omniError
added a commit
to omniError/config
that referenced
this issue
Mar 10, 2023
Assuming a config like
{"foo": "bar"}
Testing
$config->has('foo.bar.baz')
will throw
PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, string given in /.../vendor/hassankhan/config/src/AbstractConfig.php:127
A simple fix to make
has()
return expectedfalse
in this case could be to addis_array($root) && ..
before running thearray_key_exists($segment, $root)
statementThe text was updated successfully, but these errors were encountered: