3v4l.org

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

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ghZR5
function name:  test
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !0, 4
    8     2      > RETURN                                                   null

End of function test

Function init:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ghZR5
function name:  init
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_METHOD_CALL                                         'test'
          1        CHECK_FUNC_ARG                                           
          2        FETCH_OBJ_FUNC_ARG                               $0      'y'
          3        SEND_FUNC_ARG                                            $0
          4        DO_FCALL                                      0          
   12     5      > RETURN                                                   null

End of function init

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.38 ms | 1005 KiB | 14 Q