3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateSplitter = explode('-','1987-02-15'); $today = getDate(); $monDiff = $today['mon'] - $dateSplitter[1]; $dayDiff = $today['mday'] - $dateSplitter[2]; $yearDiff = $today['year'] - $dateSplitter[0]; $age = ($monDiff > 0 || ($monDiff == 0 && $dayDiff >= 0)) ? ($yearDiff) : ($yearDiff - 1); echo $age;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 46) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 27
filename:       /in/uqZCV
function name:  (null)
number of ops:  35
compiled vars:  !0 = $dateSplitter, !1 = $today, !2 = $monDiff, !3 = $dayDiff, !4 = $yearDiff, !5 = $age
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '-'
          2        SEND_VAL                                                 '1987-02-15'
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !0, $6
    4     5        INIT_FCALL                                               'getdate'
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !1, $8
    5     8        FETCH_DIM_R                                      ~10     !1, 'mon'
          9        FETCH_DIM_R                                      ~11     !0, 1
         10        SUB                                              ~12     ~10, ~11
         11        ASSIGN                                                   !2, ~12
    6    12        FETCH_DIM_R                                      ~14     !1, 'mday'
         13        FETCH_DIM_R                                      ~15     !0, 2
         14        SUB                                              ~16     ~14, ~15
         15        ASSIGN                                                   !3, ~16
    7    16        FETCH_DIM_R                                      ~18     !1, 'year'
         17        FETCH_DIM_R                                      ~19     !0, 0
         18        SUB                                              ~20     ~18, ~19
         19        ASSIGN                                                   !4, ~20
    8    20        IS_SMALLER                                       ~22     0, !2
         21      > JMPNZ_EX                                         ~22     ~22, ->27
         22    >   IS_EQUAL                                         ~23     !2, 0
         23      > JMPZ_EX                                          ~23     ~23, ->26
         24    >   IS_SMALLER_OR_EQUAL                              ~24     0, !3
         25        BOOL                                             ~23     ~24
         26    >   BOOL                                             ~22     ~23
         27    > > JMPZ                                                     ~22, ->30
         28    >   QM_ASSIGN                                        ~25     !4
         29      > JMP                                                      ->32
         30    >   SUB                                              ~26     !4, 1
         31        QM_ASSIGN                                        ~25     ~26
         32    >   ASSIGN                                                   !5, ~25
    9    33        ECHO                                                     !5
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.59 ms | 1396 KiB | 17 Q