PHPForever
n00b
- Joined
- Jan 11, 2005
- Messages
- 22
Say you have the following class (in PHP 5):
Is there a technical term for the *trick* used to initialize the class within itself?
If public is called from an external source like this x::manage_class(), how many instances of the class exist?
PHP:
<?php
class x
{
function __constructor()
{
//init properties
}
public function manage_class()
{
$x= new x();
// do something here
}
}
?>
If public is called from an external source like this x::manage_class(), how many instances of the class exist?