Oliver Block wrote:
> Hello list,
>
> as you are familiar with the source code of php it might be easy to explain
> how the brain of php interprets the following code:
I think that this would be better suited to the startard PHP list. I
would suggest posting any further followups there.
>
> print ($life = "hard") -1;
($life="hard") assigns "hard" to $life and returns "hard"
"hard" -1 casts "hard" to an integer to do a math operation, "hard"
casts to 0
0 -1 is -1, so -1 is printed
> print "\nlife: {$life}\n";
Now you simply print the value of $life, "hard"
David
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php