3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $expires_at = DateTime::createFromFormat("Y-m-d H:i:s", "2014-08-14 13:22:22"); $now = new DateTime(); $interval = $now->diff($expires_at); $minutes = $interval->days * 24 * 60; $minutes += $interval->h * 60; $minutes += $interval->i; echo ( $minutes );
based on 2R7Vk
Output for 5.3.0 - 5.4.32, 5.6.28, 7.0.14 - 7.1.0
48909
Output for 7.0.6
904072
Output for 7.0.5
860205
Output for 7.0.4
826273
Output for 7.0.3
837829
Output for 7.0.2
843934
Output for 7.0.1
845671
Output for 7.0.0
850085
Output for 5.6.21
902353
Output for 5.6.20
870221
Output for 5.6.19
822442
Output for 5.6.18
832995
Output for 5.6.17
839526
Output for 5.6.16
851631
Output for 5.6.15
853124
Output for 5.6.14
859038
Output for 5.6.13
877992
Output for 5.6.12
884574
Output for 5.6.11
889319
Output for 5.6.10
892303
Output for 5.6.9
895481
Output for 5.6.8
898845
Output for 5.5.35
931377
Output for 5.5.34
871802
Output for 5.5.33
824058
Output for 5.5.32
835979
Output for 5.5.31
841132
Output for 5.5.30
857572
Output for 5.5.29
880277
Output for 5.5.28
886200
Output for 5.5.27
887789
Output for 5.5.26
893890
Output for 5.5.25
897135
Output for 5.5.24
933569
Output for 5.4.45
580348
Output for 5.4.39 - 5.4.44
580347
Output for 5.4.34 - 5.4.38
305683
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/kG300 on line 2
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/kG300 on line 2
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/kG300 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Undefined class name 'datetime' in /in/kG300 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'datetime' in /in/kG300 on line 2