note 72105 added to function.func-get-arg

From: Date: Wed, 03 Jan 2007 04:06:39 +0000
Subject: note 72105 added to function.func-get-arg
Groups: php.notes 
Request: Send a blank email to php-notes+get-121221@lists.php.net to get a copy of this message
Re: anders at ingemann dot fakestuff dot de In your first post, you suggest that this is a good way of avoiding having to pass values that should stay at their default values, i.e. only passing what you need. However, while that is an inconvenience, I think that it is still not as inconvenient as the typechecking solution you came up with, especially considering that most functions are liable to receive multiple arguments of the same type. This is further complicated by the fact that PHP is dynamically, not statically, typed, which is another thing you have to look out for. Personally the only need I see for variable numbers of arguments is if you are passing multiple arguments, each of which should be acted on in serial in the same way. e.g. if you wrote a function custom_remove_html_tags() and had it accept a list of strings as reference that it should correct. Even then, the only benefit is that it saves you from having to create an array. Overall, I think this function is probably not worth using. ---- Server IP: 66.163.161.117 Probable Submitter: 68.163.192.14 ---- Manual Page -- http://www.php.net/manual/en/function.func-get-arg.php Edit -- https://master.php.net/note/edit/72105 Del: integrated -- https://master.php.net/note/delete/72105/integrated Del: useless -- https://master.php.net/note/delete/72105/useless Del: bad code -- https://master.php.net/note/delete/72105/bad+code Del: spam -- https://master.php.net/note/delete/72105/spam Del: non-english -- https://master.php.net/note/delete/72105/non-english Del: in docs -- https://master.php.net/note/delete/72105/in+docs Del: other reasons-- https://master.php.net/note/delete/72105 Reject -- https://master.php.net/note/reject/72105 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#121221) next »