Calling __construct() function from __destruct(),
<?php
public function __construct() {
echo "Hi";
}
public function __destruct() {
$this->__construct();
}
?>
will it create infinite loop?
Calling __construct() function from __destruct(),
<?php
public function __construct() {
echo "Hi";
}
public function __destruct() {
$this->__construct();
}
?>
will it create infinite loop?
No, it won't.
__construct
is just regular function while called directly instead of usingnew ClassName;
No, but this will:
Example: http://ideone.com/94XUg