Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #26368 : Returns a Fatal error when using assign-ops
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 22nd February 08:19
php-bugs
External User
 
Posts: 1
Default #26368 : Returns a Fatal error when using assign-ops



ID: 26368
Comment by: penfield888 at yahoo dot com
Reported By: webmaster at x7chat dot com
Status: Bogus
Bug Type: Arrays related
Operating System: Linux, Windows
PHP Version: 4.3.3
New Comment:

Actually, I have error_reporting set to E_ALL, no error suppression
operators, all variables carefully initialized. I get the error on
occasion on one server, not on others. In a very simple situation, I
get the same error on code like this

$var['idx'] = '';
$var['idx'] .= "more string";

Others who have had the error seem to have had goodluck fixing it
simply by changing to

$var['idx'] = $var['idx'] . "more string";

which should change nothing.


Previous Comments:
------------------------------------------------------------------------

[2003-11-23 21:21:34] sniper@php.net

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.


------------------------------------------------------------------------

[2003-11-23 15:03:14] webmaster at x7chat dot com

Description:
------------


$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 do***entation the syntax of it is correct.

Another person who has had this problem has do***ented 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
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666