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

 ID:               51310
 Updated by:       fel...@php.net
 Reported by:      ddebernardy at yahoo dot com
 Summary:          Using namespaces breaks generic object type hinting
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: MacOS X
 PHP Version:      5.3.2

 New Comment:

The 'object' word doesn't have an special meaning on PHP type hinting.


Previous Comments:
------------------------------------------------------------------------
[2010-03-17 00:45:17] ddebernardy at yahoo dot com

Description:
------------
Specifying object as the type hint seems to be broken when using
namespaces.

Test script:
---------------
namespace A;



class X {}



function foo(object $bar) {}



foo(new X);

foo(new \stdClass);

Expected result:
----------------
foo(new X); // works

foo(new \stdClass); // works

Actual result:
--------------
foo(new X); // fails

foo(new \stdClass); // fails


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



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

Reply via email to