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))/$dateTime::YEAR)), ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DOUZR
function name:  (null)
number of ops:  26
compiled vars:  !0 = $dt, !1 = $year, !2 = $dateTime
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                                       ~5      !1, 'year'
    8     4        INIT_FCALL                                               'time'
          5        DO_ICALL                                         $6      
          6        ADD_ARRAY_ELEMENT                                ~5      $6, 'now'
    9     7        INIT_FCALL                                               'floor'
          8        INIT_FCALL                                               'abs'
          9        INIT_FCALL                                               'time'
         10        DO_ICALL                                         $7      
         11        INIT_FCALL                                               'strtotime'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $8      
         14        SUB                                              ~9      $7, $8
         15        FETCH_CLASS                                   0  $10     !2
         16        FETCH_CLASS_CONSTANT                             ~11     $10, 'YEAR'
         17        DIV                                              ~12     ~9, ~11
         18        SEND_VAL                                                 ~12
         19        DO_ICALL                                         $13     
         20        SEND_VAR                                                 $13
         21        DO_ICALL                                         $14     
         22        ADD_ARRAY_ELEMENT                                ~5      $14, 'age'
         23        SEND_VAL                                                 ~5
         24        DO_ICALL                                                 
   10    25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.17 ms | 1395 KiB | 23 Q