3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $prop; } $foo = new Foo(); $str = 'abc'; // $str is a string $foo->prop = &$str; var_dump($foo->prop); // "abc" $arr = array(); $foo->prop = $arr; var_dump($foo->prop); // array() var_dump($str); // array() - surprise! $str is now an array

preferences:
62.3 ms | 404 KiB | 5 Q