views:

45

answers:

3
+10  A: 

The previous variables are reassigned new values.

Codeacula
+1  A: 

If it is just like you have it listed, then the $name and $gender variable's values are replaced with "ELENA" and "FEMALE"

Why don't you try, echo $name;, echo $gender;

sberry2A
+1  A: 

As Codeacula said, those variables will be overwritten. The opening and closing PHP tags do not define scope. Variables are in what's called the global scope unless they are inside of a function or class. Global methods are as the name implies available, and can be overwritten inside functions and classes

When a variable is inside of a function then that variable is only available inside of that function unless it is prepended with the keyword global.

A quick search on google will give you more information on variable scope.

iangraham