Re: Re: [PHP-DEV] Official Userland Library (was: removing an item from an array)

From: Date: Wed, 22 Aug 2012 08:54:13 +0000
Subject: Re: Re: [PHP-DEV] Official Userland Library (was: removing an item from an array)
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-62402@lists.php.net to get a copy of this message
On 2012-08-22 19:45, Lester Caine wrote:
Personally I'm looking for a 'Official Userland Library' that provides EXAMPLES of how to do operations rather than yet another downloadable library. This is also the sort of thing I would like to see. The examples within the manual are written for exposition of the feature being described, not for Best Practice in their workaday use.
One example of the difference just off the top of my head is that weekly I see people asking about why they get "Undefined index" errors because they didn't check that $_POST['foo'] existed before they tried to use its value. The page on external variables doesn't mention the fact that variables that might not exist need to be checked first, and none of the examples make such checks except for #4. (Nor should it have to, because the page is about external variables specifically, and this fact is true of variables in general - and _it_ is mentioned on the variable basics page).
There are a few such 'samples' in the manual, but the user added ones tend to be messy, and finding them is rather hit and miss. I HAVE found good samples, but getting back to them can be a problem. User submission could be a source of examples, but any collection would require curating to ensure quality and maintain currency.


« previous php.internals (#62402) next »