[PHP] Functions Returning large strings

2005-09-29 Thread zzapper
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?

to simplify

$large_string=fn_one(fn_two(fn_three(;


your advice pls


-- 
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Functions Returning large strings

2005-09-29 Thread Andy Pieters
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/

--


pgphHcBjoE1mU.pgp
Description: PGP signature