Created
October 17, 2019 09:53
-
-
Save dstogov/d872b01acf2610d941072ee16f08cc98 to your computer and use it in GitHub Desktop.
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
<?php | |
class Foo { | |
public ?string $p; | |
} | |
$a = new Foo; | |
$ref = &$a->p; | |
$ref[] = "bar"; | |
echo "OPS!\n"; |
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
<?php | |
$a = new class { | |
public int $foo = 1; | |
}; | |
$_ = [&$a->foo]; | |
$_[0] += 1; | |
var_dump($a->foo); | |
$_[0] .= "1"; | |
var_dump($a->foo); | |
$_[0] .= "e50"; | |
var_dump($a->foo); |
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
<?php | |
$a = new class { | |
public int $foo = 1; | |
}; | |
$_ = &$a->foo; | |
$_ += 1; | |
var_dump($a->foo); | |
$_ .= "1"; | |
var_dump($a->foo); | |
$_ .= "e50"; | |
var_dump($a->foo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment