3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = '1990-07-22 00:00:00'; $year_calc = 60 * 60 * 24 * 365; $year_strict = 31556926; var_dump([ 'year_calc' => $year_calc, 'year_strict' => $year_strict, 'now' => time(), 'age_calc' => floor(abs((time() - strtotime($dt))/$year_calc)), 'age_strict' => floor(abs((time() - strtotime($dt))/$year_strict)), ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ol4FP
function name:  (null)
number of ops:  40
compiled vars:  !0 = $dt, !1 = $year_calc, !2 = $year_strict
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
    5     2        ASSIGN                                                   !2, 31556926
    7     3        INIT_FCALL                                               'var_dump'
    8     4        INIT_ARRAY                                       ~6      !1, 'year_calc'
    9     5        ADD_ARRAY_ELEMENT                                ~6      !2, 'year_strict'
   10     6        INIT_FCALL                                               'time'
          7        DO_ICALL                                         $7      
          8        ADD_ARRAY_ELEMENT                                ~6      $7, 'now'
   11     9        INIT_FCALL                                               'floor'
         10        INIT_FCALL                                               'abs'
         11        INIT_FCALL                                               'time'
         12        DO_ICALL                                         $8      
         13        INIT_FCALL                                               'strtotime'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        SUB                                              ~10     $8, $9
         17        DIV                                              ~11     ~10, !1
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                         $12     
         20        SEND_VAR                                                 $12
         21        DO_ICALL                                         $13     
         22        ADD_ARRAY_ELEMENT                                ~6      $13, 'age_calc'
   12    23        INIT_FCALL                                               'floor'
         24        INIT_FCALL                                               'abs'
         25        INIT_FCALL                                               'time'
         26        DO_ICALL                                         $14     
         27        INIT_FCALL                                               'strtotime'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                         $15     
         30        SUB                                              ~16     $14, $15
         31        DIV                                              ~17     ~16, !2
         32        SEND_VAL                                                 ~17
         33        DO_ICALL                                         $18     
         34        SEND_VAR                                                 $18
         35        DO_ICALL                                         $19     
         36        ADD_ARRAY_ELEMENT                                ~6      $19, 'age_strict'
         37        SEND_VAL                                                 ~6
         38        DO_ICALL                                                 
   13    39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.62 ms | 1396 KiB | 23 Q