3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(); $arr[] = array("id" => 3, "name" => "joe"); $arr[] = array("id" => 34, "name" => "joe"); $arr[] = array("id" => 1, "name" => "joe"); $arr[] = array("id" => 15, "name" => "joe"); $arr[] = array("id" => 75, "name" => "joe"); $arr[] = array("id" => 2, "name" => "joe"); $arr[] = array("id" => 10, "name" => "joe"); $arr[] = array("id" => 19, "name" => "joe"); var_dump($arr); function cmp($a, $b) { //echo $a["id"] - $b["id"] ."\n\r"; return $a["id"] - $b["id"]; } usort($arr, "cmp"); var_dump($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Niu4m
function name:  (null)
number of ops:  28
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN_DIM                                               !0
          2        OP_DATA                                                  <array>
    6     3        ASSIGN_DIM                                               !0
          4        OP_DATA                                                  <array>
    7     5        ASSIGN_DIM                                               !0
          6        OP_DATA                                                  <array>
    8     7        ASSIGN_DIM                                               !0
          8        OP_DATA                                                  <array>
    9     9        ASSIGN_DIM                                               !0
         10        OP_DATA                                                  <array>
   10    11        ASSIGN_DIM                                               !0
         12        OP_DATA                                                  <array>
   11    13        ASSIGN_DIM                                               !0
         14        OP_DATA                                                  <array>
   12    15        ASSIGN_DIM                                               !0
         16        OP_DATA                                                  <array>
   14    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
   20    20        INIT_FCALL                                               'usort'
         21        SEND_REF                                                 !0
         22        SEND_VAL                                                 'cmp'
         23        DO_ICALL                                                 
   22    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Function cmp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Niu4m
function name:  cmp
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        FETCH_DIM_R                                      ~2      !0, 'id'
          3        FETCH_DIM_R                                      ~3      !1, 'id'
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
   19     6*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.83 ms | 1396 KiB | 17 Q