From:             marc dot gray at gmail dot com
Operating system: Ubuntu 9.04
PHP version:      5.3.0
PHP Bug Type:     Class/Object related
Bug description:  Weird invoke issue on class as property

Description:
------------
Placing a class with an __invoke method as a property inside another 
class seems to nullify the invokeability of the original class.

Tested on:
Ubuntu 9.04, PHP 5.3.0
CentOS 5.3, PHP 5.2.11 ionCube / Suhosin

Reproduce code:
---------------
class a { 
  function __construct() { } 
  function __invoke() { echo("Invoked\n"); } 
} 

$a = new a(); 
$a(); 
// Prints: Invoked 

class b { 
  private $x; 

  function __construct() { 
    $this->x = new a(); 
    $this->x(); 
  } 
} 

$b = new b(); 
// Issues error: undefined method b::x  

Expected result:
----------------
I expect "new b()" construct to call the class a invoke

Actual result:
--------------
Undefined method - it doesn't seem to recognise the invokeable class 
property as actually invokeable.

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

Reply via email to