3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array( 'nome' => 'Alexandre', 'idade' => '65' ), array( 'nome' => 'Alex', 'idade' => '33' ), array( 'nome' => 'Zezinha', 'idade' => '29' ), array( 'nome' => 'Rosana', 'idade' => '64' ) ); function Ordena_Array ($array, $campo) { // Ordena usort($array, function ($a, $b) use ($campo) { return $a[$campo] > $b[$campo]; }); return $array; } // Mostra os valores print_r( Ordena_Array ($array, "nome") );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RisgR
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'ordena_array'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'nome'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function ordena_array:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RisgR
function name:  Ordena_Array
number of ops:  10
compiled vars:  !0 = $array, !1 = $campo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        INIT_FCALL                                               'usort'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FRisgR%3A12%240'
          5        BIND_LEXICAL                                             ~2, !1
   14     6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   16     8      > RETURN                                                   !0
   17     9*     > RETURN                                                   null

End of function ordena_array

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

End of function %00%7Bclosure%7D%2Fin%2FRisgR%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.4 ms | 1399 KiB | 18 Q