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, TRUE)->days;
based on EPdmC
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 7.0.5
459
Output for 7.0.4
435
Output for 7.0.3
443
Output for 7.0.2
448
Output for 7.0.1
449
Output for 7.0.0
452
Output for 5.6.21
488
Output for 5.6.20
466
Output for 5.6.19
433
Output for 5.6.18
440
Output for 5.6.17
444
Output for 5.6.16
453
Output for 5.6.15
454
Output for 5.6.14
458
Output for 5.6.13
471
Output for 5.6.12
476
Output for 5.6.11
480
Output for 5.6.10
481
Output for 5.6.9
483
Output for 5.6.8
486
Output for 5.5.35
508
Output for 5.5.34
467
Output for 5.5.33
434
Output for 5.5.32
442
Output for 5.5.31
446
Output for 5.5.30
457
Output for 5.5.29
473
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
510
Output for 5.4.39 - 5.4.43, 5.4.45
264
Output for 5.4.44
266
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/YNAqd on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/YNAqd 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/YNAqd 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/YNAqd on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/YNAqd on line 5
Process exited with code 255.