3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.14 ms | 1396 KiB | 19 Q