note 27635 added to language.oop
| From: | nightcat at poczta dot onet dot pl | Date: | Fri, 13 Dec 2002 17:11:47 +0000 |
| Subject: | note 27635 added to language.oop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-40868@lists.php.net to get a copy of this message | ||
Cannot get it...
class A{
var $string;
function ble(){
static $r=0;
print($r++.'<br>');
}
}
$x=new A();
$y=new A();
$x->ble(); // Prints 0
$y->ble(); // Prints 1
$x->ble(); // Prints 2
method ble() is common for both objects?
If so... what does mean 'new' in PHP ? I think this need to be fixed... otherway PHP can
be hanged by quite proper code:
class A{
var $string;
function ble(){
global $x;
static $r=0;
print($r++.'<br>');
$x->ble();
}
}
$x=new A();
$y=new A();
$y->ble();
And we're down...
--
http://www.php.net/manual/en/language.oop.php
http://master.php.net/manage/user-notes.php?action=edit+27635
http://master.php.net/manage/user-notes.php?action=delete+27635
http://master.php.net/manage/user-notes.php?action=reject+27635