3 ms·
Oddly enough in PHP the things I find most annoying aren't the inconsistent method names or parameter order. I can live with those as the documentation is prett
by boyter 15y ago
Oddly enough in PHP the things I find most annoying aren't the inconsistent method names or parameter order. I can live with those as the documentation is pretty good and most IDE's give me a hint as to what its expecting.
The thing I find most annoying is being unable to pop the first element off an array when its returned and that when you do things like array_map it dosn't work with a method inside the same or other classes,
EG
$this->method()[0];
array_map($this->doSomething, $array);
- strager 15y agolist($firstElement) = $this->method(); array_map(array($this, 'doSomething'), $array); Yes, neither is intuitive. And the syntax sucks. And it's not as easy to read (except sometimes where a method returns a tuple; `list` is wonderful there!). But it's certainly possible...
- rossmasters 15y agoThere are plans for this[1] but it seems to be on/off - currently the RFC is 'accepted' - not sure when it's being introduced though (I believe there was a patch). It's certainly something I want, I come across this all the time. [1]: https://wiki.php.net/rfc/functionarraydereferencing https://wiki.php.net/rfc/functionarraydereferencing
- leftnode 15y agoDefinitely (and as other posters have mentioned, it is in/out of the works). I'd expect some developers applying for a senior development position to have similar opinions.