3v4l.org

run code in 300+ PHP versions simultaneously
<?php function _makeLongArray($value) { $minLength = 1000 + 1; $resultArray = array(); if (!is_array($value)) { $resultArray = array_pad(array(), $minLength, $value); } else { $count = count($value); if ($count >= $minLength) { $resultArray = $value; } else { while(count($resultArray) < $minLength) { $resultArray = array_merge($resultArray, $value); } } } return $resultArray; } var_dump(_makeLongArray(5));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6uV9P
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               '_makelongarray'
          2        SEND_VAL                                                 5
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function _makelongarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 20
Branch analysis from position: 28
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 20
Branch analysis from position: 28
Branch analysis from position: 20
filename:       /in/6uV9P
function name:  _makeLongArray
number of ops:  30
compiled vars:  !0 = $value, !1 = $minLength, !2 = $resultArray, !3 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 1001
    6     2        ASSIGN                                                   !2, <array>
    8     3        TYPE_CHECK                                  128  ~6      !0
          4        BOOL_NOT                                         ~7      ~6
          5      > JMPZ                                                     ~7, ->13
    9     6    >   INIT_FCALL                                               'array_pad'
          7        SEND_VAL                                                 <array>
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $8      
         11        ASSIGN                                                   !2, $8
         12      > JMP                                                      ->28
   12    13    >   COUNT                                            ~10     !0
         14        ASSIGN                                                   !3, ~10
   13    15        IS_SMALLER_OR_EQUAL                                      !1, !3
         16      > JMPZ                                                     ~12, ->19
   14    17    >   ASSIGN                                                   !2, !0
         18      > JMP                                                      ->28
   17    19    > > JMP                                                      ->25
   18    20    >   INIT_FCALL                                               'array_merge'
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $14     
         24        ASSIGN                                                   !2, $14
   17    25    >   COUNT                                            ~16     !2
         26        IS_SMALLER                                               ~16, !1
         27      > JMPNZ                                                    ~17, ->20
   23    28    > > RETURN                                                   !2
   24    29*     > RETURN                                                   null

End of function _makelongarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.19 ms | 1403 KiB | 20 Q