|
Posted by Richard Davey on 04/28/05 17:42
Hello Jason,
Thursday, April 28, 2005, 3:25:10 PM, you wrote:
JB> <?php
JB> /** Page called with ?a=22 appended to URL */
JB> function add($a,$b,$c) {
JB> return $a+$b+$c;
JB> }
JB> $total = add($first, $second, $third);
JB> /** You think this will be 0, but with register_globals this is actually
JB> 22 */
JB> echo $total;
As that code stands, even with register globals on, it will not echo
22. At least on PHP 4.3.11 on my server this is the case. I guess RG
makes all variables global, but not super-global, which leaves the
above safe as the null of $total overrides whatever may have been set.
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov
[Back to original message]
|