note 38704 added to language.operators.comparison

From: Date: Sat, 03 Jan 2004 21:15:59 +0000
Subject: note 38704 added to language.operators.comparison
Groups: php.notes 
Request: Send a blank email to php-notes+get-62878@lists.php.net to get a copy of this message
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' ). ---- Manual Page -- http://www.php.net/manual/en/language.operators.comparison.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38704 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38704&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38704&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#62878) next »