|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-01-08 09:26 UTC] hackfan at vip dot sina dot com
Description: ------------ When I use referenes to an unvalued var, I found it valued to NULL and there isn't a notice printed. Then I'd like to ask: what is notice designed for? Reproduce code: --------------- <?php error_reporting(E_ALL); $b = &$a; $a++; echo $a; ?> Expected result: ---------------- PHP Notice: Undefined variable: a in E:\a.php on line 4 1 Actual result: -------------- 1 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 16 14:00:01 2025 UTC |
<?php error_reporting(E_ALL); $b = &$a; if( isset($a) === false ) { $a++; echo $a; } else { echo 'Hello'; } ?> print: 1