3 ms·
> The standard function naming and argument ordering is inconsistent and stupid This is quite hard to fix, as it would break almost everything. So you'd end up
by ancarda 5y ago
> The standard function naming and argument ordering is inconsistent and stupid
This is quite hard to fix, as it would break almost everything. So you'd end up with a Python 3 situation. However, as of PHP 8, it's less of an issue. If you can't remember the order for arguments, you can use named arguments <https://3v4l.org/cY1PB https://3v4l.org/cY1PB> like so:
strpos(needle: "foo", haystack: "foobar")
> It throws errors written in Hebrew
If you're referring to T_PAAMAYIM_NEKUDOTAYIM, this is no longer true as of PHP 8: https://3v4l.org/2T8qQ https://3v4l.org/2T8qQ -- the error is just this:
Parse error: syntax error, unexpected token "::", expecting end of file
Internally, the token is still called T_PAAMAYIM_NEKUDOTAYIM, but you can also refer to it by T_DOUBLE_COLON: <https://www.php.net/manual/en/tokens.php https://www.php.net/manual/en/tokens.php> and I suspect eventually they'll phase out the Hebrew spelling.
- verelo 5y agooh man, named arguments are great. I should have read the release notes sooner, i had no idea this change came out. Thanks for mentioning it!