constructor and destructor in php
<?php
/*
By defualt constructor call at the beginning and by defualt destructor call at the end.
constructor and destructor call automatic when object is called
*/
class Birds
{
function __construct()
{
echo "Start<br>";
}
function fun1()
{
echo "this is function<br>";
}
function __destruct()
{
echo "End";
}
}
$parrot = new Birds();
$parrot->fun1();
?>