3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $foo = 5; public function test() { return $this->foo; } } function &getFoo() { $var = 6; return $var; } $test = new Test(); $var[] = &$test->test(); $var[] = getFoo(); var_dump($var);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xd22c
function name:  (null)
number of ops:  16
compiled vars:  !0 = $test, !1 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   22     3        INIT_METHOD_CALL                                         !0, 'test'
          4        DO_FCALL                                      0  $6      
          5        MAKE_REF                                         $7      $6
          6        FETCH_DIM_W                                      $5      !1
          7        ASSIGN_REF                                               $5, $7
   23     8        INIT_FCALL                                               'getfoo'
          9        DO_FCALL                                      0  $10     
         10        ASSIGN_DIM                                               !1
         11        OP_DATA                                                  $10
   25    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Function getfoo:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/Xd22c
function name:  getFoo
number of ops:  3
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 6
   18     1      > RETURN_BY_REF                                            !0
   19     2*     > RETURN_BY_REF                                            null

End of function getfoo

Class Test:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Xd22c
function name:  test
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'foo'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function test

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.88 ms | 1398 KiB | 16 Q