You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ATM, php-mode treats all constants and superglobals as case-insensitive, i.e. $_server or pHp_VeRsIon are highlighted as if the were correct, but PHP will only throw errors if you run this.
I could not find any way to tell font-lock to treat some regular expressions in a case-insensitive way. So what I am doing is making php-mode treat all regular expressions as case-sensitive by default and then I'm going to manually craft expressions for the magic constants that are case-insensitive. Here is a utility function I wrote to help create those expressions, which others may find useful.
So for example (make-case-insensitive-regexp "__FUNCTION__") returns the string "__[fF][uU][nN][cC][tT][iI][oO][nN]__". Not pretty, but the best solution I could come up with. So hopefully I can write a full patch to fix this issue soon.
ATM, php-mode treats all constants and superglobals as case-insensitive, i.e.
$_server
orpHp_VeRsIon
are highlighted as if the were correct, but PHP will only throw errors if you run this.From what I've gathered from the PHP documentation, only the eight magic constants are case-insensitive. All superglobals and predefined constants and the ones from core extensions are case-sensitive, and should only be highlighted if they are all caps
The text was updated successfully, but these errors were encountered: