Skip to content

The Optional of ArrayObject has Inconsistent behavior for __get and __isset.#33971

Closed
limingxinleo wants to merge 1 commit intolaravel:7.xfrom
limingxinleo:7.x-original-fix
Closed

The Optional of ArrayObject has Inconsistent behavior for __get and __isset.#33971
limingxinleo wants to merge 1 commit intolaravel:7.xfrom
limingxinleo:7.x-original-fix

Conversation

@limingxinleo
Copy link
Copy Markdown

$obj = new \ArrayObject(['id' => $id = uniqid()]);

$optional = new Optional($obj);

$this->assertTrue(isset($optional['id'])); // true
$this->assertSame($id, $optional['id']); // true

$this->assertTrue(isset($optional->id)); // true
$this->assertSame($id, $optional->id); // false

@limingxinleo
Copy link
Copy Markdown
Author

I think this code should be removed from optional.

image

But, there are many test cases for it.

@limingxinleo limingxinleo changed the title The Optional of ArrayObject has Inconsistent performance for __get and __isset. The Optional of ArrayObject has Inconsistent behavior for __get and __isset. Aug 22, 2020
@taylorotwell
Copy link
Copy Markdown
Member

No plans to change. I'm not sure this is really a big deal.

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