3v4l.org

run code in 300+ PHP versions simultaneously
<?php function berekenLeeftijd($datum) { $leeftijd= date_create($datum)->diff(date_create('today'))->y; return $leeftijd; } $geboortedatum = '18-05-1970'; $exp = explode('-',$geboortedatum); echo berekenLeeftijd($exp[2].'-'.$exp[1].'-'.$exp[0]); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k3pQT
function name:  (null)
number of ops:  18
compiled vars:  !0 = $geboortedatum, !1 = $exp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, '18-05-1970'
    8     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '-'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    9     6        INIT_FCALL                                               'berekenleeftijd'
          7        FETCH_DIM_R                                      ~5      !1, 2
          8        CONCAT                                           ~6      ~5, '-'
          9        FETCH_DIM_R                                      ~7      !1, 1
         10        CONCAT                                           ~8      ~6, ~7
         11        CONCAT                                           ~9      ~8, '-'
         12        FETCH_DIM_R                                      ~10     !1, 0
         13        CONCAT                                           ~11     ~9, ~10
         14        SEND_VAL                                                 ~11
         15        DO_FCALL                                      0  $12     
         16        ECHO                                                     $12
   10    17      > RETURN                                                   1

Function berekenleeftijd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k3pQT
function name:  berekenLeeftijd
number of ops:  14
compiled vars:  !0 = $datum, !1 = $leeftijd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'date_create'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        INIT_METHOD_CALL                                         $2, 'diff'
          5        INIT_FCALL                                               'date_create'
          6        SEND_VAL                                                 'today'
          7        DO_ICALL                                         $3      
          8        SEND_VAR_NO_REF_EX                                       $3
          9        DO_FCALL                                      0  $4      
         10        FETCH_OBJ_R                                      ~5      $4, 'y'
         11        ASSIGN                                                   !1, ~5
    4    12      > RETURN                                                   !1
    5    13*     > RETURN                                                   null

End of function berekenleeftijd

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.66 ms | 1399 KiB | 18 Q