Re: Resurrecting the Function Renaming Thread
| From: | Hartmut Holzgraefe | Date: | Tue, 06 Feb 2001 21:40:49 +0000 |
| Subject: | Re: Resurrecting the Function Renaming Thread | ||
| References: | 1 2 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-2239@lists.php.net to get a copy of this message | ||
Cynic wrote:
> The is_numeric function happens to be quite a good example. If PHP really
> sticked to the underscore convention, one wouldn't probably have to look at
> the manual to use the function. The name lends itself. You could just think,
> "well, I bet there's a function for this, and it must be named
> 'is_numeric',
> because that's what it does. It could never be named foobar. And there'll be
> an underscore, because that's what _everything_ looks like in PHP.' And bingo,
> you'd be right. However, the reality is, than in PHP, you can never be sure
> if it isn't isnumeric or numeric, so you just have to skim the manual. And
> when you need to use the function again after two weeks for example, you have
> to look again (or try it - _try_, not _do_), because you remember that the
> words are 'is' and 'numeric', but you cannot be sure it there's an
> underscore
> between or not.
once upon a time i had added a feature to the 'undefined function'
error message that would use the levenshtein function internaly to
look for similar names in the registered function list
instead of just
"PHP Fatal error: Call to undefined function: is_set() in ..."
it gave
"PHP Fatal error: Call to undefined function: is_set() in ...
maybe you were looking for isset()?"
Zeev reverted that patch because finding the right error message
to extend was a dirty hack (which it definetly was, but doing better
was not possible without crossing the php-zend code barriere)
and wanted to implement it in the zend part instead ...
--
Hartmut Holzgraefe hartmut@six.de http://www.six.de
+49-711-99091-77
Besuchen Sie uns auf der CeBIT 2001 - in Halle 6 Stand F62/4