3v4l.org

run code in 300+ PHP versions simultaneously
<?php // sample data $_SESSION["products"] = array(); $_SESSION["products"][] = array('vendorid'=>2, 'product_name'=>'TEST31' ); $_SESSION["products"][] = array('vendorid'=>4, 'product_name'=>'TEST21' ); $_SESSION["products"][] = array('vendorid'=>3, 'product_name'=>'TEST20' ); $_SESSION["products"][] = array('vendorid'=>3, 'product_name'=>'TEST17' ); $_SESSION["products"][] = array('vendorid'=>4, 'product_name'=>'TEST11' ); // actual code usort($_SESSION["products"], function($a, $b) { return $a['vendorid'] - $b['vendorid']; }); foreach( $_SESSION["products"] as $product ) { echo '<li>', htmlspecialchars($product['vendorid']), ' ', htmlspecialchars($product['product_name']), "</li>\r\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 48
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 48
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 48
filename:       /in/3Y6mg
function name:  (null)
number of ops:  50
compiled vars:  !0 = $product
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_W                      global              $1      '_SESSION'
          1        ASSIGN_DIM                                               $1, 'products'
          2        OP_DATA                                                  <array>
    4     3        FETCH_W                      global              $3      '_SESSION'
          4        FETCH_DIM_W                                      $4      $3, 'products'
          5        ASSIGN_DIM                                               $4
          6        OP_DATA                                                  <array>
    5     7        FETCH_W                      global              $6      '_SESSION'
          8        FETCH_DIM_W                                      $7      $6, 'products'
          9        ASSIGN_DIM                                               $7
         10        OP_DATA                                                  <array>
    6    11        FETCH_W                      global              $9      '_SESSION'
         12        FETCH_DIM_W                                      $10     $9, 'products'
         13        ASSIGN_DIM                                               $10
         14        OP_DATA                                                  <array>
    7    15        FETCH_W                      global              $12     '_SESSION'
         16        FETCH_DIM_W                                      $13     $12, 'products'
         17        ASSIGN_DIM                                               $13
         18        OP_DATA                                                  <array>
    8    19        FETCH_W                      global              $15     '_SESSION'
         20        FETCH_DIM_W                                      $16     $15, 'products'
         21        ASSIGN_DIM                                               $16
         22        OP_DATA                                                  <array>
   11    23        INIT_FCALL                                               'usort'
         24        FETCH_W                      global              $18     '_SESSION'
         25        FETCH_DIM_W                                      $19     $18, 'products'
         26        SEND_REF                                                 $19
         27        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3Y6mg%3A11%240'
   13    28        SEND_VAL                                                 ~20
         29        DO_ICALL                                                 
   15    30        FETCH_R                      global              ~22     '_SESSION'
         31        FETCH_DIM_R                                      ~23     ~22, 'products'
         32      > FE_RESET_R                                       $24     ~23, ->48
         33    > > FE_FETCH_R                                               $24, !0, ->48
   16    34    >   ECHO                                                     '%3Cli%3E'
   17    35        INIT_FCALL                                               'htmlspecialchars'
         36        FETCH_DIM_R                                      ~25     !0, 'vendorid'
         37        SEND_VAL                                                 ~25
         38        DO_ICALL                                         $26     
         39        ECHO                                                     $26
         40        ECHO                                                     '+'
         41        INIT_FCALL                                               'htmlspecialchars'
         42        FETCH_DIM_R                                      ~27     !0, 'product_name'
         43        SEND_VAL                                                 ~27
         44        DO_ICALL                                         $28     
         45        ECHO                                                     $28
   18    46        ECHO                                                     '%3C%2Fli%3E%0D%0A'
   15    47      > JMP                                                      ->33
         48    >   FE_FREE                                                  $24
   19    49      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3Y6mg%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Y6mg
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        FETCH_DIM_R                                      ~2      !0, 'vendorid'
          3        FETCH_DIM_R                                      ~3      !1, 'vendorid'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
   13     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3Y6mg%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.61 ms | 1400 KiB | 17 Q