3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compareArrays($version, $folder) { if (count($version) !== count($folder)) { throw new InvalidArgumentException('The length of the provided array must be equal.'); } for ($i = 0; $i < count($version); $i++) { if ( $folder [$i] < $version[$i]) { return false; } else { continue; } } return true; } compareArrays([0,0,1], [1,1,1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gk0lS
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'comparearrays'
          1        SEND_VAL                                                 <array>
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function comparearrays:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 12
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 12
Branch analysis from position: 23
Branch analysis from position: 12
filename:       /in/Gk0lS
function name:  compareArrays
number of ops:  25
compiled vars:  !0 = $version, !1 = $folder, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        COUNT                                            ~3      !0
          3        COUNT                                            ~4      !1
          4        IS_NOT_IDENTICAL                                         ~3, ~4
          5      > JMPZ                                                     ~5, ->10
    5     6    >   NEW                                              $6      'InvalidArgumentException'
          7        SEND_VAL_EX                                              'The+length+of+the+provided+array+must+be+equal.'
          8        DO_FCALL                                      0          
          9      > THROW                                         0          $6
    8    10    >   ASSIGN                                                   !2, 0
         11      > JMP                                                      ->20
   10    12    >   FETCH_DIM_R                                      ~9      !1, !2
         13        FETCH_DIM_R                                      ~10     !0, !2
         14        IS_SMALLER                                               ~9, ~10
         15      > JMPZ                                                     ~11, ->18
   11    16    > > RETURN                                                   <false>
         17*       JMP                                                      ->19
   13    18    > > JMP                                                      ->19
    8    19    >   PRE_INC                                                  !2
         20    >   COUNT                                            ~13     !0
         21        IS_SMALLER                                               !2, ~13
         22      > JMPNZ                                                    ~14, ->12
   16    23    > > RETURN                                                   <true>
   17    24*     > RETURN                                                   null

End of function comparearrays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.17 ms | 1403 KiB | 14 Q