3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; private $baz; /* don't do this */ function getVal($val) { return $this->{$val}; } /* do this instead */ function getBar() { return $this->bar; } function getBaz() { return $this->baz; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdiE4
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E > > RETURN                                                   1

Class Foo:
Function getval:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdiE4
function name:  getVal
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        FETCH_OBJ_R                                      ~1      !0
          2      > RETURN                                                   ~1
   11     3*     > RETURN                                                   null

End of function getval

Function getbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdiE4
function name:  getBar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   FETCH_OBJ_R                                      ~0      'bar'
          1      > RETURN                                                   ~0
   16     2*     > RETURN                                                   null

End of function getbar

Function getbaz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gdiE4
function name:  getBaz
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'baz'
          1      > RETURN                                                   ~0
   20     2*     > RETURN                                                   null

End of function getbaz

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.76 ms | 1066 KiB | 13 Q