Skip to content
Advertisement

Difference between “not equal” operators and != in PHP

In PHP, is there any difference between the != and <> operators?

In the manual, it states:

JavaScript

I guess there are no huge differences but I’m curious.

Advertisement

Answer

In the main Zend implementation there is not any difference. You can get it from the Flex description of the PHP language scanner:

JavaScript

Where T_IS_NOT_EQUAL is the generated token. So the Bison parser does not distinguish between <> and != tokens and treats them equally:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement