Created
April 11, 2022 15:15
-
-
Save SerafimArts/a2a8ffefb1e8bba026e882e16b8bab47 to your computer and use it in GitHub Desktop.
phpwtf-2
This file contains hidden or 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
<?php | |
class Example | |
{ | |
public function __construct( | |
public ?string $value = null, | |
) { | |
} | |
} | |
/** @var Example $object */ | |
$object = (new \ReflectionClass(Example::class)) | |
->newInstanceWithoutConstructor(); | |
echo $object->value; // Well, wut a happened? | |
// TL;DR; For example, Doctrine Hydrator may fail when promoted properties has been used. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment