3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { public $sname; public $fname; public $age; public function __construct($a,$b,$c) { $this->sname = $a; $this->fname = $b; $this->age = $c; return $this; } } $horrible_array_of_stuff = array( new Person("Owen", "Dyckhoff", 27), new Person("Joe", "Bloggs", 36 ) ); print_r($horrible_array_of_stuff); usort( $horrible_array_of_stuff, function( $left, $right ) { return [$left->sname, $left->fname, $left->age] <=> [$right->sname, $right->fname, $right->age]; } ); print_r($horrible_array_of_stuff);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LRneB
function name:  (null)
number of ops:  25
compiled vars:  !0 = $horrible_array_of_stuff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'Person'
          1        SEND_VAL_EX                                              'Owen'
          2        SEND_VAL_EX                                              'Dyckhoff'
          3        SEND_VAL_EX                                              27
          4        DO_FCALL                                      0          
          5        INIT_ARRAY                                       ~3      $1
          6        NEW                                              $4      'Person'
          7        SEND_VAL_EX                                              'Joe'
          8        SEND_VAL_EX                                              'Bloggs'
          9        SEND_VAL_EX                                              36
         10        DO_FCALL                                      0          
         11        ADD_ARRAY_ELEMENT                                ~3      $4
         12        ASSIGN                                                   !0, ~3
   19    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
   21    16        INIT_FCALL                                               'usort'
         17        SEND_REF                                                 !0
         18        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FLRneB%3A21%240'
   23    19        SEND_VAL                                                 ~8
         20        DO_ICALL                                                 
   26    21        INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FLRneB%3A21%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LRneB
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $left, !1 = $right
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   22     2        FETCH_OBJ_R                                      ~2      !0, 'sname'
          3        INIT_ARRAY                                       ~3      ~2
          4        FETCH_OBJ_R                                      ~4      !0, 'fname'
          5        ADD_ARRAY_ELEMENT                                ~3      ~4
          6        FETCH_OBJ_R                                      ~5      !0, 'age'
          7        ADD_ARRAY_ELEMENT                                ~3      ~5
          8        FETCH_OBJ_R                                      ~6      !1, 'sname'
          9        INIT_ARRAY                                       ~7      ~6
         10        FETCH_OBJ_R                                      ~8      !1, 'fname'
         11        ADD_ARRAY_ELEMENT                                ~7      ~8
         12        FETCH_OBJ_R                                      ~9      !1, 'age'
         13        ADD_ARRAY_ELEMENT                                ~7      ~9
         14        SPACESHIP                                        ~10     ~3, ~7
         15      > RETURN                                                   ~10
   23    16*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FLRneB%3A21%240

Class Person:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LRneB
function name:  __construct
number of ops:  12
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   10     3        ASSIGN_OBJ                                               'sname'
          4        OP_DATA                                                  !0
   11     5        ASSIGN_OBJ                                               'fname'
          6        OP_DATA                                                  !1
   12     7        ASSIGN_OBJ                                               'age'
          8        OP_DATA                                                  !2
   14     9        FETCH_THIS                                       ~6      
         10      > RETURN                                                   ~6
   15    11*     > RETURN                                                   null

End of function __construct

End of class Person.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.57 ms | 1400 KiB | 17 Q