3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class SomeClass {} $instance = new SomeClass(); $reference = &$instance; echo (($instance === $reference) ? 'TRUE' : 'FALSE') ."\n"; $assigned = $instance; echo (($instance === $assigned) ? 'TRUE' : 'FALSE') ."\n"; $instance = null; echo (isset($instance) ? $instance : "NULL") . "\n"; echo (isset($assigned) ? $assigned : "NULL") . "\n"; echo (isset($reference) ? $reference : "NULL") . "\n";
based on Qo8vB
Output for 7.1.0 - 7.2.0
TRUE TRUE NULL Recoverable fatal error: Object of class SomeClass could not be converted to string in /in/8ZQF7 on line 17
Process exited with code 255.
Output for 5.3.21 - 7.0.20
TRUE TRUE NULL Catchable fatal error: Object of class SomeClass could not be converted to string in /in/8ZQF7 on line 17
Process exited with code 255.