3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hmv = array( 'HMV' => array( array( 'name' => 'Beavis & Butthead Do America', 'price' => 14.99), array( 'name' => 'Simpsons Movie', 'price' => 10.99), ), array( 'name' => 'South Park: Bigger Longer & Uncut', 'price' => 12.99), ); $virgin = array( 'Virgin Megastores' => array( array( 'name' => 'Beavis & Butthead Do America', 'price' => 14.99), array( 'name' => 'Simpsons Movie', 'price' => 9.99), array( 'name' => 'South Park: Bigger Longer & Uncut', 'price' => 12.99), ) ); $tower = array( 'Tower Records' => array( array( 'name' => 'Beavis & Butthead Do America', 'price' => 14.99), array( 'name' => 'Simpsons Movie', 'price' => 8.99), array( 'name' => 'South Park: Bigger Longer & Uncut', 'price' => 12.99), ) ); $stores = array($hmv, $virgin, $tower); # Sort all items individually foreach($stores as &$store){ uasort($store, function($a, $b){ if($a['price'] == $b['price']) return 0; return ($a['price'] < $b['price']) ? -1 : 1; }); } //unset($store); var_dump($stores);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/amgPG
function name:  (null)
number of ops:  20
compiled vars:  !0 = $hmv, !1 = $virgin, !2 = $tower, !3 = $stores, !4 = $store
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, <array>
   25     2        ASSIGN                                                   !2, <array>
   38     3        INIT_ARRAY                                       ~8      !0
          4        ADD_ARRAY_ELEMENT                                ~8      !1
          5        ADD_ARRAY_ELEMENT                                ~8      !2
          6        ASSIGN                                                   !3, ~8
   42     7      > FE_RESET_RW                                      $10     !3, ->15
          8    > > FE_FETCH_RW                                              $10, !4, ->15
   43     9    >   INIT_FCALL                                               'uasort'
         10        SEND_REF                                                 !4
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FamgPG%3A43%240'
   47    12        SEND_VAL                                                 ~11
         13        DO_ICALL                                                 
   42    14      > JMP                                                      ->8
         15    >   FE_FREE                                                  $10
   51    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FamgPG%3A43%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/amgPG
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   43     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   44     2        FETCH_DIM_R                                      ~2      !0, 'price'
          3        FETCH_DIM_R                                      ~3      !1, 'price'
          4        IS_EQUAL                                                 ~2, ~3
          5      > JMPZ                                                     ~4, ->7
          6    > > RETURN                                                   0
   45     7    >   FETCH_DIM_R                                      ~5      !0, 'price'
          8        FETCH_DIM_R                                      ~6      !1, 'price'
          9        IS_SMALLER                                               ~5, ~6
         10      > JMPZ                                                     ~7, ->13
         11    >   QM_ASSIGN                                        ~8      -1
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~8      1
         14    > > RETURN                                                   ~8
   47    15*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FamgPG%3A43%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.89 ms | 1400 KiB | 17 Q