3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inizio = new DateTime('2022-03-21 23:00.000001 Europe/Rome'); $fine = new DateTime('2022-03-22 05:05.000002 Europe/Rome'); $differenza = date_diff($fine,$inizio); $output = $differenza->i; var_dump($output); $string = $output . ''; if(strlen($output . '') == 1) $string = '0' . $output; var_dump($string, 'Stampa su schermo il mio oggetto DateInterval contenuto in $differenza: ', $differenza, $differenza->format('%R%a days')); //Formato con riempimento 0 var_dump($differenza->format('%I'));
Output for git.master, git.master_jit, rfc.property-hooks
int(5) string(2) "05" string(72) "Stampa su schermo il mio oggetto DateInterval contenuto in $differenza: " object(DateInterval)#3 (10) { ["y"]=> int(1) ["m"]=> int(0) ["d"]=> int(0) ["h"]=> int(6) ["i"]=> int(5) ["s"]=> int(0) ["f"]=> float(0) ["invert"]=> int(1) ["days"]=> int(365) ["from_string"]=> bool(false) } string(9) "-365 days" string(2) "05"

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:
114.98 ms | 406 KiB | 5 Q