3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1 = new DateTime(); $d2 = new DateTime(1956-02-24); $age = $d2->diff($d1); $age = $age->y; echo $age;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vnZSM
function name:  (null)
number of ops:  15
compiled vars:  !0 = $d1, !1 = $d2, !2 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'DateTime'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        NEW                                              $6      'DateTime'
          4        SEND_VAL_EX                                              1930
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $6
    5     7        INIT_METHOD_CALL                                         !1, 'diff'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
    6    11        FETCH_OBJ_R                                      ~11     !2, 'y'
         12        ASSIGN                                                   !2, ~11
    7    13        ECHO                                                     !2
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153 ms | 1393 KiB | 13 Q