3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startDate = '2014-08-04'; $currentDate = 'now'; $formattedNow = ($currentDate == "now") ? strftime("%Y%m%d", strtotime(date('Y-m-d'))) : strftime("%Y%m%d", strtotime($currentDate)); $formattedBDay = strftime("%Y%m%d", strtotime($startDate)); $diffDates = $formattedNow - $formattedBDay; $diffDateLength = strlen($diffDates); $lastFour = substr($diffDates, -4); $realAge = str_replace($lastFour, "", $diffDates); // if ($realAge == "" || $lastFour == false) { echo "0"; }else { echo $realAge; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 47) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
Branch analysis from position: 16
2 jumps found. (Code = 47) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
Branch analysis from position: 52
filename:       /in/Q5TsS
function name:  (null)
number of ops:  57
compiled vars:  !0 = $startDate, !1 = $currentDate, !2 = $formattedNow, !3 = $formattedBDay, !4 = $diffDates, !5 = $diffDateLength, !6 = $lastFour, !7 = $realAge
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2014-08-04'
    3     1        ASSIGN                                                   !1, 'now'
    4     2        IS_EQUAL                                                 !1, 'now'
          3      > JMPZ                                                     ~10, ->16
          4    >   INIT_FCALL                                               'strftime'
          5        SEND_VAL                                                 '%25Y%25m%25d'
          6        INIT_FCALL                                               'strtotime'
          7        INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'Y-m-d'
          9        DO_ICALL                                         $11     
         10        SEND_VAR                                                 $11
         11        DO_ICALL                                         $12     
         12        SEND_VAR                                                 $12
         13        DO_ICALL                                         $13     
         14        QM_ASSIGN                                        ~14     $13
         15      > JMP                                                      ->24
         16    >   INIT_FCALL                                               'strftime'
         17        SEND_VAL                                                 '%25Y%25m%25d'
         18        INIT_FCALL                                               'strtotime'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $15     
         21        SEND_VAR                                                 $15
         22        DO_ICALL                                         $16     
         23        QM_ASSIGN                                        ~14     $16
         24    >   ASSIGN                                                   !2, ~14
    5    25        INIT_FCALL                                               'strftime'
         26        SEND_VAL                                                 '%25Y%25m%25d'
         27        INIT_FCALL                                               'strtotime'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                         $18     
         30        SEND_VAR                                                 $18
         31        DO_ICALL                                         $19     
         32        ASSIGN                                                   !3, $19
    6    33        SUB                                              ~21     !2, !3
         34        ASSIGN                                                   !4, ~21
    7    35        STRLEN                                           ~23     !4
         36        ASSIGN                                                   !5, ~23
    8    37        INIT_FCALL                                               'substr'
         38        SEND_VAR                                                 !4
         39        SEND_VAL                                                 -4
         40        DO_ICALL                                         $25     
         41        ASSIGN                                                   !6, $25
    9    42        INIT_FCALL                                               'str_replace'
         43        SEND_VAR                                                 !6
         44        SEND_VAL                                                 ''
         45        SEND_VAR                                                 !4
         46        DO_ICALL                                         $27     
         47        ASSIGN                                                   !7, $27
   11    48        IS_EQUAL                                         ~29     !7, ''
         49      > JMPNZ_EX                                         ~29     ~29, ->52
         50    >   BOOL_NOT                                         ~30     !6
         51        BOOL                                             ~29     ~30
         52    > > JMPZ                                                     ~29, ->55
   12    53    >   ECHO                                                     '0'
         54      > JMP                                                      ->56
   14    55    >   ECHO                                                     !7
   15    56    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.53 ms | 1392 KiB | 23 Q