#35427 [Fbk->Opn]: str_word_count handles '-' incorrectly

From: Date: Sun, 27 Nov 2005 19:00:55 +0000
Subject: #35427 [Fbk->Opn]: str_word_count handles '-' incorrectly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89110@lists.php.net to get a copy of this message
ID: 35427 User updated by: tomas_matousek at hotmail dot com Reported By: tomas_matousek at hotmail dot com -Status: Feedback +Status: Open Bug Type: Strings related Operating System: WinXP PHP Version: 5.1.0 New Comment: By passing "0" as the third parameter, one declares '0' character legal word character which should be equivalent to any other letter, e.g. 'x'. "bar-xbar" is considered to be a word so "bar-0bar" should be word as well. Previous Comments: ------------------------------------------------------------------------ [2005-11-27 19:28:44] tony2001@php.net "bar-0var" doesn't look like a valid *WORD* to me. Or is it? ------------------------------------------------------------------------ [2005-11-27 19:12:17] tomas_matousek at hotmail dot com Description: ------------ Characters specified in str_word_count() should be treated equally to letters, right? This works for apostrophe but doesn't for hyphen. Reproduce code: --------------- var_dump(str_word_count("foo'0 bar-0var", 2, "0")); Expected result: ---------------- array(3) { [0]=> string(5) "foo'0" [6]=> string(3) "bar0var" } Actual result: -------------- array(3) { [0]=> string(5) "foo'0" [6]=> string(3) "bar" [10]=> string(4) "0var" } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35427&edit=1

« previous php.bugs (#89110) next »