3v4l.org

run code in 300+ PHP versions simultaneously
<?php $year = 1999; $month = 2; $day = 6; $birthday = $month.$day.$year; // validate birthday function validateAge($birthday, $age = 25) { // $birthday can be UNIX_TIMESTAMP or just a string-date. if(is_string($birthday)) { $birthday = strtotime($birthday); echo "OLDER THAN 25!!!"; } // check // 31536000 is the number of seconds in a 365 days year. if(time() - $birthday < $age * 31536000) { echo "NOT OLDER THAN 25!!!"; return false; } return true; } validateAge($birthday,25);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UkO0F
function name:  (null)
number of ops:  11
compiled vars:  !0 = $year, !1 = $month, !2 = $day, !3 = $birthday
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1999
    4     1        ASSIGN                                                   !1, 2
    5     2        ASSIGN                                                   !2, 6
    7     3        CONCAT                                           ~7      !1, !2
          4        CONCAT                                           ~8      ~7, !0
          5        ASSIGN                                                   !3, ~8
   28     6        INIT_FCALL                                               'validateage'
          7        SEND_VAR                                                 !3
          8        SEND_VAL                                                 25
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function validateage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/UkO0F
function name:  validateAge
number of ops:  19
compiled vars:  !0 = $birthday, !1 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      25
   13     2        TYPE_CHECK                                   64          !0
          3      > JMPZ                                                     ~2, ->9
   14     4    >   INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
   15     8        ECHO                                                     'OLDER+THAN+25%21%21%21'
   20     9    >   INIT_FCALL                                               'time'
         10        DO_ICALL                                         $5      
         11        SUB                                              ~6      $5, !0
         12        MUL                                              ~7      !1, 31536000
         13        IS_SMALLER                                               ~6, ~7
         14      > JMPZ                                                     ~8, ->17
   21    15    >   ECHO                                                     'NOT+OLDER+THAN+25%21%21%21'
   22    16      > RETURN                                                   <false>
   25    17    > > RETURN                                                   <true>
   26    18*     > RETURN                                                   null

End of function validateage

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.03 ms | 1390 KiB | 18 Q