3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //echo date( 'd-m-Y', strtotime('2015-03-07')) - date( 'd-m-Y', strtotime("+ 7 days") ); $t1 = new DateTime( '2015-01-07' ); $t2 = new DateTime( "+7 days" ); echo date_diff($t1, $t2)->days;
based on 1fa58
Output for 5.3.0 - 5.4.32, 5.6.28, 7.0.14 - 7.1.0
112
Output for 7.0.6
489
Output for 5.6.14, 7.0.5
458
Output for 7.0.4
435
Output for 7.0.3
443
Output for 7.0.2
447
Output for 7.0.1
448
Output for 7.0.0
451
Output for hhvm-3.12.0
437
Output for hhvm-3.10.0
455
Output for 5.6.21
488
Output for 5.6.20
465
Output for 5.6.19
432
Output for 5.6.18
440
Output for 5.6.17
444
Output for 5.6.16
452
Output for 5.6.15
454
Output for 5.6.13
471
Output for 5.6.12
475
Output for 5.6.11
479
Output for 5.6.10
481
Output for 5.6.9
483
Output for 5.6.8
485
Output for 5.5.35
508
Output for 5.5.34
467
Output for 5.5.33
433
Output for 5.5.32
442
Output for 5.5.31
445
Output for 5.5.30
457
Output for 5.5.29
472
Output for 5.5.28
477
Output for 5.5.27
478
Output for 5.5.26
482
Output for 5.5.25
484
Output for 5.5.24
509
Output for 5.4.39 - 5.4.45
264
Output for 5.4.34 - 5.4.38
73
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined function date_diff() in /in/IAVh5 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/IAVh5 on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/IAVh5 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/IAVh5 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/IAVh5 on line 5
Process exited with code 255.