3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = [1, 2, 3, 4, 5]; $vendors = ["Amazon", "Newegg", "##php"]; // Super complex price calculator function getPrice($vendor, $product) { return rand(0, 100); } $productsCalculated = []; foreach ($products as $productID) { $prices = []; foreach ($vendors as $vendor) { $prices[$vendor] = getPrice($vendor, $productID); } $productsCalculated[$productID] = $prices; } var_dump($productsCalculated);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 19
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 19
Branch analysis from position: 5
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 15
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/BnPJg
function name:  (null)
number of ops:  24
compiled vars:  !0 = $products, !1 = $vendors, !2 = $productsCalculated, !3 = $productID, !4 = $prices, !5 = $vendor
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
   11     2        ASSIGN                                                   !2, <array>
   13     3      > FE_RESET_R                                       $9      !0, ->19
          4    > > FE_FETCH_R                                               $9, !3, ->19
   14     5    >   ASSIGN                                                   !4, <array>
   16     6      > FE_RESET_R                                       $11     !1, ->15
          7    > > FE_FETCH_R                                               $11, !5, ->15
   17     8    >   INIT_FCALL                                               'getprice'
          9        SEND_VAR                                                 !5
         10        SEND_VAR                                                 !3
         11        DO_FCALL                                      0  $13     
         12        ASSIGN_DIM                                               !4, !5
         13        OP_DATA                                                  $13
   16    14      > JMP                                                      ->7
         15    >   FE_FREE                                                  $11
   20    16        ASSIGN_DIM                                               !2, !3
         17        OP_DATA                                                  !4
   13    18      > JMP                                                      ->4
         19    >   FE_FREE                                                  $9
   23    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Function getprice:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BnPJg
function name:  getPrice
number of ops:  8
compiled vars:  !0 = $vendor, !1 = $product
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        INIT_FCALL                                               'rand'
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 100
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
    9     7*     > RETURN                                                   null

End of function getprice

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.76 ms | 1403 KiB | 18 Q