8000 [VarDumper] Notice: Undefined offset when dumping casted array from object with PHP7 · Issue #19356 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /div>

[VarDumper] Notice: Undefined offset when dumping casted array from object with PHP7 #19356

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

Closed
tgabi333 opened this issue Jul 13, 2016 · 6 comments

Comments

@tgabi333
Copy link
Contributor
tgabi333 commented Jul 13, 2016

I've got an Undefined offset notice here: https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/VarDumper/Cloner/VarCloner.php#L74

Simplest example:

        $obj = json_decode('{"1":1,"2":1}');
        $array = (array) $obj;
        dump($array);

Environment:

$ composer.phar show | grep symfony/symfony
symfony/symfony                      v2.8.8             The Symfony PHP framework
$ php -v
PHP 7.0.8-3+deb.sury.org~xenial+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.8-3+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies
@tgabi333
Copy link
Contributor Author

Its interesting: https://3v4l.org/ACrH6

@tgabi333
Copy link
Contributor Author
tgabi333 commented Jul 14, 2016

It's okay that is a documented php behavior, But VarDumper should handle it and not raise an Undefined offset notices

@nicolas-grekas
Copy link
Member

Which version are you using? I remember fixing this already but maybe we have a regression?

@tgabi333
Copy link
Contributor Author

which is bundled in symfony 2.8.8

@nicolas-grekas
Copy link
Member

Should be fixed by #19368

@tgabi333
Copy link
Contributor Author

Thanks @nickolas-grekas

nicolas-grekas added a commit that referenced this issue Jul 17, 2016
…ekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[VarDumper] Fix dumping jsons casted as arrays

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19356
| License       | MIT
| Doc PR        | -

Commits
-------

56549e7 [VarDumper] Fix dumping jsons casted as arrays
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3B4A None yet
Development

No branches or pull requests

4 participants
0