ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> phpdoc
phpdoc
RE: [PHP-DOC] Boolean documentation
by Mike Ford other posts by this author
Nov 2 2005 6:25AM messages near this date
[PHP-DOC] Boolean documentation | [PHP-DOC] #35060 [Opn]: problematic safe_mode restriction in GD library
-----Original Message-----
>  From: John Clements [mailto:johnjc-phpdoc@[...].net] 
>  Sent: 02 November 2005 13:47

>  I recently added a comment to the documentation on Boolean types. It 
>  is relevant also under the section for Comparative Operators and any 
>  functions which may find a needle in position 0 of a haystack. The 
>  === and !== operators are not mentioned in the official documentation 
>  of Booleans.

There is absolutely no reason why these should be mentioned in the
Boolean section, any more than there is to mention ==, != or any of the
other comparison (not comparative) operators.

>   They are mentioned under Comparative Operators but are 
>  not defined.

This is just not true -- they are fully and comprehensively defined in
Table 15.4 in that section, alongside all the other comparison
operators.

>   The operator === is mentioned in the strpos section, the 
>  array_search section and possibly the sections covering other 
>  functions that may find a needle in position 0 of a haystack.

Yes -- this is a standard piece of text which is included in the
definition of all functions that may return Boolean FALSE on failure but
another type if successful; not only does it reference the section on
Booleans, it also includes the stricture "Use the === operator for
testing the return value of this function", where the words "the ===
operator" are a link to the Comparison Operators page which... well,
this is where we came in!

This text seems to me to be quite adequate to the job. I might suggest
one or two small improvements, such as placing the stricture re ===
before the reference to the section on Booleans, and perhaps mentioning
the !== operator as well, but otherwise I can find no real cause for
complaint with it.

Additionally, example 1 on the strpos() page even demonstrates exactly
how to test the return value of strpos() using ===, so I don't know how
much more explicit the manual can be.


Cheers!

Mike
 
------------------------------------------------------------------------
----------------
Mike Ford, Electronic Information Services Adviser, Learning Support
Services,
JG125, The Library, James Graham Building, Headingley Campus
Tel: extn 4730    Fax: extn 3211


To view the terms under which this email is distributed, please go to http://disclaimer.leed
smet.ac.uk/email.htm
Thread:
John Clements
Mike Ford

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved