note 69681 added to keyword.paamayim-nekudotayim

From: Date: Fri, 15 Sep 2006 01:31:05 +0000
Subject: note 69681 added to keyword.paamayim-nekudotayim
Groups: php.notes 
Request: Send a blank email to php-notes+get-117207@lists.php.net to get a copy of this message
You can simulate the PHP 5 self keyword for static objects in PHP 4 by simply using the class name: <?php class A { function static1() { return '1'; } function static2() { // equivalent to self::static1() in PHP 5 return A::static1() . ' and 2'; } } // treat class A as static. // this will print // 1 and 2 A::static2(); ?> The A:: reference works just as well internally as externally. ---- Server IP: 216.194.113.175 Probable Submitter: 75.6.215.14 ---- Manual Page -- http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php Edit -- https://master.php.net/note/edit/69681 Del: integrated -- https://master.php.net/note/delete/69681/integrated Del: useless -- https://master.php.net/note/delete/69681/useless Del: bad code -- https://master.php.net/note/delete/69681/bad+code Del: spam -- https://master.php.net/note/delete/69681/spam Del: non-english -- https://master.php.net/note/delete/69681/non-english Del: in docs -- https://master.php.net/note/delete/69681/in+docs Del: other reasons-- https://master.php.net/note/delete/69681 Reject -- https://master.php.net/note/reject/69681 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#117207) next »