Bug #921: funcs not returning false in assignment context
| From: | david at uws dot edu dot au | Date: | Sun, 15 Nov 1998 15:21:25 +0000 |
| Subject: | Bug #921: funcs not returning false in assignment context | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2416@lists.php.net to get a copy of this message | ||
From: david@uws.edu.au
Operating system: Solaris 2.5.1
PHP version: 3.0.5
PHP Bug Type: Misbehaving function
Bug description: funcs not returning false in assignment context
If $doterms is previously set using a logic expression
($doterms = (x and y and z and ...)) it should contain the
integer equivalent of boolean TRUE or FALSE - so far so good.
In an assignment context:
$doterms = $doterms and ereg(...) and eregi(...);
$doterms should only be set to the integer equivalent of
boolean TRUE iff all three expressions are considered to
be "TRUE" - alas, however, it appears to *always* be set
to true, regardless of the ereg/eregi pattern matches.
A conditional context does, however work:
if( $doterms and ereg(...) and eregi(...) )
$doterms = 1;
else
$doterms = 0;
This will correctly set $doterms to zero (FALSE) should one
of the RE pattern matches fail.
Surely this is inconsistent (boolean/logic) behaviour (and
probably affects other/all functions)?
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net