3v4l.org

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

Class A: [no user functions]
Class B:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hWIUb
function name:  test
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   10     4        ASSIGN_OBJ                                               !0, 'test'
          5        OP_DATA                                                  'test'
   11     6      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.98 ms | 1386 KiB | 15 Q