3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exception = new \exception(uniqid()); $reference = & $exception; var_dump(spl_object_hash($reference) === spl_object_hash($exception)); var_dump(spl_object_hash($reference) === spl_object_hash($exception = new \exception(uniqid()))); $exception = spl_object_hash($exception = new \exception(uniqid())); var_dump(spl_object_hash($reference) === spl_object_hash($exception));
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0
bool(true) bool(false) Warning: spl_object_hash() expects parameter 1 to be object, string given in /in/noTcb on line 11 Warning: spl_object_hash() expects parameter 1 to be object, string given in /in/noTcb on line 11 bool(true)
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 10 bool(true) bool(false) Warning: spl_object_hash() expects parameter 1 to be object, string given in /in/noTcb on line 11 Warning: spl_object_hash() expects parameter 1 to be object, string given in /in/noTcb on line 11 bool(true)
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 10 Fatal error: Call to undefined function spl_object_hash() in /in/noTcb on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 10 Fatal error: Cannot instantiate non-existent class: exception in /in/noTcb on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 8 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/noTcb on line 10 Fatal error: Cannot instantiate non-existent class: exception in /in/noTcb on line 4

preferences:
104.58 ms | 402 KiB | 176 Q