3v4l.org

run code in 300+ PHP versions simultaneously
<?php $today_y = date("Y"); $today_m = date("m"); $today_d = date("d"); list($birthday_y, $birthday_m, $birthday_d) = explode('/', str_replace('-','/',$birthday)); $age = $today_y - $birthday_y; //誕生日前なら1才引く if( $today_m*100 + $today_d < $birthday_m*100 + $birthday_d ){ $age--; } echo $age;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 37
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/6qBko
function name:  (null)
number of ops:  39
compiled vars:  !0 = $today_y, !1 = $today_m, !2 = $today_d, !3 = $birthday, !4 = $birthday_y, !5 = $birthday_m, !6 = $birthday_d, !7 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'Y'
          2        DO_ICALL                                         $8      
          3        ASSIGN                                                   !0, $8
    3     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'm'
          6        DO_ICALL                                         $10     
          7        ASSIGN                                                   !1, $10
    4     8        INIT_FCALL                                               'date'
          9        SEND_VAL                                                 'd'
         10        DO_ICALL                                         $12     
         11        ASSIGN                                                   !2, $12
    6    12        INIT_FCALL                                               'explode'
         13        SEND_VAL                                                 '%2F'
         14        INIT_FCALL                                               'str_replace'
         15        SEND_VAL                                                 '-'
         16        SEND_VAL                                                 '%2F'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $14     
         19        SEND_VAR                                                 $14
         20        DO_ICALL                                         $15     
         21        FETCH_LIST_R                                     $16     $15, 0
         22        ASSIGN                                                   !4, $16
         23        FETCH_LIST_R                                     $18     $15, 1
         24        ASSIGN                                                   !5, $18
         25        FETCH_LIST_R                                     $20     $15, 2
         26        ASSIGN                                                   !6, $20
         27        FREE                                                     $15
    8    28        SUB                                              ~22     !0, !4
         29        ASSIGN                                                   !7, ~22
   11    30        MUL                                              ~24     !1, 100
         31        ADD                                              ~25     ~24, !2
         32        MUL                                              ~26     !5, 100
         33        ADD                                              ~27     ~26, !6
         34        IS_SMALLER                                               ~25, ~27
         35      > JMPZ                                                     ~28, ->37
         36    >   PRE_DEC                                                  !7
   12    37    >   ECHO                                                     !7
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.18 ms | 1396 KiB | 19 Q