3v4l.org

run code in 300+ PHP versions simultaneously
<?php $class1 = new stdClass(); $class1->a = 1; $class2 = new stdClass(); $class2->a = 2; $class3 = new stdClass(); $class3->a = 3; $input = [$class3,$class2,$class1]; var_dump($input); usort($input, function($a, $b) { if ($a->a == $b->a) { return 0; } return ($a->a < $b->a) ? -1 : 1; }); var_dump($input);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ELKp
function name:  (null)
number of ops:  31
compiled vars:  !0 = $class1, !1 = $class2, !2 = $class3, !3 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $4      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    5     3        ASSIGN_OBJ                                               !0, 'a'
          4        OP_DATA                                                  1
    6     5        NEW                                              $8      'stdClass'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $8
    7     8        ASSIGN_OBJ                                               !1, 'a'
          9        OP_DATA                                                  2
    8    10        NEW                                              $12     'stdClass'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $12
    9    13        ASSIGN_OBJ                                               !2, 'a'
         14        OP_DATA                                                  3
   11    15        INIT_ARRAY                                       ~16     !2
         16        ADD_ARRAY_ELEMENT                                ~16     !1
         17        ADD_ARRAY_ELEMENT                                ~16     !0
         18        ASSIGN                                                   !3, ~16
   13    19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                                 
   15    22        INIT_FCALL                                               'usort'
         23        SEND_REF                                                 !3
         24        DECLARE_LAMBDA_FUNCTION                          ~19     [0]
   20    25        SEND_VAL                                                 ~19
   15    26        DO_ICALL                                                 
   22    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                                 
         30      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ELKp
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        FETCH_OBJ_R                                      ~2      !0, 'a'
          3        FETCH_OBJ_R                                      ~3      !1, 'a'
          4        IS_EQUAL                                                 ~2, ~3
          5      > JMPZ                                                     ~4, ->7
   17     6    > > RETURN                                                   0
   19     7    >   FETCH_OBJ_R                                      ~5      !0, 'a'
          8        FETCH_OBJ_R                                      ~6      !1, 'a'
          9        IS_SMALLER                                               ~5, ~6
         10      > JMPZ                                                     ~7, ->13
         11    >   QM_ASSIGN                                        ~8      -1
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~8      1
         14    > > RETURN                                                   ~8
   20    15*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.63 ms | 1016 KiB | 15 Q