Re: Functions Returning large strings

From: Date: Thu, 29 Sep 2005 09:48:10 +0000
Subject: Re: Functions Returning large strings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-223397@lists.php.net to get a copy of this message
Hi > I have a series of nested functions which return a large string (as apposed > to working on global string) , is this inefficient? Or is PHP clever enough > to just pass a pointer? > $large_string=fn_one(fn_two(fn_three()))); PHP is by no means cleaver enough to read your mind as to what you want it to do. If you want to pass pointers instead of strings then do as this function one(&$buffer) { #processing, return true/false based on success, put result in buffer } function two(&$buffer) { #processing,... } Then do like this: $variable='input value'; if(one($variable)) if(two($variable)) echo "Result: $variable"; HTH Andy -- Registered Linux User Number 379093 Now listening to [silence] amaroK::the Coolest Media Player in the known Universe! Cockroaches and socialites are the only things that can stay up all night and eat anything. Herb Caen -- -- --BEGIN GEEK CODE BLOCK----- Version: 3.1 GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++ L+++>++++$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++) PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+) e>++++$@ h++(*) r-->++ y--()>++++ -- ---END GEEK CODE BLOCK------ -- Check out these few php utilities that I released under the GPL2 and that are meant for use with a php cli binary: http://www.vlaamse-kern.com/sas/ --

Attachment: [application/pgp-signature]
« previous php.general (#223397) next »