note 38704 deleted from language.operators.comparison by felipe
| From: | felipe@php.net | Date: | Tue, 22 Jul 2008 19:08:13 +0000 |
| Subject: | note 38704 deleted from language.operators.comparison by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142552@lists.php.net to get a copy of this message | ||
Note Submitter: gphemsley at users dot sourceforge dot net
----
For those of you who need to use === with PHP 3, this should do the trick:
<?php
function is_identical( $left, $right )
{
if( phpversion() >= 4 )
{
return ( $left === $right );
}
else
{
if( ( $left == $right ) && ( gettype( $left ) == gettype( $right ) ) )
{
return TRUE;
}
else
{
return FALSE;
}
}
}
?>
1 === '1' is the same as is_identical( 1, '1' ).