#31626 [Opn->Fbk]: calling ereg_replace before pspell_new crashes pspell

From: Date: Thu, 20 Jan 2005 23:02:46 +0000
Subject: #31626 [Opn->Fbk]: calling ereg_replace before pspell_new crashes pspell
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72543@lists.php.net to get a copy of this message
ID: 31626 Updated by: tony2001@php.net Reported By: bram dot dejong at gmail dot com -Status: Open +Status: Feedback Bug Type: Pspell related Operating System: Windows XP PHP Version: 5.0.3 New Comment: Pay attention to double "$" here: print_r(pspell_suggest($$pspell_link, $string1)); And try again. Previous Comments: ------------------------------------------------------------------------ [2005-01-20 17:25:47] bram dot dejong at gmail dot com Description: ------------ Calling ereg_replace before pspell_new crashes pspell. pspell_new *only* fails when calling ereg_replace before it (i.e. I haven't witnessed any other crashes yet...) Pspell is installed following this guide (and all is working): http://www.oblius.com/?.blogs.184 Changes in php.ini file: extension=php_pspell.dll Reproduce code: --------------- <? $string1 = "heeelp"; $string2 = ereg_replace("squeek","squaak",$string1); $pspell_link = pspell_new("en", "", "", "", PSPELL_FAST); print_r(pspell_suggest($$pspell_link, $string1) ?> Expected result: ---------------- when I comment this line: // $string2 = ereg_replace("squeek","squaak",$string1); the result is: Array ( [0] => help [1] => Heep [2] => heel [3] => heeler [4] => heeled [5] => heels [6] => whelp [7] => helps [8] => helper [9] => harelip [10] => hep [11] => Helen [12] => hello [13] => heel's ) Actual result: -------------- Warning: pspell_new() [function.pspell-new]: PSPELL couldn't open the dictionary. reason: No word lists can be found for the language "en". in c:\Apache\htdocs\Work\bug.php on line 5 Warning: pspell_suggest() [function.pspell-suggest]: 0 is not a PSPELL result index in c:\Apache\htdocs\Work\bug.php on line 6 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31626&edit=1

« previous php.bugs (#72543) next »