3v4l.org

run code in 500+ PHP versions simultaneously
<?php $orig = new stdClass(); $orig->test = 'original'; $ptr = & $orig->test; // <--- Setting an unused reference changes the behaviour unset($ptr); // $ptr goes away and $orig->test reverts to a normal unreferenced value $copy = clone $orig; $copy->test = "modified"; die("Orig is: {$orig->test}"); // Gives 'modified' instead of 'original'

preferences:
120.55 ms | 1983 KiB | 5 Q