note 49749 added to language.functions

From: Date: Mon, 07 Feb 2005 21:17:18 +0000
Subject: note 49749 added to language.functions
Groups: php.notes 
Request: Send a blank email to php-notes+get-84634@lists.php.net to get a copy of this message
Here's how to get static function behavior and instantiated object behavior in the same function <?php // Test of static/non-static method overloading, sort of, for php class test { var $Id = 2; function priint ($id = 0) { if ($id == 0) { echo $this->Id; return; } echo $id; return; } } $tc = new test (); $tc->priint (); echo "\n"; test::priint (1); /* output: 2 1 */ ?> ---- Manual Page -- http://www.php.net/manual/en/language.functions.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49749 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49749&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49749&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49749&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49749&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49749&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49749&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#84634) next »