Jump to content
Killersites Community
Sign in to follow this  
BhoomikaDua

CMS Project doubt

Recommended Posts

In video 28, when we create a cms object, inside the constructor we declare:-

global $FP;

$this->FP= &$FP;

the explanation being we can directly access the global $FP object directly and won't have to use a copy

Doubt 1: throughout earlier project we have used copies and never used &(reference) so why was it essential in this case? 

Doubt 2: What is the difference in using a copy ($this->FP=$FP) and an original? Shouldn't they work similarly as in case of $this->FP=$FP, we are still referencing to the same object.

Doubt 3: How to know when to use a the reference object?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×