3v4l.org

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

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

End of function __construct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.34 ms | 1396 KiB | 15 Q