43 ms·
> It has a very rich standard library Yet I still have to define startsWith() and endsWith() any time I touch PHP code... (More importantly, PHP is the one l
by ComputerGuru 6y ago
> It has a very rich standard library
Yet I still have to define startsWith() and endsWith() any time I touch PHP code...
(More importantly, PHP is the one language I can never write from memory without referencing the manual for each and every function call because of how inconsistent it is. Eg Sometimes $haystack is the first parameter and sometimes it is $needle.)
- SergeAx 6y agoThere was an RFC for that, but it was voted out: https://github.com/php/php-src/pull/2049 https://github.com/php/php-src/pull/2049
- AegirLeet 6y agostr_starts_with() and str_ends_with() are coming in PHP 8.0.
- JAlexoid 6y agoThat would be str_starts_with() and strendswith(). &$ing up functions names is a feature of PHP.
- potta_coffee 6y agoThis is my problem with PHP. Python for instance has it's own issues, but after coding in Python for awhile I can just guess the interface of various methods etc and be correct almost all of the time. PHP in comparison is so egregiously inconsistent that I have to reference documentation constantly. Python, Go and even Javascript are light years beyond PHP quality-wise (I'm comparing to those 3 languages because they're the ones I use daily right now).