11

I love PHP, but...

the PHP API has been designed by crackpipe smoking cave trolls.

Every other function has its params completely reversed or in random order compared to similar functions.

Examples?
array_map, array_filter, property_exists, array_key_exists

Comments
  • 2
    Literally like a drug.

    You start with it thinking „it ain’t so great“, then you get addicted and if you are strong enough to overcome your addictions, you’ll never wanna go back.
  • 3
    It's to make you keep coming back to the docs. How else do they know how many active php devs there are in the world?
  • 1
  • 1
    in_array
  • 2
    oh cmon, same jokes over decades. go read something why it is that way, and how it was designed
  • 3
    FYI it is consistent, just not the way we all expect
  • 1
    @Root 😭😭😭😭
  • 1
    @lun0 Less designed, more cobbled together. 🤦🏻‍♀️🤷🏻‍♀️
  • 1
    I agree, though the solution is quite easy: RTFM.

    Though I wish that in PHP9 they would just yolo it and make shit consistent...
  • 2
    and editors nowadays can do that either, i myself use sublime
  • 0
    A lot of the parameter "inconsistencies" have to do with what needs to optional/variable arguments and what need to be mandatory.
    Another cause is that it is often consistent with it's C/POSIX counterpart.
Add Comment