Re: Q on Primitives

From: Date: Thu, 18 Dec 2008 22:29:02 +0000
Subject: Re: Q on Primitives
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-42340@lists.php.net to get a copy of this message
Dave Ingram wrote:
Cristian Rodríguez wrote:
class MyTestClass { public function blah(Foo $f); public function blah(Bar $b); public function blah($v); }
    
Looks like you are using the wrong language, you need JAVA instead.
Yes, I'll admit it does look like Java (or any C++-like OO language) - but PHP already does some type hinting, and IMO it can be very useful as an additional sanity check. Dave
I am a Java developer :p and PHP and AS3 (they're my primary languages), some things are good regardless of what language they're from, it's not exactly a major shift to generics or packages that I'm suggesting, just natural progression from type-hinting and most useful whatever language you are in. I daily switch between PHP and Java and there are only a few things that make logical sense to have in a language that I miss when back on php; primitives, multiple method signatures, and the ability to call a class member function without using this; however I'm well aware the latter is impossible since PHP is both procedural and OO. Regards!

« previous php.internals (#42340) next »