3v4l.org

run code in 300+ PHP versions simultaneously
<?php $stock = array("7", "5", "3"); $request = array("3", "6", "3"); var_dump(validate_order($stock, $request)); $stock = array("7", "5", "3"); $request = array("3", "4", "3"); var_dump(validate_order($stock, $request)); function validate_order($stock, $request) { for ($i = 0; $i < count($stock); $i++) if ($stock[$i] < $request[$i]) return false; return true; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TV24K
function name:  (null)
number of ops:  19
compiled vars:  !0 = $stock, !1 = $request
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL_BY_NAME                                       'validate_order'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
    7     9        ASSIGN                                                   !0, <array>
    8    10        ASSIGN                                                   !1, <array>
    9    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL_BY_NAME                                       'validate_order'
         13        SEND_VAR_EX                                              !0
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0  $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                                 
   16    18      > RETURN                                                   1

Function validate_order:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Branch analysis from position: 4
filename:       /in/TV24K
function name:  validate_order
number of ops:  15
compiled vars:  !0 = $stock, !1 = $request, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->10
   13     4    >   FETCH_DIM_R                                      ~4      !0, !2
          5        FETCH_DIM_R                                      ~5      !1, !2
          6        IS_SMALLER                                               ~4, ~5
          7      > JMPZ                                                     ~6, ->9
   14     8    > > RETURN                                                   <false>
   12     9    >   PRE_INC                                                  !2
         10    >   COUNT                                            ~8      !0
         11        IS_SMALLER                                               !2, ~8
         12      > JMPNZ                                                    ~9, ->4
   15    13    > > RETURN                                                   <true>
   16    14*     > RETURN                                                   null

End of function validate_order

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.81 ms | 1400 KiB | 15 Q