3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public string $a; public string $b; public function __construct( string $a, string $b, ){ $this->a = $a; $this->b = $b; } } $a = new A('b', 'a'); $b = new A('a', 'b'); var_dump($a <=> $b); var_dump($b <=> $a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NTP5c
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'A'
          1        SEND_VAL_EX                                              'b'
          2        SEND_VAL_EX                                              'a'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   16     5        NEW                                              $5      'A'
          6        SEND_VAL_EX                                              'a'
          7        SEND_VAL_EX                                              'b'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $5
   18    10        INIT_FCALL                                               'var_dump'
         11        SPACESHIP                                        ~8      !0, !1
         12        SEND_VAL                                                 ~8
         13        DO_ICALL                                                 
   19    14        INIT_FCALL                                               'var_dump'
         15        SPACESHIP                                        ~10     !1, !0
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

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

End of function __construct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.15 ms | 1315 KiB | 12 Q