Jump to content

Using reserved words...


wright67uk

Recommended Posts

Yeah, either it's a variable and will be preceeded by '$' or it's a literal string that won't be confused for a keyword anyway. The only way you could have problems is if you decided you wanted to use a reserved word as the name of a constant AND you decided not to follow capitalization conventions, at which point you'll have made multiple intentional decisions to cause yourself problems and really shouldn't be surprised when you succeed (at failing)

The only way you could have problems is if you decided you wanted to use a reserved word as the name of a constant AND you decided not to follow capitalization conventions,

Constants may be case-sensitive (by default) but keywords aren't.

define("RETURN", 123);
echo RETURN; // unexpected T_RETURN

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.