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:
19.67 ms | 474 KiB | 4 Q