3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ (object) ['ID' => 1, 'name' => 'Mary Jane', 'count' => '420'], (object) ['ID' => 2, 'name' => 'Johnny', 'count' => '23420'], (object) ['ID' => 3, 'name' => 'Kathy', 'count' => '4354'], ]; $property = 'count'; usort($array, fn($a,$b) => $a->$property <=> $b->$property); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t7PPK
function name:  (null)
number of ops:  18
compiled vars:  !0 = $array, !1 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   CAST                                          8  ~2      <array>
          1        INIT_ARRAY                                       ~3      ~2
    5     2        CAST                                          8  ~4      <array>
          3        ADD_ARRAY_ELEMENT                                ~3      ~4
    6     4        CAST                                          8  ~5      <array>
          5        ADD_ARRAY_ELEMENT                                ~3      ~5
    3     6        ASSIGN                                                   !0, ~3
    9     7        ASSIGN                                                   !1, 'count'
   10     8        INIT_FCALL                                               'usort'
          9        SEND_REF                                                 !0
         10        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
         11        BIND_LEXICAL                                             ~8, !1
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                                 
   11    14        INIT_FCALL                                               'var_export'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
         17      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/t7PPK
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $a, !1 = $b, !2 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        FETCH_OBJ_R                                      ~3      !0, !2
          4        FETCH_OBJ_R                                      ~4      !1, !2
          5        SPACESHIP                                        ~5      ~3, ~4
          6      > RETURN                                                   ~5
          7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.66 ms | 1437 KiB | 15 Q