Re: Functions Returning large strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: pgpCd1DK5bbZ4.pgp
Description: PGP signature


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux