Variables
|
· | string;
|
· | number (int/double);
|
· | true/false;
|
· | hash (associative array);
|
· | class of objects;
|
· | object of a class (user-defined class as well);
|
· | code;
|
· | expression.
|
$variable_name[string]
|
assigns a string (an object of class string) or an object of some class;
|
$variable_name(expression)
|
assigns a number or result of some mathematical expression
|
$variable_name{code}
|
assigns some code to be executed when the variable is referred to
|
Code
|
Result
|
$string[2+2]
$string |
2+2
|
$number(2*2)
$number |
4
|
$i(0)
$code{$i} $i(1) $code |
1
|
$i(0)
$string[$i] $i(1) $string |
0
|
Copyright © 19972021 Art. Lebedev Studio | http://www.artlebedev.com | Last updated: 04.09.2008 |