A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Waterfall_Cache has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 47

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 194

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Memcache_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 275

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Filesystem_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 440

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; APC_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 628

Evaluate for Identical Operator Page 4

Evaluate for Identical Operator Page 4

By ServerWatch Staff (Send Email)
Posted Sep 7, 2000


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 = 1;
$valint2 = 2;
$valint3 = 3;


$valfloat1 = 1.0;
$valfloat2 = 2.0;
$valfloat3 = 3.0;

$valstr3 = '3';

$res = (($valint1+$valint2)==$valint3) ? ('TRUE'):('FALSE') ;
print " TEST 1 : " . $res . "<br>\n";

$res = ($valint3==$valfloat3) ? ('TRUE') : ('FALSE') ; print " TEST 2 : " . $res . "<br>\n";

$res = ($valstr3==$valint3) ? ('TRUE') : ('FALSE') ; print " TEST 3 : " . $res . "<br>\n";

$res = (($valfloat1+$valfloat2)==$valfloat3) ? ('TRUE') : ('FALSE') ; print " TEST 4 : " . $res . "<br>\n<br>";

"; $res = (($valint1+$valint2)===$valint3) ? ('TRUE') : ('FALSE') ;
print " TEST 5 : " . $res . "<br>\n";

$res = ($valint3===$valfloat3) ? ('TRUE') : ('FALSE') ; print " TEST 6 : " . $res . "<br>\n";

$res = ($valstr3===$valint3) ? ('TRUE') : ('FALSE') ; print " TEST 7 : " . $res . "<br>\n";

$res = (($valfloat1+$valfloat2)===$valfloat3) ? ('TRUE') : ('FALSE') ; print " TEST 8 : " . $res . "<br>\n";

It is worth noting that PHP4 now includes Boolean-type data.



Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.


 

 


Thanks for your registration, follow us on our social networks to keep up-to-date