note 92880 added to function.in-array

From: Date: Wed, 12 Aug 2009 22:12:33 +0000
Subject: note 92880 added to function.in-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-159415@lists.php.net to get a copy of this message
The issue that brianko has is with type conversion, not the function. By including 0 in his array, if his match string will translate to (int) 0 then a match will be made. I think it's important to make the distinction, as the function is matching properly, there is indeed a match as long as you take into consideration the lazy typing rules of php. This can be eliminated by using the strict type matching parameter. ---- Server IP: 64.71.164.2 Probable Submitter: 65.60.87.114 ---- Manual Page -- http://www.php.net/manual/en/function.in-array.php Edit -- https://master.php.net/note/edit/92880 Del: integrated -- https://master.php.net/note/delete/92880/integrated Del: useless -- https://master.php.net/note/delete/92880/useless Del: bad code -- https://master.php.net/note/delete/92880/bad+code Del: spam -- https://master.php.net/note/delete/92880/spam Del: non-english -- https://master.php.net/note/delete/92880/non-english Del: in docs -- https://master.php.net/note/delete/92880/in+docs Del: other reasons-- https://master.php.net/note/delete/92880 Reject -- https://master.php.net/note/reject/92880 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#159415) next »