3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_age() { $now = new DateTime(); $diff = $now->diff(new 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/s7iQZ
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/s7iQZ
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 >   NEW                                              $2      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    3     3        INIT_METHOD_CALL                                         !0, 'diff'
          4        NEW                                              $5      'DateTime'
          5        SEND_VAL_EX                                              '1989-01-14'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $5
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
    4    10        FETCH_OBJ_R                                      ~9      !1, 'y'
         11      > RETURN                                                   ~9
    5    12*     > RETURN                                                   null

End of function get_age

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.75 ms | 1389 KiB | 14 Q