Your test code is totally unrelated to magic quotes thus I suspect you've misunderstood what the feature does. With magic quotes, you'd call this URL:
/test.php?foo=O'Hara
... where test.php
is:
<?php
var_dump($_GET);
... and get this back:
array(1) {
["foo"]=>
string(7) "O\'Hara"
}
... instead of this:
array(1) {
["foo"]=>
string(6) "O'Hara"
}
However, you are attempting to use a non-existing constant, as here:
<?php
define('this_exists', 'yes');
echo this_exists;
echo this_does_not_exist;
... and you possibly want that PHP does not warn you about the error:
PHP Notice: Use of undefined constant this_does_not_exist - assumed 'this_does_not_exist'
So you basically want to fiddle with error_reporting and omit E_NOTICE
.