note 103253 added to language.oop5.static

From: Date: Mon, 04 Apr 2011 09:27:16 +0000
Subject: note 103253 added to language.oop5.static
Groups: php.notes 
Request: Send a blank email to php-notes+get-178458@lists.php.net to get a copy of this message
accessing a non-existing static property will result in an E_ERROR message. You can check wether a property exists with the 'defined' function. Example: <?php class a { static $test; function set($name) { if (defined(self::$$name)) echo "$name is defined"; else echo "$name is not defined"; } } a::set('test'); a::set('test2'); ?> will output: test is defined test2 is not defined ---- Server IP: 69.147.83.197 Probable Submitter: 195.93.224.20 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.static.php Edit -- https://master.php.net/note/edit/103253 Del: integrated -- https://master.php.net/note/delete/103253/integrated Del: useless -- https://master.php.net/note/delete/103253/useless Del: bad code -- https://master.php.net/note/delete/103253/bad+code Del: spam -- https://master.php.net/note/delete/103253/spam Del: non-english -- https://master.php.net/note/delete/103253/non-english Del: in docs -- https://master.php.net/note/delete/103253/in+docs Del: other reasons-- https://master.php.net/note/delete/103253 Reject -- https://master.php.net/note/reject/103253 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#178458) next »