note 74886 added to language.functions
| From: | pinkgothic at gmail dot com | Date: | Wed, 02 May 2007 09:48:34 +0000 |
| Subject: | note 74886 added to language.functions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-126116@lists.php.net to get a copy of this message | ||
Be careful: Whilst you can enter any amount of excess parameters for run-time functions, PHP's
in-built functions are capped, and will FAIL if you attempt to exceed this cap. For example:
<?php
implode(",",$arr); // (for reference)
implode(",",$arr,$set_var); // WARNING: Wrong parameter count
implode(",",$arr,$unset_var); // WARNING: Wrong parameter count
implode(",",$arr,NULL); // WARNING: Wrong parameter count
myimplode(",",$arr,$set_var); // Not an issue
?>
The function calls that cause a 'Wrong parameter count' warning return NULL.
I noticed this when trying to use $callback(...) with the values $callback =
"imagecopyresampled"; and $callback = "imagecopy"; which seemed like a good idea
at the time - the two functions have almost identical parameter lists, but imagecopy() would fail
because it has two parameters less.
----
Server IP: 217.13.201.10
Probable Submitter: 84.46.119.224
----
Manual Page -- http://www.php.net/manual/en/language.functions.php
Edit -- https://master.php.net/note/edit/74886
Del: integrated -- https://master.php.net/note/delete/74886/integrated
Del: useless -- https://master.php.net/note/delete/74886/useless
Del: bad code -- https://master.php.net/note/delete/74886/bad+code
Del: spam -- https://master.php.net/note/delete/74886/spam
Del: non-english -- https://master.php.net/note/delete/74886/non-english
Del: in docs -- https://master.php.net/note/delete/74886/in+docs
Del: other reasons-- https://master.php.net/note/delete/74886
Reject -- https://master.php.net/note/reject/74886
Search -- https://master.php.net/manage/user-notes.php