3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date1 = new DateTime('12-12-2013'); $date2 = new DateTime('now'); $number1 = (int)$date1->format('U'); $number2 = (int)$date2->format('U'); echo (($number2 - $number1)/60/60);
based on lHmdU
Output for 5.6.28, 7.0.14 - 7.1.0
7516.0997222222
Output for 7.0.6
20961.486388889
Output for 7.0.5
20230.246388889
Output for 7.0.4
19665.863888889
Output for 7.0.3
19858.533055556
Output for 7.0.2
19960.505555556
Output for 7.0.1
19989.088611111
Output for 7.0.0
20062.624444444
Output for 5.6.21
20932.806111111
Output for 5.6.20
20397.243055556
Output for 5.6.19
19601.982777778
Output for 5.6.18
19778.102222222
Output for 5.6.17
19886.756944444
Output for 5.6.16
20087.579444444
Output for 5.6.15
20112.5
Output for 5.6.14
20210.813055556
Output for 5.6.13
20526.722777778
Output for 5.6.12
20636.531944444
Output for 5.6.11
20715.564166667
Output for 5.6.10
20765.309166667
Output for 5.6.9
20818.293333333
Output for 5.6.8
20874.439166667
Output for 5.5.35
21416.603888889
Output for 5.5.34
20423.583611111
Output for 5.5.33
19628.931944444
Output for 5.5.32
19827.656944444
Output for 5.5.31
19913.508888889
Output for 5.5.30
20186.446111111
Output for 5.5.29
20564.844444444
Output for 5.5.28
20663.803055556
Output for 5.5.27
20690.098611111
Output for 5.5.26
20791.757222222
Output for 5.5.25
20846.165
Output for 5.5.24
21453.402222222
Output for 5.4.45
15566.261666667
Output for 5.4.44
15566.260277778
Output for 5.4.43
15566.258611111
Output for 5.4.42
13787.305277778
Output for 5.4.41
13787.304722222
Output for 5.4.40
13787.303611111
Output for 5.4.39
13787.303333333
Output for 5.4.38
13787.303055556
Output for 5.4.37
13787.3025
Output for 5.4.35 - 5.4.36
13787.302222222
Output for 5.4.17 - 5.4.34
7516.1011111111
Output for 5.3.26 - 5.4.16
7516.1013888889
Output for 5.3.5 - 5.3.25
7516.1016666667
Output for 5.2.0 - 5.3.4
7516.1019444444
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/4UBYc on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/4UBYc on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/4UBYc on line 3