by Produce · 14y ago · 0 comments
You can't do:
$something->doStuff()[0]
if(empty($something->doStuff()))
Overload fucking functions. Fuck.
What sucks:
The namespace separator.
The naming conventions of the core functions.
The speed.
But, overall it works and elegant solutions can be written.
Also, being competent in a market full of incompetents makes you valuable and getting a well paying job is easy. What's not to like about that?
I like the namespace separator, but I'll accept I’m in the minority on that one.
I also understand the technical need for a new character (which doesn't exist for static languages or some other dynamic languages) and once you need a new character then the backslash is a reasonable choice.
Being able to keep up with the slowest competitor in existence isn't very good.
Edit: I should add "in my experience" to the end of that, I have no stats to hand.
If you skip a framework on both languages, they end up as the two slowest languages. Hard to say if either is faster overall, but they are both awful. Using jruby provides a huge performance increase, and PHP really has nothing to compare with that.
Yes you can.
"Speed"
Care to expand on this one?
AFAIK, yes, in PHP 5.4 only so far, which is only about 4 months old. The first 15+ years of PHP's life, no, that wasn't possible. I'm glad it's there now, but frustrated it took so long.
$func = function() { return ['a', 'b', 'c']; };
echo $func()[0];I just read about the new closures. Too bad, scoping is still somewhat broken: You have to explicitly declare the variables you want to use from the outer scope.