3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar = 'baz'; public function &getBar() { return $this->bar; } } //$reader = function & ($object, $property) { // $value = & Closure::bind(function & () use ($property) { // return $this->$property; // }, $object, $object)->__invoke(); // // return $value; //}; $foo = new Foo(); //$bar = & $reader($foo, 'bar'); //$bar = 'tab'; //var_dump($foo); $bar = $foo->getBar(); $bar = "tab"; echo $foo->getBar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ou4iE
function name:  (null)
number of ops:  11
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   27     3        INIT_METHOD_CALL                                         !0, 'getBar'
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !1, $5
   28     6        ASSIGN                                                   !1, 'tab'
   29     7        INIT_METHOD_CALL                                         !0, 'getBar'
          8        DO_FCALL                                      0  $8      
          9        ECHO                                                     $8
         10      > RETURN                                                   1

Class Foo:
Function getbar:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/ou4iE
function name:  getBar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_W                                      $0      'bar'
          1      > RETURN_BY_REF                                            $0
   10     2*     > RETURN_BY_REF                                            null

End of function getbar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.17 ms | 1393 KiB | 13 Q