Today I answered a question that had a simple solution, but I still did not understand why it was something for which the PHP interpreter doesnβt throw a syntax error. Therefore, my question is simple:
Why is there a valid syntax in the statements below?
SomeIdentifier:; AnythingGoesApparently:; ThisCanGoOnAndOn:;
Moreover, these identifiers are not defined anywhere.
As far as I know, a colon : used only as part of two operators: The scope resolution operator , the Turner operator , but not by itself. It is also used in alternative syntax for control structures . But in this case, none of them will qualify, so this undermines me as a madman.
source share