Friday, November 20, 2009

How to Referencing an instance

In PHP 5 objects are passed by reference by default.

class Person{
function say_hello(){
echo "Say hello from inside a clas";
function say_hi(){
echo "Say hi";

$person=new Person();
$person2=new Person();

echo get_class($person)."
echo "yes, Its a person";
echo "No, Its not a person";

No comments:

Post a Comment

I just got my #domain @BigRock. Get upto 25% off with my personalized coupon link Get upto 25% off