It's ok,
I discovered that object (if not passed by reference explicitly) is first
duplicated (internally) and only then the method is called.
Proof code:
?php
class myCls
{
var $myVar;
function myCls() { $this-myVar = 1; }
function myInc() { $this-myVar++; }
Hi all,
is there any internal difference between following calls (they occur inside
some class)?
#1 register_shutdown_function(array($this, 'myfunc'));
#2 register_shutdown_function(array($this, 'myfunc'));
(note the reference operator in #2)
Or is parameter $this in example #1 forced to be
2 matches
Mail list logo