Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42164 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30965 invoked from network); 8 Dec 2008 16:48:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2008 16:48:05 -0000 X-Host-Fingerprint: 201.17.117.47 unknown Received: from [201.17.117.47] ([201.17.117.47:12497] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F3/E8-21579-2CF4D394 for ; Mon, 08 Dec 2008 11:48:03 -0500 Message-ID: To: internals@lists.php.net Date: Mon, 08 Dec 2008 14:48:00 -0200 User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 References: <493D425C.6010104@zend.com> <938983775.20081208172740@marcus-boerger.de> In-Reply-To: <938983775.20081208172740@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 201.17.117.47 Subject: Re: [PHP-DEV] Problem with (namespaced) code extending ReflectionProperty - possible bug? From: rodrigo.saboya@bolsademulher.com (Rodrigo Saboya) > Which reminds me that we still have no way to do that in userland. > In userland you cannot write: > function foo(Object $bla = NULL). > The missing part is 'Object' as a type hint. I once long ago suggested > using 'class' as in 'any class member'. But people felt it wouldn't be > self explanatory enough. And unfortunately we cannot use 'Object' for > obvious reasons. We simply cannot turn that into a reserved word not > can we expect no one to have a class named Object already. > > So my suggestion holds: Let's add type hint 'class' to allow hints for > objects. > > marcus > >>> This is my test code: >>> ---- snip ---- >>> >> class PropertyReflection extends ReflectionProperty { >>> public function getValue(stdclass $object) {} >>> } >>> ?> > >> Use public function getValue($object = null) {} instead. >> -- >> Stanislav Malyshev, Zend Software Architect >> stas@zend.com http://www.zend.com/ >> (408)253-8829 MSN: stas@zend.com > > > > > Best regards, > Marcus > I don't think having a Object class built in is such a big issue with namespaces around. Anyone using object type-hinting should have a clue. -- Rodrigo Saboya