Bug #51310 [Opn->Bgs]: Using namespaces breaks generic object type hinting

From: Date: Fri, 19 Mar 2010 00:02:39 +0000
Subject: Bug #51310 [Opn->Bgs]: Using namespaces breaks generic object type hinting
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148755@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51310&edit=1 ID: 51310 Updated by: felipe@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

« previous php.bugs (#148755) next »