|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-01-20 19:13 UTC] iliaa@php.net
[2003-01-21 02:32 UTC] carlos at wfmh dot org dot pl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 15:00:02 2025 UTC |
test.php: <?php $val1 = "any"; $test = array("any"=>"any", "3"=>"+3", "2"=>"+2", "1"=>"+1", "0"=>"0", "-1"=>"-1", "-2"=>"-2", "-3"=>"-3" ); foreach( $test AS $key=>$val ) printf("'%s' vs. '%s' result: %d\n", $val1, $key, ($key == $val1) ); ?> $ php test.php 'any' vs. 'any' result: 1 'any' vs. '3' result: 0 'any' vs. '2' result: 0 'any' vs. '1' result: 0 'any' vs. '0' result: 1 'any' vs. '-1' result: 0 'any' vs. '-2' result: 0 'any' vs. '-3' result: 0 $ php -v 4.2.3 Shouldn't "'any' vs. '0'" give 0 as result?