3v4l.org

run code in 300+ PHP versions simultaneously
j<?php function get_age($birth_date){ return floor((time() - strtotime($birth_date))/31556926); } echo " I am ".get_age("1991-05-23") ." years old";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeGQf
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     'j'
    7     1        INIT_FCALL                                               'get_age'
          2        SEND_VAL                                                 '1991-05-23'
          3        DO_FCALL                                      0  $0      
          4        CONCAT                                           ~1      '+I+am+', $0
          5        CONCAT                                           ~2      ~1, '+years+old'
          6        ECHO                                                     ~2
          7      > RETURN                                                   1

Function get_age:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QeGQf
function name:  get_age
number of ops:  13
compiled vars:  !0 = $birth_date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'floor'
          2        INIT_FCALL                                               'time'
          3        DO_ICALL                                         $1      
          4        INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SUB                                              ~3      $1, $2
          8        DIV                                              ~4      ~3, 31556926
          9        SEND_VAL                                                 ~4
         10        DO_ICALL                                         $5      
         11      > RETURN                                                   $5
    5    12*     > RETURN                                                   null

End of function get_age

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.35 ms | 1397 KiB | 20 Q