3v4l.org

run code in 300+ PHP versions simultaneously
<?php //fecha actual $dia=date(j); $mes=date(n); $ano=date(Y); //fecha de nacimiento $dianaz=2; $mesnaz=6; $anonaz=1983; //si el mes es el mismo pero el día inferior aun no ha cumplido años, le quitaremos un año al actual if (($mesnaz == $mes) && ($dianaz > $dia)) { $ano=($ano-1); } //si el mes es superior al actual tampoco habrá cumplido años, por eso le quitamos un año al actual if ($mesnaz > $mes) { $ano=($ano-1);} //ya no habría mas condiciones, ahora simplemente restamos los años y mostramos el resultado como su edad $edad=($ano-$anonaz); print $edad; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Undefined constant "j" in /in/PRVeu:4 Stack trace: #0 {main} thrown in /in/PRVeu on line 4
Process exited with code 255.

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.48 ms | 401 KiB | 8 Q