3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = false; var_dump($foo); $foo["bar"] = "baz"; var_dump($foo); echo("---\nSo changing a variable's type is perfectly fine, right?\n---\n"); $foo = new time(); var_dump($foo); $foo["bar"] = "baz"; var_dump($foo);
based on GMKA5
Output for 7.0.0 - 7.2.0
bool(false) array(1) { ["bar"]=> string(3) "baz" } --- So changing a variable's type is perfectly fine, right? --- Fatal error: Uncaught Error: Class 'time' not found in /in/jDEna:9 Stack trace: #0 {main} thrown in /in/jDEna on line 9
Process exited with code 255.
Output for 5.0.0 - 5.6.28
bool(false) array(1) { ["bar"]=> string(3) "baz" } --- So changing a variable's type is perfectly fine, right? --- Fatal error: Class 'time' not found in /in/jDEna on line 9
Process exited with code 255.
Output for 4.3.2 - 4.4.9
bool(false) array(1) { ["bar"]=> string(3) "baz" } --- So changing a variable's type is perfectly fine, right? --- Fatal error: Cannot instantiate non-existent class: time in /in/jDEna on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
bool(false) array(1) { ["bar"]=> string(3) "baz" } --- So changing a variable's type is perfectly fine, right? --- Fatal error: Cannot instantiate non-existent class: time in /in/jDEna on line 9