asmith Posted October 29, 2008 Share Posted October 29, 2008 Hey Some functions that maybe look like each other, has different place of arguments. for example : in_array("find",$array) . find is first, the array is second. strpos ($string, "find") , find is last, string is first. I remember after a while, I gotta check them in php.net which is which. any logic behind these places of arguments? Quote Link to comment https://forums.phpfreaks.com/topic/130528-have-you-ever-confused-the-php-functions-syntaxes/ Share on other sites More sharing options...
.josh Posted October 29, 2008 Share Posted October 29, 2008 I've read quite a few complaints all over the net about function arguments not being ordered consistently. Quote Link to comment https://forums.phpfreaks.com/topic/130528-have-you-ever-confused-the-php-functions-syntaxes/#findComment-677173 Share on other sites More sharing options...
asmith Posted October 29, 2008 Author Share Posted October 29, 2008 That must make me feel better Quote Link to comment https://forums.phpfreaks.com/topic/130528-have-you-ever-confused-the-php-functions-syntaxes/#findComment-677175 Share on other sites More sharing options...
GingerRobot Posted October 29, 2008 Share Posted October 29, 2008 That's one of the reasons that a decent IDE helps so much; shows you the function prototype as you type the function Quote Link to comment https://forums.phpfreaks.com/topic/130528-have-you-ever-confused-the-php-functions-syntaxes/#findComment-677301 Share on other sites More sharing options...
trq Posted October 29, 2008 Share Posted October 29, 2008 That's one of the reasons that a decent IDE helps so much; shows you the function prototype as you type the function Indeed. I know its not exactly an IDE but I wish vim could do this. The best Iv'e got is to hold CTRL-1 whilst over a function name and have a shell script lookup the function in the manual for me. Quote Link to comment https://forums.phpfreaks.com/topic/130528-have-you-ever-confused-the-php-functions-syntaxes/#findComment-677305 Share on other sites More sharing options...
Mchl Posted October 29, 2008 Share Posted October 29, 2008 That's one of the annoying features of PHP. (An)other one is inconsistent function naming. Quote Link to comment https://forums.phpfreaks.com/topic/130528-have-you-ever-confused-the-php-functions-syntaxes/#findComment-677337 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.