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; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 25
Branch analysis from position: 22
filename:       /in/PRVeu
function name:  (null)
number of ops:  33
compiled vars:  !0 = $dia, !1 = $mes, !2 = $ano, !3 = $dianaz, !4 = $mesnaz, !5 = $anonaz, !6 = $edad
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'date'
          1        FETCH_CONSTANT                                   ~7      'j'
          2        SEND_VAL                                                 ~7
          3        DO_ICALL                                         $8      
          4        ASSIGN                                                   !0, $8
    5     5        INIT_FCALL                                               'date'
          6        FETCH_CONSTANT                                   ~10     'n'
          7        SEND_VAL                                                 ~10
          8        DO_ICALL                                         $11     
          9        ASSIGN                                                   !1, $11
    6    10        INIT_FCALL                                               'date'
         11        FETCH_CONSTANT                                   ~13     'Y'
         12        SEND_VAL                                                 ~13
         13        DO_ICALL                                         $14     
         14        ASSIGN                                                   !2, $14
   10    15        ASSIGN                                                   !3, 2
   11    16        ASSIGN                                                   !4, 6
   12    17        ASSIGN                                                   !5, 1983
   16    18        IS_EQUAL                                         ~19     !4, !1
         19      > JMPZ_EX                                          ~19     ~19, ->22
         20    >   IS_SMALLER                                       ~20     !0, !3
         21        BOOL                                             ~19     ~20
         22    > > JMPZ                                                     ~19, ->25
   17    23    >   SUB                                              ~21     !2, 1
         24        ASSIGN                                                   !2, ~21
   21    25    >   IS_SMALLER                                               !1, !4
         26      > JMPZ                                                     ~23, ->29
   22    27    >   SUB                                              ~24     !2, 1
         28        ASSIGN                                                   !2, ~24
   26    29    >   SUB                                              ~26     !2, !5
         30        ASSIGN                                                   !6, ~26
   28    31        ECHO                                                     !6
   30    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.24 ms | 1388 KiB | 15 Q