3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bithdayDate = "1993-08-20"; $tdate = strtotime(date("Y-m-d")); $age = 0; while( $tdate > $dob = strtotime('+1 year', $bithdayDate)) { ++$age; } echo $age; $bithdayDate = "1993-08-20"; $date = new DateTime($bithdayDate); $now = new DateTime(); $interval = $now->diff($date); echo $interval->y;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 10
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 10
Branch analysis from position: 18
Branch analysis from position: 10
filename:       /in/9aPFh
function name:  (null)
number of ops:  34
compiled vars:  !0 = $bithdayDate, !1 = $tdate, !2 = $age, !3 = $dob, !4 = $date, !5 = $now, !6 = $interval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1993-08-20'
    4     1        INIT_FCALL                                               'strtotime'
          2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'Y-m-d'
          4        DO_ICALL                                         $8      
          5        SEND_VAR                                                 $8
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !1, $9
    5     8        ASSIGN                                                   !2, 0
    6     9      > JMP                                                      ->11
    8    10    >   PRE_INC                                                  !2
    6    11    >   INIT_FCALL                                               'strtotime'
         12        SEND_VAL                                                 '%2B1+year'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $13     
         15        ASSIGN                                           ~14     !3, $13
         16        IS_SMALLER                                               ~14, !1
         17      > JMPNZ                                                    ~15, ->10
   10    18    >   ECHO                                                     !2
   12    19        ASSIGN                                                   !0, '1993-08-20'
   13    20        NEW                                              $17     'DateTime'
         21        SEND_VAR_EX                                              !0
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !4, $17
   14    24        NEW                                              $20     'DateTime'
         25        DO_FCALL                                      0          
         26        ASSIGN                                                   !5, $20
   15    27        INIT_METHOD_CALL                                         !5, 'diff'
         28        SEND_VAR_EX                                              !4
         29        DO_FCALL                                      0  $23     
         30        ASSIGN                                                   !6, $23
   16    31        FETCH_OBJ_R                                      ~25     !6, 'y'
         32        ECHO                                                     ~25
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.37 ms | 1396 KiB | 17 Q