note 27635 deleted from language.oop by vincent
| From: | vincent@php.net | Date: | Thu, 11 Sep 2003 20:03:22 +0000 |
| Subject: | note 27635 deleted from language.oop by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56212@lists.php.net to get a copy of this message | ||
Note Submitter: nightcat@poczta.onet.pl
----
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...