3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime('12:00', new \DateTimeZone('America/Toronto')); $gmt = new \DateTime('16:00', new \DateTimeZone('UTC')); var_dump($date->getTimestamp()); var_dump($gmt->getTimestamp());
Output for 5.6.28, 7.0.14 - 7.1.0
int(1376496000) int(1376496000)
Output for 7.0.6
int(1462204800) int(1462291200)
Output for 7.0.5
int(1459612800) int(1459612800)
Output for 7.0.4
int(1457542800) int(1457625600)
Output for 7.0.3
int(1458230400) int(1458316800)
Output for 7.0.2
int(1458576000) int(1458576000)
Output for 7.0.1
int(1458748800) int(1458748800)
Output for hhvm-3.12.0, 7.0.0
int(1459008000) int(1459008000)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
int(1462118400) int(1462118400)
Output for 5.6.20
int(1460217600) int(1460217600)
Output for 5.6.19
int(1457283600) int(1457280000)
Output for 5.6.18
int(1457971200) int(1457971200)
Output for 5.6.17
int(1458403200) int(1458403200)
Output for 5.6.16
int(1459094400) int(1459094400)
Output for 5.6.15
int(1459180800) int(1459180800)
Output for 5.6.14
int(1459526400) int(1459526400)
Output for 5.6.13
int(1460649600) int(1460649600)
Output for 5.6.12
int(1461081600) int(1461081600)
Output for 5.6.11
int(1461340800) int(1461340800)
Output for 5.6.10
int(1461513600) int(1461513600)
Output for 5.6.9
int(1461686400) int(1461772800)
Output for 5.6.8
int(1461945600) int(1461945600)
Output for 5.6.7
int(1464105600) int(1464105600)
Output for 5.5.35
int(1463846400) int(1463846400)
Output for 5.5.34
int(1460304000) int(1460304000)
Output for 5.5.33
int(1457456400) int(1457452800)
Output for 5.5.32
int(1458144000) int(1458144000)
Output for 5.5.31
int(1458489600) int(1458489600)
Output for 5.5.30
int(1459440000) int(1459440000)
Output for 5.5.29
int(1460822400) int(1460822400)
Output for 5.5.28
int(1461168000) int(1461168000)
Output for 5.5.27
int(1461254400) int(1461254400)
Output for 5.5.26
int(1461600000) int(1461600000)
Output for 5.5.25
int(1461859200) int(1461859200)
Output for 5.5.24
int(1462032000) int(1462032000)
Output for 5.3.0 - 5.4.45
int(1447952400) int(1447948800)
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 3 Fatal error: Call to undefined method DateTime::getTimestamp() in /in/egOPH on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 3 Fatal error: Class 'DateTime' not found in /in/egOPH on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/egOPH on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/egOPH on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/egOPH on line 2