Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to access array offset on value of type null with php 7.4 #2997

Closed
vasilvestre opened this issue Nov 14, 2019 · 2 comments
Closed

Trying to access array offset on value of type null with php 7.4 #2997

vasilvestre opened this issue Nov 14, 2019 · 2 comments

Comments

@vasilvestre
Copy link
Contributor

vasilvestre commented Nov 14, 2019

Describe the bug
When you try to access admin, using 2.x-dev, this error is shown Trying to access array offset on value of type null
This is a notice.
image

To Reproduce
use php 7.4
composer require symfony/flex
composer require admin
go on /admin

@javiereguiluz
Copy link
Collaborator

In case it's useful, I'm adding the references you mentioned on Symfony Slack:

https://wiki.php.net/rfc/notice-for-non-valid-array-container
and a related issue on Doctrine annotations: doctrine/annotations#273

@vasilvestre
Copy link
Contributor Author

And here's the PHP SRC PR : php/php-src#4386

javiereguiluz added a commit that referenced this issue Nov 15, 2019
This PR was submitted for the master branch but it was merged into the 2.x branch instead (closes #2998).

Discussion
----------

Fix php74 accessarray offset

Fixing #2997

Quick explanation: any scalar access produces a notice on development operation in case of a null value. So you have to check it using is_array is_string methods depending on the type.

Commits
-------

dd639b7 Fixes a problem with array offset on PHP7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants