Link to home
Start Free TrialLog in
Avatar of vanauden
vanaudenFlag for Canada

asked on

php 5.2 register_globals setting not functionning

PHP 5.2, Windows 2003, Apache 2.0

Register_Globals are OFF in php.ini but global variables are still enabled. This is my test script:
No .htaccess files are present.

<?php
$test="hello world";
testfunc();

function testfunc()
{
global $test;
echo $test;
}
?>

It produces the following output: hello world

Is there another setting that manages the global variables for PHP???
Avatar of TeRReF
TeRReF
Flag of Netherlands image

Yes, this :)

global $test;

Remove that and it won't work anymore
ASKER CERTIFIED SOLUTION
Avatar of TeRReF
TeRReF
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vanauden

ASKER

ok I understand -

follow up question:

does the global keyword also work in php version 4??
According to the PHP manual on this topic, the keyword does exists in PHP 4:

http://www.php.net/global