Re: [PHP-DEV] unexpected modification of a variable

2011-06-29 Thread Ángel González
Pascal COURTOIS wrote: Hi, Is there any way that a variable can be changed within a function without passing it by reference ? I have a code like that: function myfunction($var) { print_r($var); => prints $var which is an object anotherfunction($var); // call by value print_r(

Re: [PHP-DEV] unexpected modification of a variable

2011-06-29 Thread Pascal COURTOIS
Le 29/06/2011 17:00, Richard Quadling a écrit : > For objects, $var is always an alias to an object identifier which > points to the same object... > > http://docs.php.net/manual/en/language.oop5.references.php thanks -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, vis

Re: [PHP-DEV] unexpected modification of a variable

2011-06-29 Thread Richard Quadling
On 29 June 2011 15:53, Pascal COURTOIS wrote: > Hi, > > Is there any way that a variable can be changed within a function without > passing it by reference ? > > I have a code like that: > > function myfunction($var) > { > >   >  print_r($var); => prints $var which is an object >  anotherfunction

[PHP-DEV] unexpected modification of a variable

2011-06-29 Thread Pascal COURTOIS
Hi, Is there any way that a variable can be changed within a function without passing it by reference ? I have a code like that: function myfunction($var) { print_r($var); => prints $var which is an object anotherfunction($var); // call by value print_r($var); => $var has changed