ID:          33643
 Updated by:  [EMAIL PROTECTED]
 Reported By: Jason at hybd dot net
 Status:      Open
 Bug Type:    Scripting Engine problem
 PHP Version: 5.1.0b2
 New Comment:

The "Fatal error:" in HEAD and PHP_5_0 occurs because of fix for bug
#33257. The patch was not applied into PHP 4.4  because it wasn't
affected by this bug (PHP 4 doesn't allow static properties).

Now I found reproducable case for PHP_4_4. :(

<?php
$x = array('foo');

function foo() {
        return $GLOBALS['x'];
}

function bar() {
        static $x = array('bar');
        return $x;
}

echo array_pop(foo())."\n";
echo array_pop(foo())."\n"; /* BUG */
echo array_pop(bar())."\n";
echo array_pop(bar())."\n";
?>
Expected result:
----------------
Fatal error: Only variables can be passed by reference 

Or:
---
foo
foo
bar
bar

Actual result:
--------------
foo

bar
bar


The current behavoir of HEAD is proper from my point of view. PHP_4_4
may be fixed but it will break BC again.

Derick, Andi?



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

[2005-07-14 11:16:56] [EMAIL PROTECTED]

I think we need to discuss this a bit more, PHP 4.4 indeed gives no
warning or notice on this. Andi, Dmitry?

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

[2005-07-14 11:01:13] [EMAIL PROTECTED]

Actual result (4.x after removing "public static"):

4.3.10: No error
4.4.0: No error
5.0.4: No error
5.1.0: Fatal error

Is this really the expected result? I thought 4.4.0 should produce
something too. In which cases 4.4.0 produces errors?

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

[2005-07-14 01:08:15] [EMAIL PROTECTED]

This is not gonna change, it's now how it's supposed to be.



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

[2005-07-11 22:04:22] Jason at hybd dot net

May I be a pain and just ask will there be any chance that this bug
will be resolved at some point in the future, or will you push others
to work round this bug. May i suggest, seeing as this does break a lot
of things, would it be possible to make this something like a
ze1_compatiblity_mode to help people phase this change in?

I assume this fixes blugs like 32685. I assume is a similar issue as I
had relating to in 32963, and I assume many other people have reported
similar bugs.

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

[2005-07-11 20:34:34] [EMAIL PROTECTED]

Yes, it is undocumented. But same goes for PHP 4.4.0 too. 
Reclassified. (this break was intentional and fixed a lot of references
related bugs)


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

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/33643

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

Reply via email to