3v4l.org

run code in 300+ PHP versions simultaneously
<?php //create both dates (birthday and today). $birthday = date_create($this->birthday); $today = date_create(date('Y-m-d')); //check if the dates are valid. if (($birthday !== false && $today !== false) && ($birthday < $today)) { return date_diff($birthday, $today)->y; } else { return -1; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 17
filename:       /in/DZVUg
function name:  (null)
number of ops:  30
compiled vars:  !0 = $birthday, !1 = $today
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_create'
          1        FETCH_THIS                                       $2      
          2        FETCH_OBJ_R                                      ~3      $2, 'birthday'
          3        SEND_VAL                                                 ~3
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !0, $4
    4     6        INIT_FCALL                                               'date_create'
          7        INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'Y-m-d'
          9        DO_ICALL                                         $6      
         10        SEND_VAR                                                 $6
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !1, $7
    7    13        TYPE_CHECK                                  1018  ~9      !0
         14      > JMPZ_EX                                          ~9      ~9, ->17
         15    >   TYPE_CHECK                                  1018  ~10     !1
         16        BOOL                                             ~9      ~10
         17    > > JMPZ_EX                                          ~9      ~9, ->20
         18    >   IS_SMALLER                                       ~11     !0, !1
         19        BOOL                                             ~9      ~11
         20    > > JMPZ                                                     ~9, ->28
    8    21    >   INIT_FCALL                                               'date_diff'
         22        SEND_VAR                                                 !0
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $12     
         25        FETCH_OBJ_R                                      ~13     $12, 'y'
         26      > RETURN                                                   ~13
         27*       JMP                                                      ->29
   10    28    > > RETURN                                                   -1
   11    29*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.62 ms | 1396 KiB | 19 Q