3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Point { public function __construct( private int $y, private int $x, private string $debug, ) {} } // Order is intended to be like ORDER BY x, y // Because the order properties are declared, it becomes ORDER BY y, x $data = [ new Point(3,1,'should be third'), new Point(1,1,'should be first'), new Point(1,2,'should be fourth'), new Point(2,1,'should be second'), ]; sort($data); print_r($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l20iC
function name:  (null)
number of ops:  32
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Point'
          1        SEND_VAL_EX                                              3
          2        SEND_VAL_EX                                              1
          3        SEND_VAL_EX                                              'should+be+third'
          4        DO_FCALL                                      0          
          5        INIT_ARRAY                                       ~3      $1
   16     6        NEW                                              $4      'Point'
          7        SEND_VAL_EX                                              1
          8        SEND_VAL_EX                                              1
          9        SEND_VAL_EX                                              'should+be+first'
         10        DO_FCALL                                      0          
         11        ADD_ARRAY_ELEMENT                                ~3      $4
   17    12        NEW                                              $6      'Point'
         13        SEND_VAL_EX                                              1
         14        SEND_VAL_EX                                              2
         15        SEND_VAL_EX                                              'should+be+fourth'
         16        DO_FCALL                                      0          
         17        ADD_ARRAY_ELEMENT                                ~3      $6
   18    18        NEW                                              $8      'Point'
         19        SEND_VAL_EX                                              2
         20        SEND_VAL_EX                                              1
         21        SEND_VAL_EX                                              'should+be+second'
         22        DO_FCALL                                      0          
         23        ADD_ARRAY_ELEMENT                                ~3      $8
   14    24        ASSIGN                                                   !0, ~3
   21    25        INIT_FCALL                                               'sort'
         26        SEND_REF                                                 !0
         27        DO_ICALL                                                 
   23    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Class Point:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l20iC
function name:  __construct
number of ops:  10
compiled vars:  !0 = $y, !1 = $x, !2 = $debug
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        ASSIGN_OBJ                                               'y'
          4        OP_DATA                                                  !0
          5        ASSIGN_OBJ                                               'x'
          6        OP_DATA                                                  !1
          7        ASSIGN_OBJ                                               'debug'
          8        OP_DATA                                                  !2
    9     9      > RETURN                                                   null

End of function __construct

End of class Point.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.52 ms | 1438 KiB | 15 Q