3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $top30 = [9,8,7,6,4,3,2,1]; for($i = 0; $i < count($top30); $i++) { if($top30[$i] < 5) { array_splice($top30, $i, 0, 5); } } var_dump($top30); ?>
based on CcdYb
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 14
Branch analysis from position: 14
Jump found. Position 1 = 19, Position 2 = 3
Branch analysis from position: 19
Jump found. Position 1 = -2
Branch analysis from position: 3
Jump found. Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
Jump found. Position 1 = 19, Position 2 = 3
Branch analysis from position: 19
Branch analysis from position: 3
Branch analysis from position: 12
filename:       /in/FHFEs
function name:  (null)
number of ops:  23
compiled vars:  !0 = $top30, !1 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, <array>
   4     1        ASSIGN                                                   !1, 0
         2      > JMP                                                      ->14
   5     3    >   FETCH_DIM_R                                      $4      !0, !1
         4        IS_SMALLER                                       ~5      $4, 5
         5      > JMPZ                                                     ~5, ->12
   6     6    >   INIT_FCALL                                               'array_splice'
         7        SEND_REF                                                 !0
         8        SEND_VAR                                                 !1
         9        SEND_VAL                                                 0
        10        SEND_VAL                                                 5
        11        DO_ICALL                                                 
   4    12    >   POST_INC                                         ~7      !1
        13        FREE                                                     ~7
        14    >   INIT_FCALL                                               'count'
        15        SEND_VAR                                                 !0
        16        DO_ICALL                                         $8      
        17        IS_SMALLER                                       ~9      !1, $8
        18      > JMPNZ                                                    ~9, ->3
   9    19    >   INIT_FCALL                                               'var_dump'
        20        SEND_VAR                                                 !0
        21        DO_ICALL                                                 
        22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0