3v4l.org

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

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

End of function modify

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.08 ms | 1395 KiB | 15 Q