3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $prague = new DateTimeZone('Europe/Prague'); $gmt = new DateTimeZone('GMT'); $gmt2 = new DateTimeZone('GMT'); $utc = new DateTimeZone('UTC'); echo $prague->getName(); var_dump(array( 'dtP' => $dtP, 'dtG' => $dtG, 'dtG2' => $dtG2, 'dtU' => $dtU, '$dtP == $dtG' => $dtP == $dtG, '$dtP === $dtG' => $dtP === $dtG, '$dtG == $dtG2' => $dtG == $dtG2, '$dtG === $dtG2' => $dtG === $dtG2, '$dtG == $dtU' => $dtG == $dtU, '$dtG === $dtU' => $dtG === $dtU, )); var_dump(new DateTime('midnight') == new DateTime('midnight'));
Output for 7.0.0 - 7.1.0
Europe/Prague Notice: Undefined variable: dtP in /in/PM2Zc on line 10 Notice: Undefined variable: dtG in /in/PM2Zc on line 11 Notice: Undefined variable: dtG2 in /in/PM2Zc on line 12 Notice: Undefined variable: dtU in /in/PM2Zc on line 13 Notice: Undefined variable: dtP in /in/PM2Zc on line 14 Notice: Undefined variable: dtG in /in/PM2Zc on line 14 Notice: Undefined variable: dtP in /in/PM2Zc on line 15 Notice: Undefined variable: dtG in /in/PM2Zc on line 15 Notice: Undefined variable: dtG in /in/PM2Zc on line 16 Notice: Undefined variable: dtG2 in /in/PM2Zc on line 16 Notice: Undefined variable: dtG in /in/PM2Zc on line 17 Notice: Undefined variable: dtG2 in /in/PM2Zc on line 17 Notice: Undefined variable: dtG in /in/PM2Zc on line 18 Notice: Undefined variable: dtU in /in/PM2Zc on line 18 Notice: Undefined variable: dtG in /in/PM2Zc on line 19 Notice: Undefined variable: dtU in /in/PM2Zc on line 19 array(10) { ["dtP"]=> NULL ["dtG"]=> NULL ["dtG2"]=> NULL ["dtU"]=> NULL ["$dtP == $dtG"]=> bool(true) ["$dtP === $dtG"]=> bool(true) ["$dtG == $dtG2"]=> bool(true) ["$dtG === $dtG2"]=> bool(true) ["$dtG == $dtU"]=> bool(true) ["$dtG === $dtU"]=> bool(true) } bool(true)
Output for 5.2.0 - 5.6.28
Europe/Prague Notice: Undefined variable: dtP in /in/PM2Zc on line 10 Notice: Undefined variable: dtG in /in/PM2Zc on line 11 Notice: Undefined variable: dtG2 in /in/PM2Zc on line 12 Notice: Undefined variable: dtU in /in/PM2Zc on line 13 Notice: Undefined variable: dtG in /in/PM2Zc on line 14 Notice: Undefined variable: dtP in /in/PM2Zc on line 14 Notice: Undefined variable: dtG in /in/PM2Zc on line 15 Notice: Undefined variable: dtP in /in/PM2Zc on line 15 Notice: Undefined variable: dtG2 in /in/PM2Zc on line 16 Notice: Undefined variable: dtG in /in/PM2Zc on line 16 Notice: Undefined variable: dtG2 in /in/PM2Zc on line 17 Notice: Undefined variable: dtG in /in/PM2Zc on line 17 Notice: Undefined variable: dtU in /in/PM2Zc on line 18 Notice: Undefined variable: dtG in /in/PM2Zc on line 18 Notice: Undefined variable: dtU in /in/PM2Zc on line 19 Notice: Undefined variable: dtG in /in/PM2Zc on line 19 array(10) { ["dtP"]=> NULL ["dtG"]=> NULL ["dtG2"]=> NULL ["dtU"]=> NULL ["$dtP == $dtG"]=> bool(true) ["$dtP === $dtG"]=> bool(true) ["$dtG == $dtG2"]=> bool(true) ["$dtG === $dtG2"]=> bool(true) ["$dtG == $dtU"]=> bool(true) ["$dtG === $dtU"]=> bool(true) } bool(true)
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTimeZone' not found in /in/PM2Zc on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/PM2Zc on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/PM2Zc on line 2