3v4l.org

run code in 300+ PHP versions simultaneously
<?php function d($dt) { $birthdate = new \DateTime($dt); $today = new \DateTime(); $interval = $today->diff($birthdate); return $interval->format('%y'); } echo d('1986-10-11 12:00:00');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DLosM
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'd'
          1        SEND_VAL                                                 '1986-10-11+12%3A00%3A00'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function d:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DLosM
function name:  d
number of ops:  17
compiled vars:  !0 = $dt, !1 = $birthdate, !2 = $today, !3 = $interval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        NEW                                              $4      'DateTime'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
    4     5        NEW                                              $7      'DateTime'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $7
    5     8        INIT_METHOD_CALL                                         !2, 'diff'
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $10     
         11        ASSIGN                                                   !3, $10
    6    12        INIT_METHOD_CALL                                         !3, 'format'
         13        SEND_VAL_EX                                              '%25y'
         14        DO_FCALL                                      0  $12     
         15      > RETURN                                                   $12
    7    16*     > RETURN                                                   null

End of function d

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.65 ms | 1398 KiB | 14 Q