3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $start = DateTime::createFromFormat('d-m-Y', '4-4-2015'); $end = new DateTime; $diff = $start->diff($end); echo $diff->days;
based on QGMGm
Output for 5.3.20 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
242
Output for 7.0.6
395
Output for 7.0.5
365
Output for 7.0.4
341
Output for 7.0.3
349
Output for 7.0.2
354
Output for 7.0.1
355
Output for 7.0.0
358
Output for 5.6.21
394
Output for 5.6.20
372
Output for 5.6.19
339
Output for 5.6.18
346
Output for 5.6.17
351
Output for 5.6.16
359
Output for 5.6.15
360
Output for 5.6.14
364
Output for 5.6.13
377
Output for 5.6.12
382
Output for 5.6.11
386
Output for 5.6.10
387
Output for 5.6.9
389
Output for 5.6.8
392
Output for 5.5.35
415
Output for 5.5.34
373
Output for 5.5.33
340
Output for 5.5.32
348
Output for 5.5.31
352
Output for 5.5.30
363
Output for 5.5.29
379
Output for 5.5.28
383
Output for 5.5.27
384
Output for 5.5.26
388
Output for 5.5.25
391
Output for 5.5.24
416