ID: 26368 Updated by: [EMAIL PROTECTED] Reported By: webmaster at x7chat dot com -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Linux, Windows PHP Version: 4.3.3 New Comment:
You have some problem in your script. Get rid of '@' and set error_reporting(E_ALL); and you'll most likely find out what is wrong. There is no bug here, this is expected behaviour. Previous Comments: ------------------------------------------------------------------------ [2003-11-23 15:03:14] webmaster at x7chat dot com Description: ------------ A certain script I wrote uses the following line of code: $USER['TEMP'] .= "!"; When I run this some servers (Programmed on Redhat Linux 9 with PHP 4.3.3 and it works fine, tested on another Linux server using PHP 4.3.3 and it returns the error) it returns the following error message: Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in (FILE PATH) on line (LINE NUMBER) I have asked many different programmers about it and nobody has an answer as to why it causes an error on code that is correct. According to PHP documentation the syntax of it is correct. Another person who has had this problem has documented it here: http://www.faqchest.com/prgm/php-l/php-02/php-0205/php-020581/php02052416_25320.html. I distribute the script for free and I have had at least 4 different users report that they are having this problem. The variable $USER['TEMP'] has been defined before and is not null. Reproduce code: --------------- $q = DoQuery("SELECT * FROM $SERVER[TBL_PREFIX]users WHERE username='$USER[NAME]'"); $USER['TEMP'] = $row[13]; $k = 1; $i = 0; $s = 0; $r[0] = ""; $USER['TEMP'] .= "!"; while($k){ $sub = substr($USER['TEMP'],$i,1); if($sub == "!"){ $k = 0; break; } if($sub == ","){ $s++; }else{ @$r[$s] .= $sub; } $i++; } Expected result: ---------------- I would expect it to add "!" to $USER['TEMP'] every time it goes through the while loop, on some servers it does but on others it returns the error even if they are the same type of server running the same version of PHP. Actual result: -------------- On some servers it works correctly and on others it says: Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in (FILE PATH) on line (LINE NUMBER) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26368&edit=1