Re: Use of + with arrays

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

 



On Wed, July 6, 2005 12:43 pm, Bob Stearns said:
> In a note on 31-Jul-2002 added to the unshift function  the writer
> stated that array2=arrray1+array2 was equivalent to
> unshift(arrayw,list(array1)). My php seems to take strong objection to
> this [Fatal error: Unsupported operand types in
> /var/www/html/GEM/etFlush/embryo_newFrozen.php on line 417]. Am I doing
> something wrong? Was the original poster on something? Is this a version
> problem?

Almost for sure a version "problem"

Way back in PHP/FI (aka PHP 2) you could use "+" to concatenate strings, I
do believe.

And, probably, somewhere along the way, you could use "+" to merge arrays
or something.

Both probably seemed like Good Ideas (tm) at the time...

Don't do it.

Overloading operators in "cute" ways like that invariably leads to more
problems than the dubious benefit of their usage.

-- 
Like Music?
http://l-i-e.com/artists.htm

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


[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