3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $_var; public function __construct($val) { $this->_var=$val; } public function &getVar() { return $this->_var; } } function modifyVar(&$v) { $v=$v*2; } $test=new Test(2); $a=&$test->getVar(); $a+=2; echo $test->getVar()." "; modifyVar($a); echo $test->getVar()." ";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1510j
function name:  (null)
number of ops:  20
compiled vars:  !0 = $test, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'Test'
          1        SEND_VAL_EX                                              2
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   19     4        INIT_METHOD_CALL                                         !0, 'getVar'
          5        DO_FCALL                                      0  $5      
          6        ASSIGN_REF                                               !1, $5
   20     7        ASSIGN_OP                                     1          !1, 2
   21     8        INIT_METHOD_CALL                                         !0, 'getVar'
          9        DO_FCALL                                      0  $8      
         10        CONCAT                                           ~9      $8, '+'
         11        ECHO                                                     ~9
   22    12        INIT_FCALL                                               'modifyvar'
         13        SEND_REF                                                 !1
         14        DO_FCALL                                      0          
   23    15        INIT_METHOD_CALL                                         !0, 'getVar'
         16        DO_FCALL                                      0  $11     
         17        CONCAT                                           ~12     $11, '+'
         18        ECHO                                                     ~12
         19      > RETURN                                                   1

Function modifyvar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1510j
function name:  modifyVar
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        MUL                                              ~1      !0, 2
          2        ASSIGN                                                   !0, ~1
   16     3      > RETURN                                                   null

End of function modifyvar

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

End of function __construct

Function getvar:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/1510j
function name:  getVar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FETCH_OBJ_W                                      $0      '_var'
          1      > RETURN_BY_REF                                            $0
   11     2*     > RETURN_BY_REF                                            null

End of function getvar

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.63 ms | 1403 KiB | 14 Q