3v4l.org

run code in 300+ PHP versions simultaneously
<?php $menu = array( array(1,3,'Wurm 1.1', 2, 10), array(2,6,'Vogel 2.1', 2, 30), array(3,0,'Tiger 1', 1, 10), array(4,6,'Hund 2.2', 2, 40), array(5,3,'Katze 1.2', 2, 11), array(6,0,'Pferd 2', 1, 20), array(7,1,'Baer 1.1.1', 3, 0), array(8,3,'Schwein 1.3', 2, 12), array(9,4,'Esel 2.2.1', 3, 0), ); // Algorithmus hier $result = array(); usort($result[1], function($a, $b) { return $a[1] - $b[1]; }); print_r($result); $target = array( array(3,0,'Tiger 1', 1, 10), array(1,3,'Wurm 1.1', 2, 10), array(7,1,'Baer 1.1.1', 3, 0), array(5,3,'Katze 1.2', 2, 11), array(8,3,'Schwein 1.3', 2, 12), array(6,0,'Pferd 2', 1, 20), array(2,6,'Vogel 2.1', 2, 30), array(4,6,'Hund 2.2', 2, 40), array(9,4,'Esel 2.2.1', 3, 0), ); var_dump($result == $target);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ejtQm
function name:  (null)
number of ops:  17
compiled vars:  !0 = $menu, !1 = $result, !2 = $target
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   17     1        ASSIGN                                                   !1, <array>
   19     2        INIT_FCALL                                               'usort'
          3        FETCH_DIM_W                                      $5      !1, 1
          4        SEND_REF                                                 $5
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FejtQm%3A19%240'
   21     6        SEND_VAL                                                 ~6
          7        DO_ICALL                                                 
   23     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   27    11        ASSIGN                                                   !2, <array>
   39    12        INIT_FCALL                                               'var_dump'
         13        IS_EQUAL                                         ~10     !1, !2
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FejtQm%3A19%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.65 ms | 1387 KiB | 19 Q