3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ } $a = new A(); class B{ public function test($obj = '') { $obj->id = '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/8fAh7
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
   13     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   14     6        INIT_METHOD_CALL                                         !1, 'test'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   15     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/8fAh7
function name:  test
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      ''
    9     1        ASSIGN_OBJ                                               !0, 'id'
          2        OP_DATA                                                  'test'
   10     3      > RETURN                                                   null

End of function test

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.87 ms | 1395 KiB | 15 Q