RE: [PHP-DEV] PHP 4.0 Bug #8139 Updated: NULL and isset
| From: | Richard Heyes | Date: | Thu, 14 Dec 2000 12:18:43 +0000 |
| Subject: | RE: [PHP-DEV] PHP 4.0 Bug #8139 Updated: NULL and isset | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-41332@lists.php.net to get a copy of this message | ||
> >From current Zend code I see that no operation that should
> write variable (including passing by reference) won't
> generate "undefined" waring. This seems logical - if you
> write it, why you care if it wasn't set before?
If I try to use a variable (eg. $var .= 'whatever') that hasn't been set
before then I want to know about it, because somethings probably wrong.
That's why I have error_reporting set to E_ALL.
> So I'd close it, since it's not a bug, but intended
> behaviour. If you disagree, submit a feature request.
The code I first submitted (below) indicates to me a bug, as the print()
call doesn't generate a notice saying it's unset, whilst the
if(!isset($bar)) is saying that it is unset.
But hey, I'm not an expert. So if you're convinced, thats good for me. :)
> <?php
> function foo(&$bar){
> return TRUE;
> }
>
> foo($bar);
>
> print($bar);
>
> if(!isset($bar))
> print('Bar is not set!');
> ?>
--
Richard Heyes