note 15490 modified in language.references.return by irc-html

From: Date: Sat, 19 Jan 2002 20:23:17 +0000
Subject: note 15490 modified in language.references.return by irc-html
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-25295@lists.php.net to get a copy of this message
I got REAL troubles returning references from class methods (i did not try with ordinary functions): At first all seemed to work well, but, while my project was growing bigger (i.e. started to instantiate more and more objects), the whole memory mapping of PHP 4.0.5 seemed to fail. Lines like theese: function foo($a){}; $b = "something"; foo("now it is something else"); echo($b); outputted: now it is something else I solved (walked around) those problems by returning BY VALUE from all methods. Hoping to be useful, Giorgio Gallo --was-- I got REAL troubles returning references from class methods (i did not try with ordinary functions): At first all seemed to work well, but, while my project was growing bigger (i.e. started to instantiate more and more objects), the whole memory mapping of PHP 4.0.5 seemed to fail. Lines like theese: function foo($a){}; $b = "something"; foo("now it is something else"); echo($a); outputted: now it is something else I solved (walked around) those problems by returning BY VALUE from all methods. Hoping to be useful, Giorgio Gallo http://www.php.net/manual/en/language.references.return.php

« previous php.notes (#25295) next »