This is tested against PHP 7.4 I’m trying to understand why the first example does not return ‘hello’ like the other two. Example 3 is the same thing as example 1 except the ternary is encapsulated in parentheses but for some reason the presence of the parentheses on example 3 give the expected result. Example 2 is the same as
Tag: operator-precedence
PHP: Regex match string not preceeded by a dollar sign
In my syntax highlighter, I use regex to parse different terms. Below is how I parse PHP classes: Now, just ignore the PHP class and the _getHtmlCode function. The regex, “/b{$class}b/”, matches names such as count. If I make a variable named $count, it matches that was well. How can I look for class names that are not preceded by