3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['01/01/2016' , '05/05/2016'], ['01/07/2017' , '31/07/2017'], ['01/07/2017' , '01/08/2017'], ['01/07/2017' , '02/08/2017'] ]; foreach ($array as $row) { $start = DateTime::createFromFormat('d/m/Y' , $row[0]); $end = DateTime::createFromFormat('d/m/Y' , $row[1]); $diff = $start->diff($end); printf( "De %s até %s há %d dias.\n", $row[0], $row[1], ($diff->format('%m') * 30) + $diff->format('%d') ); }
Output for git.master, git.master_jit, rfc.property-hooks
De 01/01/2016 até 05/05/2016 há 124 dias. De 01/07/2017 até 31/07/2017 há 30 dias. De 01/07/2017 até 01/08/2017 há 30 dias. De 01/07/2017 até 02/08/2017 há 31 dias.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.02 ms | 401 KiB | 8 Q