-1

The problem is as the title says:

First: two equality symbols in one statement.

Example1: $comp = $subcomp = null;

Second: A variable declaration with symbol "&" proir to the variable.

Exmaple2: $actcomp = & $this;

Can someone explain to me the purpose of two equality symbols and the symbol "&" in the variable declaration? The coding langauge I use is PHP.

einstein
  • 11,631
  • 25
  • 77
  • 98
  • 2
    Homework? That's the *assignment* operator, not the comparison/equality operator. For the second part, here: http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php – deceze Dec 16 '10 at 07:01
  • 2
    don't want to read PHP manual? – RageZ Dec 16 '10 at 07:01
  • 1
    Closevoting because this is not a real "problem" description or question, but asking for syntax lectures. – mario Dec 16 '10 at 07:08
  • 2
    mario, the point of Stack Overflow was for programmers of **any** level to ask questions **at their level** and get answers. RTFM is the opposite of Stack Overflow. – Alan Storm Dec 16 '10 at 07:25
  • "Treat others with the same respect you'd want them to treat you. We're all here to learn together. Be tolerant of others who may not know everything you know. Bring your sense of humor." – Alan Storm Dec 16 '10 at 08:30

1 Answers1

1

Example 1 : 2 variables are set alocating memory for both , a change to $comp would not affect $subcomp .

Example 2 : $actcomp will point to the same memody address of $this so any changes made to $actcomp will affect $this too .

Poelinca Dorin
  • 9,032
  • 2
  • 34
  • 41
  • i do care , why are you saying it's totaly wrong ? please explain – Poelinca Dorin Dec 16 '10 at 11:21
  • @stereofrog: :) i was using Pascal jargon :P , anyway the principle ( or acting so to speak ) is the same , for me it seams easyer to be understood , and remembered for that matter couse all php programmers should be carefull about memory so it has a greater inpact on the reader , i will revise it and edit it when i get 5 spare minutes , thanks for the heads up . – Poelinca Dorin Dec 16 '10 at 11:48