New RFC

From: Date: Tue, 02 Aug 2016 05:20:20 +0000
Subject: New RFC
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-94795@lists.php.net to get a copy of this message
Hi, cause of my english, I think it's not good idea to wrote new RFC. But, there is feature which missing in PHP 7+. As you release new PHP version with type hinting and return type, you forgot for objects array like in JAVA or .NET For better understand there is example of syntax in JAVA Player[] thePlayers = new Player[playerCount + 1]; That's mean in variable thePlayers will be array witch items are only instances of Player class. I'm not saying syntax have to be same, but functionality. Cause after this you can use type hints in functions/methods declaration like: public function foo(Foobar[] $fooBarList):bool { // Some work with array return True; } And if you insert array to this method as argument, there will be exception or notice, which say you "Argument 1 is not array of Foobar objects" for example. Bad thing on this is I don't have experience and all needed knowledge for create full RFC and development of this feature. What you saying? Can it be implemented? Thank you alot for reply Tomáš Holan(holantomas - wiki account)

« previous php.internals (#94795) next »