#33302 [Fbk-Opn]: SQL Query in custom error handler is executed twice
ID: 33302 User updated by: a dot bendilas at zefxis dot gr Reported By: a dot bendilas at zefxis dot gr -Status: Feedback +Status: Open Bug Type: Scripting Engine problem Operating System: Win XP PHP Version: 5.0.4 New Comment: I'm afraid this didn't solve the issue. Previous Comments: [2005-06-11 15:30:04] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip [2005-06-10 16:22:38] a dot bendilas at zefxis dot gr Description: There seems to be a strange behaviour when it comes to the execution of a custom error handler.Particularly, a query is executed twice, but the rest of the code only once. Reproduce code: --- set_error_handler(user_error_handler); function user_error_handler($severity, $msg, $filename, $linenum,$content) { if ($severity E_STRICT){ return; } else{ $errorMsg ='There was an error'; echo 'test'; $link = mysql_connect('localhost', 'root', 'password'); $db_selected = mysql_select_db('db', $link); $sql = INSERT INTO Errors (ErrorMsg ,DateCreated) VALUES ( '.$errorMsg.' ,NOW() ); $results = mysql_query($sql); die; } } echo s; Expected result: The query should run once and 'test' should appear on the screen Actual result: -- The query is executed twice and 'test' appears only once on the screen -- Edit this bug report at http://bugs.php.net/?id=33302edit=1
#33302 [NEW]: SQL Query in custom error handler is executed twice
From: a dot bendilas at zefxis dot gr Operating system: Win XP PHP version: 5.0.4 PHP Bug Type: Unknown/Other Function Bug description: SQL Query in custom error handler is executed twice Description: There seems to be a strange behaviour when it comes to the execution of a custom error handler.Particularly, a query is executed twice, but the rest of the code only once. Reproduce code: --- set_error_handler(user_error_handler); function user_error_handler($severity, $msg, $filename, $linenum,$content) { if ($severity E_STRICT){ return; } else{ $errorMsg ='There was an error'; echo 'test'; $link = mysql_connect('localhost', 'root', 'password'); $db_selected = mysql_select_db('db', $link); $sql = INSERT INTO Errors (ErrorMsg ,DateCreated) VALUES ( '.$errorMsg.' ,NOW() ); $results = mysql_query($sql); die; } } echo s; Expected result: The query should run once and 'test' should appear on the screen Actual result: -- The query is executed twice and 'test' appears only once on the screen -- Edit bug report at http://bugs.php.net/?id=33302edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33302r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33302r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33302r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=33302r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=33302r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33302r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33302r=needscript Try newer version: http://bugs.php.net/fix.php?id=33302r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33302r=support Expected behavior: http://bugs.php.net/fix.php?id=33302r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33302r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33302r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=33302r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33302r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=33302r=dst IIS Stability: http://bugs.php.net/fix.php?id=33302r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33302r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33302r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33302r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33302r=mysqlcfg
#33235 [Bgs]: stripos doesn't work as expected with greek chars
ID: 33235 User updated by: a dot bendilas at zefxis dot gr Reported By: a dot bendilas at zefxis dot gr Status: Bogus Bug Type: Strings related Operating System: Windows XP PHP Version: 5.0.4 New Comment: It's a pity that it doesn't... Here's a multibyte enabled workaround for stripos: function mb_stripos($haystack, $needle, $offset = 0) { return (mb_strpos(mb_strtolower($haystack), mb_strtolower($needle),$offset)); } Previous Comments: [2005-06-03 21:28:04] [EMAIL PROTECTED] Where does it say that this function supports UTF-8 ? [2005-06-03 19:09:58] a dot bendilas at zefxis dot gr Hi sniper. First of all I'm using Firefox. Check the TXT at http://www.zefxis.gr/temp/stripos.txt Thanks! [2005-06-03 18:52:47] [EMAIL PROTECTED] It's more likely your browser sending them like that. Put them as txt file somewhere in the web or use some other browser than IE. [2005-06-03 18:02:16] a dot bendilas at zefxis dot gr Your bug submission system escaped the greek characters. Please view them unescaped to see what I mean. The first letter of the greek word is the capital Sigma in the first string, and the small Sigma in the second string. [2005-06-03 18:00:19] a dot bendilas at zefxis dot gr Description: For Greek strings stripos doesn't work case insensitively. Reproduce code: --- ?php echo stripos('#931;#954;#973;#955;#959;#962;','#963;#954;#973;#955;#959;#962;'); ? Expected result: 0 Actual result: -- false -- Edit this bug report at http://bugs.php.net/?id=33235edit=1
#33235 [NEW]: stripos doesn't work as expected
From: a dot bendilas at zefxis dot gr Operating system: Windows XP PHP version: 5.0.4 PHP Bug Type: Strings related Bug description: stripos doesn't work as expected Description: For Greek strings stripos doesn't work case insensitively. Reproduce code: --- ?php echo stripos('#931;#954;#973;#955;#959;#962;','#963;#954;#973;#955;#959;#962;'); ? Expected result: 0 Actual result: -- false -- Edit bug report at http://bugs.php.net/?id=33235edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33235r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33235r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33235r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=33235r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=33235r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33235r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33235r=needscript Try newer version: http://bugs.php.net/fix.php?id=33235r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33235r=support Expected behavior: http://bugs.php.net/fix.php?id=33235r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33235r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33235r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=33235r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33235r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=33235r=dst IIS Stability: http://bugs.php.net/fix.php?id=33235r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33235r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33235r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33235r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33235r=mysqlcfg
#33235 [Opn]: stripos doesn't work as expected
ID: 33235 User updated by: a dot bendilas at zefxis dot gr Reported By: a dot bendilas at zefxis dot gr Status: Open Bug Type: Strings related Operating System: Windows XP PHP Version: 5.0.4 New Comment: Your bug submission system escaped the greek characters. Please view them unescaped to see what I mean. The first letter of the greek word is the capital Sigma in the first string, and the small Sigma in the second string. Previous Comments: [2005-06-03 18:00:19] a dot bendilas at zefxis dot gr Description: For Greek strings stripos doesn't work case insensitively. Reproduce code: --- ?php echo stripos('#931;#954;#973;#955;#959;#962;','#963;#954;#973;#955;#959;#962;'); ? Expected result: 0 Actual result: -- false -- Edit this bug report at http://bugs.php.net/?id=33235edit=1
#33235 [Fbk-Opn]: stripos doesn't work as expected
ID: 33235 User updated by: a dot bendilas at zefxis dot gr Reported By: a dot bendilas at zefxis dot gr -Status: Feedback +Status: Open Bug Type: Strings related Operating System: Windows XP PHP Version: 5.0.4 New Comment: Hi sniper. First of all I'm using Firefox. Check the TXT at http://www.zefxis.gr/temp/stripos.txt Thanks! Previous Comments: [2005-06-03 18:52:47] [EMAIL PROTECTED] It's more likely your browser sending them like that. Put them as txt file somewhere in the web or use some other browser than IE. [2005-06-03 18:02:16] a dot bendilas at zefxis dot gr Your bug submission system escaped the greek characters. Please view them unescaped to see what I mean. The first letter of the greek word is the capital Sigma in the first string, and the small Sigma in the second string. [2005-06-03 18:00:19] a dot bendilas at zefxis dot gr Description: For Greek strings stripos doesn't work case insensitively. Reproduce code: --- ?php echo stripos('#931;#954;#973;#955;#959;#962;','#963;#954;#973;#955;#959;#962;'); ? Expected result: 0 Actual result: -- false -- Edit this bug report at http://bugs.php.net/?id=33235edit=1
#30158 [Bgs-Opn]: strpos doesn't work as it should
ID: 30158 User updated by: a dot bendilas at zefxis dot gr Reported By: a dot bendilas at zefxis dot gr -Status: Bogus +Status: Open Bug Type: Strings related Operating System: WinXP SP2 PHP Version: 4.3.8 New Comment: A note from the PHP manual on strstr: If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function strpos() instead. A warning from the PHP manual on strpos: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or . Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. As for why I'm doing a check for true, it's because '0' evaluates to false. If my original string was 'time is money' then $position would be 0: Reproduce code: --- $string = 'time is money'; $srchstring = 'time'; $position = strpos($string, $srchstring); echo 'String: '.$string.'br /'; echo 'Search string: '.$srchstring.'br /'; echo 'Position of search string: '.$position.'br /'; if ((strpos($string, $srchstring) === true)) echo 'Search string is included in the original string!'; else echo 'Search string is not included in the original string!'; Expected result: Search string is included in the original string! Actual result: -- String: time is money Search string: time Position of search string: 0 Search string is not included in the original string! Previous Comments: [2004-09-20 00:18:56] [EMAIL PROTECTED] Why are you doing a === to true? strpos is clearly documented to return a integer specifying the position in the string on a match or false on a failure. It will never return true. [2004-09-19 22:09:19] a dot bendilas at zefxis dot gr Description: Although strpos returns the position of the needle correctly, when testing the return value with a boolean operator to see if it's true, it produces the opposite result. Reproduce code: --- $string = 'Once upon a time in America'; $srchstring = 'time'; $position = strpos($string, $srchstring); echo 'String: '.$string.'br /'; echo 'Search string: '.$srchstring.'br /'; echo 'Position of search string: '.$position.'br /'; if ((strpos($string, $srchstring) === true)) echo 'Search string is included in the original string!'; else echo 'Search string is not included in the original string!'; Expected result: Search string is included in the original string! Actual result: -- Search string is not included in the original string! -- Edit this bug report at http://bugs.php.net/?id=30158edit=1
#30158 [Opn-Bgs]: strpos doesn't work as it should
ID: 30158 User updated by: a dot bendilas at zefxis dot gr Reported By: a dot bendilas at zefxis dot gr -Status: Open +Status: Bogus Bug Type: Strings related Operating System: WinXP SP2 PHP Version: 4.3.8 New Comment: Apparently the PHP manual isn't so clear on how to use the === operator. So, what it really means is that you should check for something like this: $string = 'time is money'; $srchstring = 'time'; $position = strpos($string, $srchstring); if (($position 0) || ($position === 0)) echo 'Search string is included in the original string!'; else echo 'Search string is not included in the original string!'; Previous Comments: [2004-09-20 08:53:42] a dot bendilas at zefxis dot gr A note from the PHP manual on strstr: If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function strpos() instead. A warning from the PHP manual on strpos: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or . Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. As for why I'm doing a check for true, it's because '0' evaluates to false. If my original string was 'time is money' then $position would be 0: Reproduce code: --- $string = 'time is money'; $srchstring = 'time'; $position = strpos($string, $srchstring); echo 'String: '.$string.'br /'; echo 'Search string: '.$srchstring.'br /'; echo 'Position of search string: '.$position.'br /'; if ((strpos($string, $srchstring) === true)) echo 'Search string is included in the original string!'; else echo 'Search string is not included in the original string!'; Expected result: Search string is included in the original string! Actual result: -- String: time is money Search string: time Position of search string: 0 Search string is not included in the original string! [2004-09-20 00:18:56] [EMAIL PROTECTED] Why are you doing a === to true? strpos is clearly documented to return a integer specifying the position in the string on a match or false on a failure. It will never return true. [2004-09-19 22:09:19] a dot bendilas at zefxis dot gr Description: Although strpos returns the position of the needle correctly, when testing the return value with a boolean operator to see if it's true, it produces the opposite result. Reproduce code: --- $string = 'Once upon a time in America'; $srchstring = 'time'; $position = strpos($string, $srchstring); echo 'String: '.$string.'br /'; echo 'Search string: '.$srchstring.'br /'; echo 'Position of search string: '.$position.'br /'; if ((strpos($string, $srchstring) === true)) echo 'Search string is included in the original string!'; else echo 'Search string is not included in the original string!'; Expected result: Search string is included in the original string! Actual result: -- Search string is not included in the original string! -- Edit this bug report at http://bugs.php.net/?id=30158edit=1
#30158 [NEW]: strpos doesn't work as it should
From: a dot bendilas at zefxis dot gr Operating system: WinXP SP2 PHP version: 4.3.8 PHP Bug Type: Strings related Bug description: strpos doesn't work as it should Description: Although strpos returns the position of the needle correctly, when testing the return value with a boolean operator to see if it's true, it produces the opposite result. Reproduce code: --- $string = 'Once upon a time in America'; $srchstring = 'time'; $position = strpos($string, $srchstring); echo 'String: '.$string.'br /'; echo 'Search string: '.$srchstring.'br /'; echo 'Position of search string: '.$position.'br /'; if ((strpos($string, $srchstring) === true)) echo 'Search string is included in the original string!'; else echo 'Search string is not included in the original string!'; Expected result: Search string is included in the original string! Actual result: -- Search string is not included in the original string! -- Edit bug report at http://bugs.php.net/?id=30158edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30158r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30158r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30158r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=30158r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=30158r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30158r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30158r=needscript Try newer version: http://bugs.php.net/fix.php?id=30158r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30158r=support Expected behavior: http://bugs.php.net/fix.php?id=30158r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30158r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30158r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=30158r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30158r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=30158r=dst IIS Stability: http://bugs.php.net/fix.php?id=30158r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30158r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30158r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30158r=mysqlcfg