3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function setCampo($nome,$value) { $valori[$nome] = $value; print_r($valori); } $g = explode('.',(string)((int)'21668' / 365.25)); print_r($g); $anni = intval($g[0]); $mesi = intval((float)("0.".$g[1]) * 12); setCampo('eta', $anni.'a '.$mesi.'m' ); setCampo('eta_a', "$anni"); setCampo('eta_m', "$mesi");
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => 59 [1] => 323750855578 ) Array ( [eta] => 59a 3m ) Array ( [eta_a] => 59 ) Array ( [eta_m] => 3 )