Though, a best kick-start development language; but I don't know why PHP lacks of consistency in naming functions etc? I've been developing for years, but most often I miss-spell function names and forget their parameter structures. Why isn't there any standard conventions followed in PHP for naming? Some times, it's like substr
and sometimes str_replace
? I often forget if needle
should be first argument or second? or haystack
be first or second? Is team behind PHP working on developing a consistent conventions and names?
Asked
Active
Viewed 2,019 times
7

arxoft
- 1,385
- 3
- 17
- 34
-
3[Because that's how PHP rolls: Like a square wheel. – *Ignacio Vazquez-Abrams*](http://stackoverflow.com/questions/12151997/why-does-1234-1234-test-evaluate-to-true#comment16259587_12151997) – Amal Murali Dec 02 '13 at 19:09
-
2Nice question. I too had thought about this a lot times ;) +1 – Shankar Narayana Damodaran Dec 02 '13 at 19:09
-
7Because it started life as a horrible collection of hacks and then had to maintain backwards compatibility. – Quentin Dec 02 '13 at 19:09
-
10@quentin: much like the human body. I'd like to beat up the design committee that came up with "let's save on resources and make the food intake channel share the same pipeline as the breathing channel. what could possibly go wrong?" – Marc B Dec 02 '13 at 19:11
-
array functions tend to be needle haystack. Strings tend to be haystack needle. I forget the details for why this is. a good text editor like sublime will autocomplete or suggest for you in case you feel like using such a utility. Alternatively, just get used to google searching things like "php in array" and checking the param structure. – Kai Qing Dec 02 '13 at 19:16
-
@MarcB - Perhaps [the biology folks](http://biology.stackexchange.com/questions/tagged/human-anatomy) can help you with that connundrum :P BTW Your comment made my day! – Lix Dec 02 '13 at 19:16
-
`Is team behind PHP working on developing a consistent conventions and names?` Backward compatibility makes this problematic, unless you replace the entire standard library... and then you _still_ have to try to avoid conflicts. – Lightness Races in Orbit Dec 02 '13 at 19:31
-
So PHP 7 should solve these, but it isn't – vaso123 Feb 15 '16 at 12:27
-
Answered by Rasmus Lerdorf himself: https://youtu.be/nmD1Q4FsXCc?t=855 – LICD Apr 19 '22 at 13:11