3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $yyyy = '1995'; $mm = '03'; $dd = '13'; $ageY = date("Y")-intval($yyyy); $ageM = date("n")-intval($mm); $ageD = date("j")-intval($dd); if($ageD < 0){ $ageD = $ageD += date("t"); $ageM--; } if($ageM < 0){ $ageM+=12; $ageY--; } $age = $ageY."/".$ageM."/".$ageD; echo $age;
based on jjTiD
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 29, Position 2 = 36
Branch analysis from position: 29
Jump found. Position 1 = 38, Position 2 = 41
Branch analysis from position: 38
Jump found. Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 36
filename:       /in/HYGO9
function name:  (null)
number of ops:  48
compiled vars:  !0 = $yyyy, !1 = $mm, !2 = $dd, !3 = $ageY, !4 = $ageM, !5 = $ageD, !6 = $age
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   ASSIGN                                                   !0, '1995'
   3     1        ASSIGN                                                   !1, '03'
   4     2        ASSIGN                                                   !2, '13'
   5     3        INIT_FCALL                                               'date'
         4        SEND_VAL                                                 'Y'
         5        DO_ICALL                                         $10     
         6        INIT_FCALL                                               'intval'
         7        SEND_VAR                                                 !0
         8        DO_ICALL                                         $11     
         9        SUB                                              ~12     $10, $11
        10        ASSIGN                                                   !3, ~12
   6    11        INIT_FCALL                                               'date'
        12        SEND_VAL                                                 'n'
        13        DO_ICALL                                         $14     
        14        INIT_FCALL                                               'intval'
        15        SEND_VAR                                                 !1
        16        DO_ICALL                                         $15     
        17        SUB                                              ~16     $14, $15
        18        ASSIGN                                                   !4, ~16
   7    19        INIT_FCALL                                               'date'
        20        SEND_VAL                                                 'j'
        21        DO_ICALL                                         $18     
        22        INIT_FCALL                                               'intval'
        23        SEND_VAR                                                 !2
        24        DO_ICALL                                         $19     
        25        SUB                                              ~20     $18, $19
        26        ASSIGN                                                   !5, ~20
   8    27        IS_SMALLER                                       ~22     !5, 0
        28      > JMPZ                                                     ~22, ->36
   9    29    >   INIT_FCALL                                               'date'
        30        SEND_VAL                                                 't'
        31        DO_ICALL                                         $23     
        32        ASSIGN_ADD                                    0  $24     !5, $23
        33        ASSIGN                                                   !5, $24
  10    34        POST_DEC                                         ~26     !4
        35        FREE                                                     ~26
  12    36    >   IS_SMALLER                                       ~27     !4, 0
        37      > JMPZ                                                     ~27, ->41
  13    38    >   ASSIGN_ADD                                    0          !4, 12
  14    39        POST_DEC                                         ~29     !3
        40        FREE                                                     ~29
  16    41    >   CONCAT                                           ~30     !3, '%2F'
        42        CONCAT                                           ~31     ~30, !4
        43        CONCAT                                           ~32     ~31, '%2F'
        44        CONCAT                                           ~33     ~32, !5
        45        ASSIGN                                                   !6, ~33
  17    46        ECHO                                                     !6
        47      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0