3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set("Europe/London"); class Base {}; class Test1 extends Base {}; class Test2 extends Base {}; $base = new Base(); $test_2 = new Test2(); $test_1 = new Test1(); var_dump($base == $test_1); var_dump($base == $test_2); var_dump($test_1 == $test_2); class DateTime1 extends DateTime {}; class DateTime2 extends DateTime {}; class DateTime3 extends DateTime2 {}; $date_1 = new DateTime1("2009-02-12 12:47:41 GMT"); $date_2 = new DateTime2("2009-02-12 12:47:41 GMT"); $date_3 = new DateTime3("2009-02-12 12:47:41 GMT"); var_dump($date_1 == $date_2); var_dump($date_1 == $date_3); var_dump($date_2 == $date_3);
Output for 5.2.2 - 7.1.0
bool(false) bool(false) bool(false) bool(true) bool(true) bool(true)
Output for 5.2.0 - 5.2.1
bool(false) bool(false) bool(false) bool(false) bool(false) bool(false)
Output for 5.1.0 - 5.1.6
bool(false) bool(false) bool(false) Fatal error: Class 'DateTime' not found in /in/6nHAn on line 17
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/6nHAn on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/6nHAn on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/6nHAn on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/6nHAn on line 3