references and variables. Explaining the terms

rgb192
rgb192 used Ask the Experts™
on
http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/A_12310-PHP-Variables-and-References.html

Is a great tutorial
which links to a good example
http://php.net/manual/en/language.oop5.references.php#101900

What are real world explanations for all the terms
references
variables
values
clones
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Explanations as follows:
1) References: Think of these as pointers to or address locations of variables or objects

2) Variables:  These are symbols that contain values that can be modified by assignment

3) Values:  These are what are CONTAINED in variables...   These are the "right side" of assignment statements and are used to modify variables

4) Clones: Clones are copies of objects as distinct new objects... Normally an object assignment would result in a reference to the original object (another pointer to the same thing)... When you make a clone, you create another object, copied from the original
Most Valuable Expert 2011
Top Expert 2016

Commented:
What n2fc said!  Originally PHP was intended to be the "easiest programming language to learn," but the plain truth is that programming languages are formal and structural, and none of them are really easy to learn well.  Sometimes it's a matter of making numerous teaching examples, and experimenting with them over and over -- making small changes and observing the different behaviors.

Author

Commented:
thanks for explaining terms.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial