3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_age() { $now = DateTime(); $diff = $now->diff(DateTime('1989-01-14')); return $diff->y; } echo get_age();?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UrB43
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'get_age'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function get_age:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UrB43
function name:  get_age
number of ops:  13
compiled vars:  !0 = $now, !1 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'DateTime'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
    3     3        INIT_METHOD_CALL                                         !0, 'diff'
          4        INIT_FCALL_BY_NAME                                       'DateTime'
          5        SEND_VAL_EX                                              '1989-01-14'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0  $5      
          9        ASSIGN                                                   !1, $5
    4    10        FETCH_OBJ_R                                      ~7      !1, 'y'
         11      > RETURN                                                   ~7
    5    12*     > RETURN                                                   null

End of function get_age

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.46 ms | 1389 KiB | 14 Q