Oops, no-perator found. Have a joke instead.
arithmetic
bitwise
null coalescing
comparison
$a <=> $b
Spaceship operator
Returns 0
if the values both sides equal, 1
if the value to the left is greater, -1
if the value to the right is greater. The spaceship operator does a loose check on values.
Tags
Related
{
selectOperator(operator.slug);
search = '';
}">
{
selectOperator(operator.slug);
search = '';
}" href="/operators/ternary">$a ? $b : $c {
selectOperator(operator.slug);
search = '';
}" href="/operators/less-than">$a < $b {
selectOperator(operator.slug);
search = '';
}" href="/operators/greater-than">$a > $b {
selectOperator(operator.slug);
search = '';
}" href="/operators/loose-equality">$a == $b
1 <=> 1; // 0
2 <=> 1; // 1
1 <=> 2; // -1
logical
strings
What is this? Who are you!?
PHP Operators is a reference guide for operators old and new in the PHP programming language. We're SPATIE, a web development agency from Belgium. Besides client work we like to contribute to the open source community and make fun projects like this one.