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

[5.6] Return null if object property is undefined #23267

Merged
merged 2 commits into from
Feb 23, 2018

Conversation

tillkruss
Copy link
Contributor

I just ran into this issue:

$data = (object) ['foo' => 'bar'];

optional($data)->foobar // Undefined property: stdClass::$foobar

I'm not sure if that's intended, but I expected it to return null if it's an object, but the property doesn't exist.

@taylorotwell taylorotwell merged commit 5acb717 into laravel:5.6 Feb 23, 2018
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

Successfully merging this pull request may close these issues.

2 participants