ID:               25620
 User updated by:  xris at farcaster dot net
 Reported By:      xris at farcaster dot net
 Status:           Wont fix
 Bug Type:         Scripting Engine problem
 Operating System: GNU/Linux 2.4.20
 PHP Version:      4.3.4-dev
 New Comment:

OK. Thanks to you all for your help and efforts anyway.
Keep up the good work, your are doing a tremendous job.


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

[2003-09-28 16:17:56] [EMAIL PROTECTED]

So it is the same basic problem as in bug #22510 and is 'fixed' in
PHP5. This will not be fixed in PHP 4.


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

[2003-09-27 21:23:24] xris at farcaster dot net

I had to modify some minor stuff of the script (our system) to get it
working with php5.

Then php complained on a couple of occasions about an illegal return
value for a refercence return method ( we had some calls like the one
in my "Example 2" and some methods doing "return new XYZ();).

I fixed these by first assigning the return value to a
variable, then returned this var.

After that, php5 ran the code without complaints/errors.

The same (modified) code, run by the php4 version, still throws the
error.

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

[2003-09-27 13:20:19] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip




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

[2003-09-27 12:07:11] xris at farcaster dot net

So far i checked 600 methods, but could'nt find any
return's similar to your examples. What about these
constructs, are they known to cause heap corruption, too?

// Example 1
function &return_ref_constant() {
    return FALSE; // or "return (1<2):"
}
// Example 2
function &a() {
  return $b
}
function &return_ref_method() {
    return $this->a();
}
// Example 3
function &return_ref_array() {
    return array();
}

Yes, i know, some of them are "wrong".

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

[2003-09-27 11:00:41] [EMAIL PROTECTED]

Seems to me the same issue addressed in bug #22510. I suspect you are
trying to return a value by reference that is not originated from a
variable somewhere in a function. That is,

function &return_ref_a() {
    return $a + $b;
}

function &return_ref_b() {
    return @$a;
}

function &return_ref_c() {
    return -$a;
}

None of the above examples don't actually work, which are verified to
cause random heap corruption. Please check if such an error is
somewhere in your code.






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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/25620

-- 
Edit this bug report at http://bugs.php.net/?id=25620&edit=1

Reply via email to