#25909 [Opn->Bgs]: strpos

From: Date: Sun, 19 Oct 2003 11:50:16 +0000
Subject: #25909 [Opn->Bgs]: strpos
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-49195@lists.php.net to get a copy of this message
ID: 25909 Updated by: sniper@php.net Reported By: zygimantas at skylords dot com -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: RH7 PHP Version: 4.3.2 New Comment: The function works properly when it returns 'false' as the haystack string does not contain string 'word3' in it. Hint: Array indices start from 0 (zero). Previous Comments: ------------------------------------------------------------------------ [2003-10-19 06:29:54] zygimantas at skylords dot com Description: ------------ strpos fails when array is used as needle. Reproduce code: --------------- $i = 2; $str_word = 'sentence with word2'; $arr_letters = array('word1', 'word2', 'word3'); echo strpos($str_word, $arr_letters[$i]); Expected result: ---------------- null ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25909&edit=1

« previous php.bugs (#49195) next »