note 89737 added to function.error-reporting

From: Date: Fri, 20 Mar 2009 19:54:12 +0000
Subject: note 89737 added to function.error-reporting
Groups: php.notes 
Request: Send a blank email to php-notes+get-152228@lists.php.net to get a copy of this message
Just something to make things easier. E_NOTICE will warn you when you try to use un-initialized variables. If you pass the variable by reference to a function, you can check for it's existence as well as anything else you need. <?php function testNotice(&$var) { return isset($var) && !empty($var); } $foo= 'Line'; var_dump(testNotice($foo)); //bool(true); var_dump(testNotice($bar)); //bool(false) ?> ---- Server IP: 64.71.164.2 Probable Submitter: 24.248.212.7 ---- Manual Page -- http://www.php.net/manual/en/function.error-reporting.php Edit -- https://master.php.net/note/edit/89737 Del: integrated -- https://master.php.net/note/delete/89737/integrated Del: useless -- https://master.php.net/note/delete/89737/useless Del: bad code -- https://master.php.net/note/delete/89737/bad+code Del: spam -- https://master.php.net/note/delete/89737/spam Del: non-english -- https://master.php.net/note/delete/89737/non-english Del: in docs -- https://master.php.net/note/delete/89737/in+docs Del: other reasons-- https://master.php.net/note/delete/89737 Reject -- https://master.php.net/note/reject/89737 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#152228) next »