From:             [EMAIL PROTECTED]
Operating system: Windows 2000
PHP version:      4.3.0
PHP Bug Type:     Class/Object related
Bug description:  Problem with method call

I don't know if it is the same bug as this one:
http://bugs.php.net/bug.php?id=22231&edit=2

<?php
class foo {
    function bar() 
    {}
}

function &foo() {
    $GLOBALS['foo'] =& new foo;
    return $GLOBALS['foo'];
}

/* 
The following lines cause a warning:
Problem with method call - please report this bug
*/
$foo =& foo();
$foo->bar('value');
unset($foo);

/*
A method call without a value does not cause the warning.
*/
$foo =& foo();
$foo->bar(/* no value */);
unset($foo);

/*
But the two lines together cause a fatal error:
Call to a member function on a non-object
*/
$foo =& foo();
$foo->bar(/* no value */);
$foo->bar('value');        // the error occurs in this line!
unset($foo);

?>
-- 
Edit bug report at http://bugs.php.net/?id=22232&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22232&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22232&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22232&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22232&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22232&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22232&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22232&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22232&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22232&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22232&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22232&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22232&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22232&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22232&r=gnused

Reply via email to