note 93438 added to function.unset

From: Date: Thu, 10 Sep 2009 01:41:11 +0000
Subject: note 93438 added to function.unset
Groups: php.notes 
Request: Send a blank email to php-notes+get-160393@lists.php.net to get a copy of this message
A quick note on (unset) vs unset(). <?php $a="test"; unset($a); var_dump($a); ?> will return Notice: Undefined variable: a NULL <?php $a="test"; var_dump((unset) $a); ?> will return NULL When using unset() php will throw an E_NOTICE if you try and access the variable after it has been unset, (unset) won't. This has been tested in PHP 5.3.0 ---- Server IP: 69.147.83.197 Probable Submitter: 125.239.220.172 (proxied: 127.0.0.1) ---- Manual Page -- http://www.php.net/manual/en/function.unset.php Edit -- https://master.php.net/note/edit/93438 Del: integrated -- https://master.php.net/note/delete/93438/integrated Del: useless -- https://master.php.net/note/delete/93438/useless Del: bad code -- https://master.php.net/note/delete/93438/bad+code Del: spam -- https://master.php.net/note/delete/93438/spam Del: non-english -- https://master.php.net/note/delete/93438/non-english Del: in docs -- https://master.php.net/note/delete/93438/in+docs Del: other reasons-- https://master.php.net/note/delete/93438 Reject -- https://master.php.net/note/reject/93438 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#160393) next »