Syntax:$x! == $y
Where $x and $y - operands.
==! Operator:Nothing other than this it can be written as
== (! Operand), which returns true or false depending on the operands. Both operators return boolean values either true or false.
Syntax:$x ==! $y
Examples :Input: $x = true $y = false Operator: $x! == $y Output: true Operator: $x ==! $y Output: true
Example 1:This program uses both operands and returns the result.
// PHP demo program
//! == and ==! statement
// Declare variables
$x
= true;
$y
= false;
$z
= true;
// Using the operator! ==
echo
"Using! == operator"
;
// Isn’t $x equal to $y
// this is how it came back
var_dump (
$x
! ==
$y
);
// Isn’t $x equal to $z
// this is how false was returned
var_dump (
$x
! ==
$z
);
// Isn’t $y equal to $z
// this is how it came back
var_dump (
$y
! ==
$z
);
// Use ==! operator
echo
"Using ==! operator"
;
// equals $x equals (! $Y)
// this is how it came back
var_dump (
$x
==!
$y
);
// equals $x equals (! $Z)
// this is how the lie came back
var_dump (
$x
==!
$z
);
// equals $y equals (! $Z)
// this is how it came back
var_dump (
$y
==!
$z
);
?>
Exit:Using! = = operator bool (true) bool (false) bool (true) Using ==! operator bool (true) bool (false) bool (true)
Program 2: < ? php
// PHP demo program
//! == and ==! statement
// Dsclare associative array
$x
=
array
(
"1"
= >
"Geeks"
,
"2"
= >
"for"
,
"3"
= >
"Geeks"
);
$y
=
array
(
"5"
= >
"Tony"
,
"6"
= >
"Captain"
,
"7"
= >
"Thor "
);
// Combine $x and $y
$z
=
$x
+
$y
;
// Using the operator! ==
echo
"Using! == operator"
;
// Isn’t $x equal to $y
// this is how it came back
var_dump (
$x
! ==
$y
);
// Isn’t $x equal to $z
// this is how it came back
var_dump (
$x
! ==
$z
);
// Isn’t $y equal to $z
// this is how it came back
var_dump (
$y
! ==
$z
);
// Use ==! operator
echo
"Using ==! operator"
;
// equals $x equals (! $Y)
// this is how the lie came back
var_dump (
$x
==!
$y
);
// equals $x equals (! $Z)
// this is how the lie came back
var_dump (
$x
==!
$z
);
// equals $y equals (! $Z)
// this is how the lie came back
var_dump (
$y
==!
$z
);
?>
Exit:Using! = = operator bool (true) bool (true) bool (true) Using ==! operator bool (false) bool (false) bool (false)