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 $copy = clone $orig; $copy->test = "modified"; die("Orig is: {$orig->test}"); // Gives 'modified' instead of 'original'

preferences:
44.1 ms | 1418 KiB | 5 Q