3v4l.org

run code in 300+ PHP versions simultaneously
<?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 ( $interval->days );
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.32, 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, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
33
Output for 7.0.6
627
Output for 7.0.5
597
Output for 7.0.4
573
Output for 7.0.3
581
Output for 7.0.2
586
Output for 7.0.1
587
Output for 7.0.0
590
Output for 5.6.21
626
Output for 5.6.20
604
Output for 5.6.19
571
Output for 5.6.18
578
Output for 5.6.17
583
Output for 5.6.16
591
Output for 5.6.15
592
Output for 5.6.14
596
Output for 5.6.13
609
Output for 5.6.12
614
Output for 5.6.11
617
Output for 5.6.10
619
Output for 5.6.9
621
Output for 5.6.8
624
Output for 5.5.35
646
Output for 5.5.34
605
Output for 5.5.33
572
Output for 5.5.32
580
Output for 5.5.31
584
Output for 5.5.30
595
Output for 5.5.29
611
Output for 5.5.28
615
Output for 5.5.27
616
Output for 5.5.26
620
Output for 5.5.25
623
Output for 5.5.24
648
Output for 5.4.39 - 5.4.45
403
Output for 5.4.34 - 5.4.38
212
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/tD4BE 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/tD4BE on line 2
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/tD4BE on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Undefined class name 'datetime' in /in/tD4BE on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'datetime' in /in/tD4BE on line 2

preferences:
263.04 ms | 401 KiB | 327 Q