Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #35546 [Validator] check for __get method existence if property i…
…s uninitialized (alekitto) This PR was merged into the 3.4 branch. Discussion ---------- [Validator] check for __get method existence if property is uninitialized | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #35544 | License | MIT Resolve bug #35544. On PHP 7.4, check if object implements `__get` magic method if property is reported as uninitialized before returning null. Commits ------- 427bc3a [Validator] try to call __get method if property is uninitialized
- Loading branch information
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/Symfony/Component/Validator/Tests/Fixtures/Entity_74_Proxy.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Symfony\Component\Validator\Tests\Fixtures; | ||
|
||
class Entity_74_Proxy extends Entity_74 | ||
{ | ||
public string $notUnset; | ||
|
||
public function __construct() | ||
{ | ||
unset($this->uninitialized); | ||
} | ||
|
||
public function __get($name) | ||
{ | ||
return 42; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters