3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = []; $expects = [ [ '2014-09-01', // $timestamp false // $expected - wether or not something SHOULD be in DST ],[ '2014-10-01', false ],[ '2014-10-05 01:00:00.000000', false ],[ '2014-10-05 02:00:00.000000', true ],[ '2014-10-05 03:00:00.000000', true ],[ '2014-11-01', true ],[ '2015-01-01', true ],[ '2015-04-01', true ],[ '2015-04-05 01:00:00.000000', true ],[ '2015-04-05 02:00:00.000000', false ],[ '2015-04-05 03:00:00.000000', false ],[ '2015-04-06', false ],[ '2015-05-01', false ] ]; $timezones_australia = array(122, 125, 127, 128, 129, 130, 133, 134, 136, 138); foreach ($timezones_australia as $timezone) { foreach ($expects as $expected) { $msg = $expected[1] ? 'Expects to be in DST' : 'Expects to not be in DST'; $data[] = [ $timezone, (new DateTime($expected[0]))->getTimestamp(), $expected[1], $msg ] } } print_r($data, 1);
Output for 5.4.0 - 5.4.34
Parse error: syntax error, unexpected '}' in /in/OTpmc on line 58
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/OTpmc on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/OTpmc on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/OTpmc on line 2
Process exited with code 255.