What does the following code do? A link to something in the PHP manual would also be nice.
if ($_SERVER['SERVER_PORT'] <> 443) { doSomething(); }
The spaceship operator <=> is the latest comparison operator added in PHP 7. It is a non-associative binary operator with the same precedence as equality operators ( == , !=
The object operator, -> , is used in object scope to access methods and properties of an object. It's meaning is to say that what is on the right of the operator is a member of the object instantiated into the variable on the left side of the operator.
Introduction to PHP not equal. One of the comparison operators in PHP is not equal, which is represented by the symbol != or <> and whenever we want to compare the data types of the two given values, we make use of not equal operator in PHP.
What is -> in PHP? This is referred to as the object operator, or sometimes the single arrow operator. It is an access operator used for access/call methods and properties in a PHP object in Object-Oriented Programming (OOP). Example.
Same as !=, "Not equal"
false <> true // operator will evaluate expression as true false != true // operator will evaluate expression as true
Here is some reference: PHP Comparison Operators
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With