3v4l.org

run code in 300+ PHP versions simultaneously
<?php // todays date $today = date("Ymd"); function age($birth_date){ list($birth_day,$birth_month,$birth_year) = explode("-",$birth_date); $year_diff = date("Y") - $birth_year; $month_diff = date("m") - $birth_month; $day_diff = date("d") - $birth_day; if ($day_diff < 0 && $month_diff==0){$year_diff--;} if ($day_diff < 0 && $month_diff < 0){$year_diff--;} return $year_diff; } //Call the age function age('');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vnSfP
function name:  (null)
number of ops:  8
compiled vars:  !0 = $today
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'Ymd'
          2        DO_ICALL                                         $1      
          3        ASSIGN                                                   !0, $1
   15     4        INIT_FCALL                                               'age'
          5        SEND_VAL                                                 ''
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Function age:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 33
Branch analysis from position: 32
2 jumps found. (Code = 46) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 39
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
Branch analysis from position: 37
Branch analysis from position: 33
Branch analysis from position: 31
filename:       /in/vnSfP
function name:  age
number of ops:  41
compiled vars:  !0 = $birth_date, !1 = $birth_day, !2 = $birth_month, !3 = $birth_year, !4 = $year_diff, !5 = $month_diff, !6 = $day_diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '-'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        FETCH_LIST_R                                     $8      $7, 0
          6        ASSIGN                                                   !1, $8
          7        FETCH_LIST_R                                     $10     $7, 1
          8        ASSIGN                                                   !2, $10
          9        FETCH_LIST_R                                     $12     $7, 2
         10        ASSIGN                                                   !3, $12
         11        FREE                                                     $7
    7    12        INIT_FCALL                                               'date'
         13        SEND_VAL                                                 'Y'
         14        DO_ICALL                                         $14     
         15        SUB                                              ~15     $14, !3
         16        ASSIGN                                                   !4, ~15
    8    17        INIT_FCALL                                               'date'
         18        SEND_VAL                                                 'm'
         19        DO_ICALL                                         $17     
         20        SUB                                              ~18     $17, !2
         21        ASSIGN                                                   !5, ~18
    9    22        INIT_FCALL                                               'date'
         23        SEND_VAL                                                 'd'
         24        DO_ICALL                                         $20     
         25        SUB                                              ~21     $20, !1
         26        ASSIGN                                                   !6, ~21
   10    27        IS_SMALLER                                       ~23     !6, 0
         28      > JMPZ_EX                                          ~23     ~23, ->31
         29    >   IS_EQUAL                                         ~24     !5, 0
         30        BOOL                                             ~23     ~24
         31    > > JMPZ                                                     ~23, ->33
         32    >   PRE_DEC                                                  !4
   11    33    >   IS_SMALLER                                       ~26     !6, 0
         34      > JMPZ_EX                                          ~26     ~26, ->37
         35    >   IS_SMALLER                                       ~27     !5, 0
         36        BOOL                                             ~26     ~27
         37    > > JMPZ                                                     ~26, ->39
         38    >   PRE_DEC                                                  !4
   12    39    > > RETURN                                                   !4
   13    40*     > RETURN                                                   null

End of function age

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.53 ms | 1403 KiB | 18 Q