3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tz = new DateTimeZone('CET'); $dt = new DateTime(null, $tz); $dt->setTime(10, 20); print $dt->getTimestamp();
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /in/3BNRa on line 5 1427188800
Output for 5.6.28, 7.0.14 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
1427188800
Output for 7.0.6
1462267200
Output for 7.0.5
1459675200
Output for 7.0.4
1457601600
Output for 7.0.3
1458292800
Output for 7.0.2
1458724800
Output for 7.0.1
1458811200
Output for 7.0.0
1459070400
Output for 5.6.21
1462180800
Output for 5.6.20
1460280000
Output for 5.6.19
1457428800
Output for 5.6.18
1458033600
Output for 5.6.17
1458379200
Output for 5.6.16
1459156800
Output for 5.6.15
1459243200
Output for 5.6.14
1459588800
Output for 5.6.13
1460712000
Output for 5.6.12
1461144000
Output for 5.6.11
1461489600
Output for 5.6.10
1461576000
Output for 5.6.9
1461748800
Output for 5.6.8
1462008000
Output for 5.5.35
1463908800
Output for 5.5.34
1460366400
Output for 5.5.33
1457515200
Output for 5.5.32
1458206400
Output for 5.5.31
1458552000
Output for 5.5.30
1459502400
Output for 5.5.29
1460884800
Output for 5.5.28
1461230400
Output for 5.5.27
1461316800
Output for 5.5.26
1461662400
Output for 5.5.25
1461835200
Output for 5.5.24
1464081600
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45
1447060800
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::getTimestamp() in /in/3BNRa on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTimeZone' not found in /in/3BNRa on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/3BNRa on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/3BNRa on line 3

preferences:
285.36 ms | 401 KiB | 323 Q