I don’t consider myself as PHP expert but I’ve designed several pages now containing a couple of thousand lines of code each. For my current project which is for a game site I drew back on an existing function which contains the line
$M–;
Now my basic understanding of PHP tells me this doesn’t work since it should be — for short -1. But it’s not a dash, the script runs without error (error_reporting (E_ALL)) but echoing $M before and after gives me the same value.
So what does it do and why don’t I get an error?
That’s an en dash, which to PHP is just a random byte without specific meaning.
$M–, or in UTF-8 encoding4DE28093, is a valid variable name. Just like$漢字.A single variable by itself just initializes that variable tothe line doesn’t do anythingnullif it doesn’t already exist,else.