From:             thijs dot wijnmaalen at gmail dot com
Operating system: Mac OS X
PHP version:      5.2.6
PHP Bug Type:     Output Control
Bug description:  Empty reply from server when invoking dynamic method name 
within class

Description:
------------
When accessing a method within or from another class, whereby the name 
is stored as value in an array as attribute in the class.

The proper way of doing this would be to enclose the method name in 
brackets (which works as expected):

return $this->{$this->_[0]}();




Reproduce code:
---------------
<?php

class A {
        private $_ = array();
        function __toString () {
                $this->_[0] = 'a';
                return $this->$this->_[0]();
        }
        
        function a () {
                return 'call';
        }
}

echo $a = new A();

?>

Expected result:
----------------
Syntax error message

Actual result:
--------------
Empty reply from server

-- 
Edit bug report at http://bugs.php.net/?id=45467&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45467&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45467&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45467&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45467&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45467&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45467&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45467&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45467&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45467&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45467&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45467&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45467&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45467&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45467&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45467&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45467&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45467&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45467&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45467&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45467&r=mysqlcfg

Reply via email to