> > I like that kind of agile programming, too. > > But if someone like me says "come on, lets make it a little bit more > easy, because returning objects from functions is some kind of > unconventional; many developers will make mistakes here..." - why not? > They will. I can tell by sure. >
What are suggesting is going to make this easy that isn't already covered by the RFC? Lets not get caught up in semantics here. The current RFC outlines what appears to be inline with other established implementations. The fact that a function can return an object should be nothing new to PHP. The fact that an object cause some flow of control through a construct, also shouldn't be new to PHP. I don't understand what you find non-conventional about functions or methods that return objects. function foo() { return new bar; } $foo = foo(); That's already a common thing in most PHP code I see. PDO::prepare(), MySQLi::prepare(), DateTime::diff(), also return objects as a result of calling those methods. I don't think very many PHP developers will find this concept difficult to grasp if they can already grasp the aforementioned methods, for example. > > Since I begun reading this mailing list I have the impression, that > there are only PHP-programmers like us out there. But the fact is, > that the most PHP-programmers didn't even read the manuals completly. > You may say "Their fault" "Are they programmers, if they don't?", but > this is first a little bit of ignorance because second this is one of > the best features, that PHP has - this "nicely flow", everybody can do > it. I always think of Bob Ross, when I explain PHP. > Yes, there are people who don't read the manual. This is nothing new or unique to any particular language. Yes, PHP makes it easy for virtually anybody to use. No, not everything in PHP is easy. No, not everybody who can use PHP will find it easy to write good code or to understand all of the language's features at first. What programming language holds this characteristic? From all of the programming languages I've learned over the years PHP is still by far at the top of my list for taking on new features. Just between PHP 5.2 and 5.4 we've gained traits, closures, namespaces, function array derefrencing, access to member upon instantiation, and lots of other lovely additions to the language. I don't see languages like Java or Python evolving this quickly -- by contrast. > > But it's ok, there are no mistakes, there are just happy little accidents. :) > > [means: I will not complain any more] > > -- > Alex Aulbach I didn't take any of that as a complaint. I think if you have an object suggestion (or even subjective one) as to how this can be easier on the end-user of the language it would be important to bring it out now. I was unable to ascertain from the prior discussion thus far. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php