3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/New_York'); $date = new DateTime(); echo json_encode($date, 1); var_dump(json_last_error(), json_last_error_msg());
Output for 8.3.4
{"date":"2014-06-19 23:00:47.007091","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.3.3
{"date":"2014-06-19 23:00:47.007082","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.3.2
{"date":"2014-06-19 23:00:47.003615","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.3.1
{"date":"2014-06-19 23:00:47.004105","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.3.0
{"date":"2014-06-19 23:00:47.003824","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.17
{"date":"2014-06-19 23:00:47.007056","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.16
{"date":"2014-06-19 23:00:47.007963","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.17, 8.2.15
{"date":"2014-06-19 23:00:47.003787","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.29, 8.2.14
{"date":"2014-06-19 23:00:47.003661","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.13
{"date":"2014-06-19 23:00:47.003829","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.12
{"date":"2014-06-19 23:00:47.003713","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.11
{"date":"2014-06-19 23:00:47.004593","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.10
{"date":"2014-06-19 23:00:47.005381","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.9
{"date":"2014-06-19 23:00:47.004117","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.8
{"date":"2014-06-19 23:00:47.004276","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.7
{"date":"2014-06-19 23:00:47.003905","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.6
{"date":"2014-06-19 23:00:47.004115","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.5
{"date":"2014-06-19 23:00:47.005266","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.4
{"date":"2014-06-19 23:00:47.004122","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.3
{"date":"2014-06-19 23:00:47.003789","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.2
{"date":"2014-06-19 23:00:47.003899","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.1
{"date":"2014-06-19 23:00:47.003911","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.2.0
{"date":"2014-06-19 23:00:47.003901","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.27
{"date":"2014-06-19 23:00:47.004087","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.26
{"date":"2014-06-19 23:00:47.005260","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.25
{"date":"2014-06-19 23:00:47.003729","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.24
{"date":"2014-06-19 23:00:47.004173","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.23
{"date":"2014-06-19 23:00:47.005015","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.22
{"date":"2014-06-19 23:00:47.003602","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.21
{"date":"2014-06-19 23:00:47.003919","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.20
{"date":"2014-06-19 23:00:47.003814","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.19
{"date":"2014-06-19 23:00:47.003638","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.18
{"date":"2014-06-19 23:00:47.003799","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.17
{"date":"2014-06-19 23:00:47.004512","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.16
{"date":"2014-06-19 23:00:47.003769","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.15
{"date":"2014-06-19 23:00:47.003510","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.14
{"date":"2014-06-19 23:00:47.003616","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.13
{"date":"2014-06-19 23:00:47.003867","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.12
{"date":"2014-06-19 23:00:47.003519","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.11
{"date":"2014-06-19 23:00:47.003590","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.10
{"date":"2014-06-19 23:00:47.003601","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.9
{"date":"2014-06-19 23:00:47.003468","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.8
{"date":"2014-06-19 23:00:47.003546","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.7
{"date":"2014-06-19 23:00:47.003262","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.6
{"date":"2014-06-19 23:00:47.003631","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.5
{"date":"2014-06-19 23:00:47.004066","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.4
{"date":"2014-06-19 23:00:47.003906","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.3
{"date":"2014-06-19 23:00:47.003621","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.2
{"date":"2014-06-19 23:00:47.003608","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.1
{"date":"2014-06-19 23:00:47.003726","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.1.0
{"date":"2014-06-19 23:00:47.003523","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.30
{"date":"2014-06-19 23:00:47.003323","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.28
{"date":"2014-06-19 23:00:47.003321","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.27
{"date":"2014-06-19 23:00:47.003365","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.26
{"date":"2014-06-19 23:00:47.003449","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.25
{"date":"2014-06-19 23:00:47.003440","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.24
{"date":"2014-06-19 23:00:47.003794","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.23
{"date":"2014-06-19 23:00:47.003216","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.22
{"date":"2014-06-19 23:00:47.003232","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.21
{"date":"2014-06-19 23:00:47.003478","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.20
{"date":"2014-06-19 23:00:47.003172","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.19
{"date":"2014-06-19 23:00:47.003707","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.18
{"date":"2014-06-19 23:00:47.003380","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.16
{"date":"2014-06-19 23:00:47.003722","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.15
{"date":"2014-06-19 23:00:47.005357","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.14
{"date":"2014-06-19 23:00:47.003611","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.13
{"date":"2014-06-19 23:00:47.002392","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.12
{"date":"2014-06-19 23:00:47.003700","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.11
{"date":"2014-06-19 23:00:47.003648","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.10
{"date":"2014-06-19 23:00:47.004060","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.9
{"date":"2014-06-19 23:00:47.003416","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.8
{"date":"2014-06-19 23:00:47.007873","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.7
{"date":"2014-06-19 23:00:47.003836","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.6
{"date":"2014-06-19 23:00:47.003582","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.5
{"date":"2014-06-19 23:00:47.003859","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.3
{"date":"2014-06-19 23:00:47.009277","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.2
{"date":"2014-06-19 23:00:47.009242","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.1
{"date":"2014-06-19 23:00:47.003530","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 8.0.0
{"date":"2014-06-19 23:00:47.009206","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.33
{"date":"2014-06-19 23:00:47.001971","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.32
{"date":"2014-06-19 23:00:47.002922","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.30
{"date":"2014-06-19 23:00:47.003022","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.29
{"date":"2014-06-19 23:00:47.003260","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.28
{"date":"2014-06-19 23:00:47.003166","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.27
{"date":"2014-06-19 23:00:47.003138","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.26
{"date":"2014-06-19 23:00:47.003015","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.25
{"date":"2014-06-19 23:00:47.003310","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.24
{"date":"2014-06-19 23:00:47.003545","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.23
{"date":"2014-06-19 23:00:47.003251","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.22
{"date":"2014-06-19 23:00:47.008576","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.21
{"date":"2014-06-19 23:00:47.007115","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.20
{"date":"2014-06-19 23:00:47.003311","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.19
{"date":"2014-06-19 23:00:47.003441","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.16
{"date":"2014-06-19 23:00:47.008204","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.15
{"date":"2014-06-19 23:00:47.010810","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.14
{"date":"2014-06-19 23:00:47.012813","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.13
{"date":"2014-06-19 23:00:47.010770","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.12
{"date":"2014-06-19 23:00:47.009543","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.11
{"date":"2014-06-19 23:00:47.008523","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.10
{"date":"2014-06-19 23:00:47.008948","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.9
{"date":"2014-06-19 23:00:47.008635","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.8
{"date":"2014-06-19 23:00:47.011394","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.7
{"date":"2014-06-19 23:00:47.010703","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.6
{"date":"2014-06-19 23:00:47.000223","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.5
{"date":"2014-06-19 23:00:47.002024","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.4
{"date":"2014-06-19 23:00:47.008869","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.3
{"date":"2014-06-19 23:00:47.008053","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.4.0
{"date":"2014-06-19 23:00:47.000423","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.33
{"date":"2014-06-19 23:00:47.002417","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.32
{"date":"2014-06-19 23:00:47.001925","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.31
{"date":"2014-06-19 23:00:47.003292","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.30
{"date":"2014-06-19 23:00:47.003664","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.29
{"date":"2014-06-19 23:00:47.008165","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.28
{"date":"2014-06-19 23:00:47.008392","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.27
{"date":"2014-06-19 23:00:47.008297","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.26
{"date":"2014-06-19 23:00:47.010508","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.25
{"date":"2014-06-19 23:00:47.008402","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.24
{"date":"2014-06-19 23:00:47.011843","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.23
{"date":"2014-06-19 23:00:47.008484","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.21
{"date":"2014-06-19 23:00:47.008874","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.20
{"date":"2014-06-19 23:00:47.012449","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.19
{"date":"2014-06-19 23:00:47.009412","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.18
{"date":"2014-06-19 23:00:47.004159","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.17
{"date":"2014-06-19 23:00:47.009675","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.16
{"date":"2014-06-19 23:00:47.012152","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.3.12
{"date":"2014-06-19 23:00:47.000138","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.2.29, 7.2.33
{"date":"2014-06-19 23:00:47.008397","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.2.32
{"date":"2014-06-19 23:00:47.011396","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.2.31
{"date":"2014-06-19 23:00:47.008994","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.2.30
{"date":"2014-06-19 23:00:47.008619","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.2.6
{"date":"2014-06-19 23:00:47.004776","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.2.0
{"date":"2014-06-19 23:00:47.003408","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.1.20
{"date":"2014-06-19 23:00:47.001737","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.1.10
{"date":"2014-06-19 23:00:47.003861","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.1.7
{"date":"2014-06-19 23:00:47.002427","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.1.6
{"date":"2014-06-19 23:00:47.012216","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.1.5
{"date":"2014-06-19 23:00:47.011450","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 7.1.0
{"date":"2014-06-19 23:00:47.004008","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 5.5.14 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20
{"date":"2014-06-19 23:00:47.000000","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 5.5.0 - 5.5.13
{"date":"2014-06-19 23:00:47","timezone_type":3,"timezone":"America\/New_York"}int(0) string(8) "No error"
Output for 5.4.30 - 5.4.45
{"date":"2014-06-19 23:00:47.000000","timezone_type":3,"timezone":"America\/New_York"} Fatal error: Call to undefined function json_last_error_msg() in /in/Cl7ta on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.29
{"date":"2014-06-19 23:00:47","timezone_type":3,"timezone":"America\/New_York"} Fatal error: Call to undefined function json_last_error_msg() in /in/Cl7ta on line 9
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Warning: json_encode() expects exactly 1 parameter, 2 given in /in/Cl7ta on line 8 Fatal error: Call to undefined function json_last_error() in /in/Cl7ta on line 9
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Cl7ta on line 5
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/Cl7ta 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/Cl7ta on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Cl7ta 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/Cl7ta on line 3

preferences:
271.77 ms | 401 KiB | 350 Q