A new evaluate
for identical operator makes its debut in PHP4. This operator makes
it possible to test the equality of the values and types of two
different variables or expressions. With implicit PHP-type
conversions, the value 5 could be compared with the string containing
the character “5.” These two values were considered equal in a
comparison. The new operator is represented by the three equal signs
(“= = =”) and sends back “TRUE” only if the variable type and value
are identical. Thus, in the following example, the four tests using
the equality operator with the numbers 1 to 4 are true. In the subsequent four, which use the evaluate for identical operator, only tests 5 and 8 are true.
|
$valint1 = $valfloat1 = $valstr3 = $res = (($valint1+$valint2)==$valint3) ? $res = $res = $res = “; $res = $res = $res = $res = |
It is worth noting that PHP4 now includes
Boolean-type data.
Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.