I'm pretty much in the same place as you with regards to PHP: I know it like the back of my hand and everything and everybody works with it. But the code is ugly compared to other languages and I really want method chaining, dammit. Plus, of course, I don't want to have to write an MVC framework every time I want to do something.
$object->doThis()->doThat()->doTheOther();
But maybe he is referring to method chaining using PHP's built-in functions. There isn't a way that I'm aware of to do the following (short of wrapping the built-in functions with your own classes): $string->preg_replace("/[^A-Za-z]+/","_")->trim()->upper();$string = preg_replace("/[^A-Za-z]+/","_", trim(upper($string)));
Or am I missing your point?
What? We've been doing code like:
filter('user')
->first_name->like('bob')
->age->equals('22')
->order_by->created->desc
->find();
Since 5.2.xI keep happening upon projects with their own craptacular homebrew MVC framework, and their own abysmal homebrew caching.
Fix is a swap for yii and memcached -- feel free to choose your faves.
Stockholm Syndrome?
Seriously, when you've been programming long enough, you really stop caring about programming languages. I could build a huge project in VB.Net or ColdFusion if I had to at this point. If there's good reasons for why a language should be used (and PHP has plenty of them that are external to the language itself), then it's immaterial to me.
namespace my\name;
$c = new \my\name\MyClass;
I wouldn't complain if a better server-side language came around (not a big fan of Ruby's syntax, but Google's Go looks enticing), but until then, I've built incredibly complex apps in PHP, and rarely do I run into a limitation of the language. My biggest issue in the past was the lack of namespaces, and 5.3 has those.
I think the best thing you could do to get a new language as popular as PHP isn't to evangelize, or even to make the language dead simple, but make it dead simple for administrators to add support to a typical shared hosting environment.