note 60091 added to function.unset

From: Date: Mon, 26 Dec 2005 14:23:26 +0000
Subject: note 60091 added to function.unset
Groups: php.notes 
Request: Send a blank email to php-notes+get-100735@lists.php.net to get a copy of this message
If one tries to unset a typical variable that does not exist, no errors, warning or noticies will occur. However, if one tries to unset a non-existent array or an array with non-existent key, this will result in a notice. For instance: <?php $true = true; $array = array (); unset ($true, $undefinedVariable, $array [$undefinedKey], $undefinedArray [$undefinedKey]); ?> The output is (PHP 5.0.5): Notice: Undefined variable: undefinedKey Notice: Undefined variable: undefinedKey Notice: Undefined variable: undefinedArray ---- Manual Page -- http://www.php.net/manual/en/function.unset.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60091 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60091&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60091&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60091&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60091&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60091&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60091&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60091&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60091&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#100735) next »