3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = '1990-07-22 00:00:00'; $year = 60 * 60 * 24 * 365; var_dump([ 'year' => $year, 'now' => time(), 'age' => floor(abs((time() - strtotime($dt))/$year)), ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Wa7BW
function name:  (null)
number of ops:  24
compiled vars:  !0 = $dt, !1 = $year
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1990-07-22+00%3A00%3A00'
    4     1        ASSIGN                                                   !1, 31536000
    6     2        INIT_FCALL                                               'var_dump'
    7     3        INIT_ARRAY                                       ~4      !1, 'year'
    8     4        INIT_FCALL                                               'time'
          5        DO_ICALL                                         $5      
          6        ADD_ARRAY_ELEMENT                                ~4      $5, 'now'
    9     7        INIT_FCALL                                               'floor'
          8        INIT_FCALL                                               'abs'
          9        INIT_FCALL                                               'time'
         10        DO_ICALL                                         $6      
         11        INIT_FCALL                                               'strtotime'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $7      
         14        SUB                                              ~8      $6, $7
         15        DIV                                              ~9      ~8, !1
         16        SEND_VAL                                                 ~9
         17        DO_ICALL                                         $10     
         18        SEND_VAR                                                 $10
         19        DO_ICALL                                         $11     
         20        ADD_ARRAY_ELEMENT                                ~4      $11, 'age'
         21        SEND_VAL                                                 ~4
         22        DO_ICALL                                                 
   10    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.33 ms | 1395 KiB | 23 Q