3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { private $var; public function __construct(&$var) { $this->var = &$var; } public function dump() { var_dump($this->var); } } $foo = new Foo($id); $id = 'aaaa'; $foo->dump();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QN7F9
function name:  (null)
number of ops:  8
compiled vars:  !0 = $foo, !1 = $id
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   NEW                                                  $2      'Foo'
          1        SEND_VAR_EX                                                  !1
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $2
   19     4        ASSIGN                                                       !1, 'aaaa'
   21     5        INIT_METHOD_CALL                                             !0, 'dump'
          6        DO_FCALL                                          0          
          7      > RETURN                                                       1

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

End of function __construct

Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QN7F9
function name:  dump
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                                   'var_dump'
          1        FETCH_OBJ_R                                          ~0      'var'
          2        SEND_VAL                                                     ~0
          3        DO_ICALL                                                     
   15     4      > RETURN                                                       null

End of function dump

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.57 ms | 1279 KiB | 9 Q