-1

When I tried to edit my menu, it appeared

HTTP ERROR 500

Then I set define('WP_DEBUG', true); in wp-config.php

Once I try to save the menu, the following error appears:

Notice: Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in /www/web/keenker/public_html/wp-content/themes/keenker/functions.php on line 73

The tricky thing is, my line 73 in functions.php is

return trim($title);

And throughout the functions.php file, I don't even have REQUEST_URI parameters.

Appreciate for any help.

  • See stackoverflow.com/a/556833/378183 - looks like that PHP notice was occurring regardless of your 500 Error - you're only seeing it now because you turned on WP_DEBUG. The notice and the error are not the same thing. – Isaac Lubow Nov 16 '18 at 22:35
0

*Without quotes PHP interprets the REQUEST_URI as a constant** but corrects your typo error if there is no such constant and interprets it as string.

When error_reporting includes E_NOTICE, you would probably get an error such as:

Notice: Use of undefined constant REQUEST_URI - assumed 'REQUEST_URI' in <file path> on line <line number>

But if there is a constant with this name, PHP will use the constant’s value instead. (See also Array do's and don'ts)

So always use quotes when you mean a string. Otherwise it can have unwanted side effects.

And for the difference of single and double quoted strings, see the [PHP manual about strings](http://docs.php.net/manual/en/languag

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.