3v4l.org

run code in 300+ PHP versions simultaneously
<?php $months = array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $yes = 0; for ($i = 0; $i < 12; ++$i) { $result = date('m.d.y', strtotime($months[$i])); if ((substr($result, 2)-1) != [$i]) { $correct = "no"; } else { $correct = "yes"; $yes++; } echo (substr($result, 2)-1) . "\n"; //echo $correct . " - " . $result . "\n"; } echo "\n" . $yes . " / 12 correct months."; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 4
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 4
Branch analysis from position: 35
Branch analysis from position: 4
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 4
Branch analysis from position: 35
Branch analysis from position: 4
filename:       /in/ei1IL
function name:  (null)
number of ops:  39
compiled vars:  !0 = $months, !1 = $yes, !2 = $i, !3 = $result, !4 = $correct
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
    5     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->33
    6     4    >   INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'm.d.y'
          6        INIT_FCALL                                               'strtotime'
          7        FETCH_DIM_R                                      ~8      !0, !2
          8        SEND_VAL                                                 ~8
          9        DO_ICALL                                         $9      
         10        SEND_VAR                                                 $9
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !3, $10
    8    13        INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !3
         15        SEND_VAL                                                 2
         16        DO_ICALL                                         $12     
         17        SUB                                              ~13     $12, 1
         18        INIT_ARRAY                                       ~14     !2
         19        IS_NOT_EQUAL                                             ~13, ~14
         20      > JMPZ                                                     ~15, ->23
    9    21    >   ASSIGN                                                   !4, 'no'
         22      > JMP                                                      ->25
   11    23    >   ASSIGN                                                   !4, 'yes'
   12    24        PRE_INC                                                  !1
   14    25    >   INIT_FCALL                                               'substr'
         26        SEND_VAR                                                 !3
         27        SEND_VAL                                                 2
         28        DO_ICALL                                         $19     
         29        SUB                                              ~20     $19, 1
         30        CONCAT                                           ~21     ~20, '%0A'
         31        ECHO                                                     ~21
    5    32        PRE_INC                                                  !2
         33    >   IS_SMALLER                                               !2, 12
         34      > JMPNZ                                                    ~23, ->4
   18    35    >   CONCAT                                           ~24     '%0A', !1
         36        CONCAT                                           ~25     ~24, '+%2F+12+correct+months.'
         37        ECHO                                                     ~25
   19    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.05 ms | 1392 KiB | 19 Q