Req #55542 [Asn->]: SNMP class should use Exceptions instead of PHP Errors
Edit report at https://bugs.php.net/bug.php?id=55542&edit=1 ID: 55542 Updated by: lytbo...@php.net Reported by:c...@php.net Summary:SNMP class should use Exceptions instead of PHP Errors -Status: Assigned +Status: To be documented Type: Feature/Change Request Package:SNMP related PHP Version:5.4.0alpha3 Assigned To:lytboris Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. A new SNMP object property is introduced: exceptions_enabled. Setting this property to ORed combination of SNMP::ERRNO_* errors will enable exception throwing on these errors. SNMP::ERRNO_ANY may be used to enable all posslible SNMP::ERRNO_* errors at once. Previous Comments: [2011-09-02 10:13:19] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316032 Log: merge from trunk added SNMPException class, enabling ability to throw exceptions when a known SNMP error has occured FR #55542 [2011-09-02 10:04:08] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316029 Log: added SNMPException class, enabling ability to throw exceptions when a known SNMP error has occured FR #55542 [2011-08-30 22:15:06] c...@php.net Description: Hello Subject says all, IMHO it does not make sense to start writing a new class that does not use 100% exceptions. This bug is a follow up on #40816 which ended with: [2011-08-30 15:18 UTC] lytbo...@php.net > I have read a bunch of threads on php-dev about extensions throwing > exceptions and the last thing I remember that extension should not throw any > exception except object creation if there is no way to disable them. > Anyway, if to throw exceptions, library will throw an exception for each > error, not only parsing error. Please, please, convinced yourself that Exceptions are cool and worth refactoring the code. I'd be willing to help with writing tests :) I'd be curious about the threads you mentioned (a quick google found nothing but then the keywords are very common) but there are already some extensions (spl/php_spl.c, mysql/php_mysql.c, reflection/php_reflection.c) that do throw Exceptions. -- Edit this bug report at https://bugs.php.net/bug.php?id=55542&edit=1
Bug #49922 [Com]: destroy_op_array refcount invalid ptr / apache filter sapi
Edit report at https://bugs.php.net/bug.php?id=49922&edit=1 ID: 49922 Comment by: rojaro at gmail dot com Reported by:m dot moeller at bigpoint dot net Summary:destroy_op_array refcount invalid ptr / apache filter sapi Status: Bogus Type: Bug Package:Reproducible crash Operating System: * PHP Version:5.2.11 Block user comment: N Private report: N New Comment: This bug is still present (5.3.8) ... :( Previous Comments: [2009-11-30 10:18:37] m dot moeller at bigpoint dot net same error with php version 5.2.11 [2009-10-19 16:50:46] j...@php.net Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. [2009-10-19 16:12:43] m dot moeller at bigpoint dot net Description: if apache receives a shutdown signal, php occasionally triggers a segfault. #2 0x7f5c4ea35268 in destroy_op_array (op_array=0x1670790) at /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_opcode.c:230 #3 0x7f5c4ea49488 in zend_hash_destroy (ht=0x14b8910) at /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_hash.c:717 #4 0x7f5c4ea3eb3a in zend_shutdown () at /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend.c:816 #5 0x7f5c4e9f8975 in php_module_shutdown () at /tmp/buildd/php5-5.2.6.dfsg.1/main/main.c:1908 #6 0x7f5c4e9f8a19 in php_module_shutdown_wrapper (sapi_globals=0x0) at /tmp/buildd/php5-5.2.6.dfsg.1/main/main.c:1879 #7 0x7f5c4eab2a21 in php_apache_child_shutdown (tmp=0x0) at /tmp/buildd/php5-5.2.6.dfsg.1/sapi/apache2handler/sapi_apache2.c:362 #8 0x7f5c55e31a5c in ?? () from /usr/lib/libapr-1.so.0 #9 0x7f5c55e30ca3 in apr_pool_destroy () from /usr/lib/libapr-1.so.0 #10 0x0044d8de in clean_child_exit (code=0) at /build/buildd-apache2_2.2.9-10+lenny4-amd64-wTiRUQ/apache2-2.2.9/server/mpm/prefork/prefork.c:198 #11 0x0044e00b in just_die (sig=) at /build/buildd-apache2_2.2.9-10+lenny4-amd64-wTiRUQ/apache2-2.2.9/server/mpm/prefork/prefork.c:330 #12 #2 0x7f5c4ea35268 in destroy_op_array (op_array=0x1670790) at /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_opcode.c:230 230 /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_opcode.c: No such file or directory. in /tmp/buildd/php5-5.2.6.dfsg.1/Zend/zend_opcode.c (gdb) print op_array->refcount $1 = (zend_uint *) 0x7f5c4cbdb908 (gdb) print *op_array->refcount Cannot access memory at address 0x7f5c4cbdb908 Reproduce code: --- while true; do curl http://localhost/testpage.php & apachectl restart done Expected result: clear error log Actual result: -- segfault -- Edit this bug report at https://bugs.php.net/bug.php?id=49922&edit=1
Req #55542 [->Opn]: SNMP class should use Exceptions instead of PHP Errors
Edit report at https://bugs.php.net/bug.php?id=55542&edit=1 ID: 55542 Updated by: c...@php.net Reported by:c...@php.net Summary:SNMP class should use Exceptions instead of PHP Errors -Status: To be documented +Status: Open Type: Feature/Change Request Package:SNMP related PHP Version:5.4.0alpha3 Assigned To:lytboris Block user comment: N Private report: N New Comment: Thanks for implementing this so quickly. But the constructor still says: "snmp_object->exceptions_enabled = 0;", as this is a class one would rather expect OOP style exceptions as default, or? Previous Comments: [2011-09-02 10:13:21] lytbo...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. A new SNMP object property is introduced: exceptions_enabled. Setting this property to ORed combination of SNMP::ERRNO_* errors will enable exception throwing on these errors. SNMP::ERRNO_ANY may be used to enable all posslible SNMP::ERRNO_* errors at once. [2011-09-02 10:13:19] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316032 Log: merge from trunk added SNMPException class, enabling ability to throw exceptions when a known SNMP error has occured FR #55542 [2011-09-02 10:04:08] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316029 Log: added SNMPException class, enabling ability to throw exceptions when a known SNMP error has occured FR #55542 [2011-08-30 22:15:06] c...@php.net Description: Hello Subject says all, IMHO it does not make sense to start writing a new class that does not use 100% exceptions. This bug is a follow up on #40816 which ended with: [2011-08-30 15:18 UTC] lytbo...@php.net > I have read a bunch of threads on php-dev about extensions throwing > exceptions and the last thing I remember that extension should not throw any > exception except object creation if there is no way to disable them. > Anyway, if to throw exceptions, library will throw an exception for each > error, not only parsing error. Please, please, convinced yourself that Exceptions are cool and worth refactoring the code. I'd be willing to help with writing tests :) I'd be curious about the threads you mentioned (a quick google found nothing but then the keywords are very common) but there are already some extensions (spl/php_spl.c, mysql/php_mysql.c, reflection/php_reflection.c) that do throw Exceptions. -- Edit this bug report at https://bugs.php.net/bug.php?id=55542&edit=1
Bug #55560 [Csd]: filter_var($e, FILTER_VALIDATE_EMAIL) won't validate spaces in quoted strings
Edit report at https://bugs.php.net/bug.php?id=55560&edit=1 ID: 55560 User updated by:fredgandt at hotmail dot com Reported by:fredgandt at hotmail dot com Summary:filter_var($e, FILTER_VALIDATE_EMAIL) won't validate spaces in quoted strings Status: Closed Type: Bug Package:Mail related Operating System: Windows XP (SP3) PHP Version:5.3SVN-2011-09-01 (SVN) Block user comment: N Private report: N New Comment: It seems that the function and filter work perfectly in all cases. It was my misunderstanding of the regulations that was at fault. I have edited Wikipedia to show what is correct (never read so many regulations in my life!) and hope you'll forgive my rush to accuse. My intentions were to help not hinder. Yours, Fred Gandt. Previous Comments: [2011-09-01 18:24:15] fredgandt at hotmail dot com I reread and read some extra, edited and re-edited Wikipedia and now have to suggest reopening this bug report. It seems I was right in the first place: Quoted strings containing spaces should validate (return true). See: http://tools.ietf.org/html/rfc3696#section-3 for confirmation. \ \ \ \ @example.com FALSE incorrect since spaces can exist as slashed doublets "abc def"@example.com FALSE incorrect abc"123@456"x...@example.com FALSE cannot find regulation stating that it should be invalid. abc"123 456"x...@example.com FLASE also should be valid (it seems) abc"123"x...@example.com FALSE also, so not a space issue but that the quotes are not outermost of the local-part abc123xyz@example.c TRUE incorrect @example.com FALSE incorrect since backslash can quote itself this should be accepted I think there are a few problems need addressing (pun intended). [2011-09-01 12:04:32] fredgandt at hotmail dot com Really sorry. RFC is hard to read so I relied on Wikipedia (usually very good with this kind of thing). Spaces aren't ever allowed. Not even within quotes. Going to edit Wikipedia now instead of waste your time. Forgive? ;-) [2011-09-01 11:38:43] fredgandt at hotmail dot com Description: --- >From manual page: http://www.php.net/filter.filters.validate --- IMPORTANT: I am a learner. Sorry if I am wasting your time. Also GoDaddy don't supply much in the way of detail about what version is running. All I know is that it is 5.3.? I have asked for the rest but am still waiting. Using filter_var($e, FILTER_VALIDATE_EMAIL) where $e is a submitted email address that according to RFC 5321 and Wikipedias clearer to understand interpretation of it should be considered valid, the return can be invalid where spaces are featured within quoted strings. e.g. A-Za-z0-9."?Oooh![what]{fun}|is|!".gladthisisn'tmyaddress@[32.64.128.1] == valid (impressive) "Fred Gandt"@fredgandt.com == invalid Take the space out and "FredGandt"@fredgandt.com == valid I've tested all the most unusual combinations I can think of and FILTER_VALIDATE_EMAIL seems to only fail with spaces being disallowed outright rather than only being disallowed when not enclosed by quotes (as with other otherwise disallowed chars). If my interpretation of RFC 5321 is wrong and spaces are in fact never allowed (even when enclosed by quotes) please forgive my impertinence. Love PHP. Very slick and user friendlyness abounds! Test script: --- Valid Email Address");} else{echo($e."Invalid Email Address");} ?> Expected result: Test script provides form entry field "input type="text"" Fill in "textbox" with email address having a local-part with a quoted string containing spaces. e.g. "Fred Gandt"@fredgandt.com Submit EXPECT: Return (echo) == Valid Actual result: -- OBSERVE: Return (echo) == Invalid -- Edit this bug report at https://bugs.php.net/bug.php?id=55560&edit=1
Bug #55558 [Opn->Wfx]: MySQL returns incorrect error message for test
Edit report at https://bugs.php.net/bug.php?id=8&edit=1 ID: 8 Updated by: u...@php.net Reported by:simon at welsh dot co dot nz Summary:MySQL returns incorrect error message for test -Status: Open +Status: Wont fix Type: Bug Package:MySQL related Operating System: Mac OS 10.7 PHP Version:5.4SVN-2011-08-31 (SVN) Block user comment: N Private report: N New Comment: This is a MySQL server bug. Update to MySQL 5.5.15 and it's gone. If the test was not that strict, this MySQL server bug had never been found. Previous Comments: [2011-08-31 22:06:09] simon at welsh dot co dot nz Description: With MySQL 5.5.10-log (64 bit package, downloaded from mysql.com), if the user does not exist when connecting to the database, the error message returned is: Access denied for user 'rootunknown_real'@'localhost' (using password: NO) even when a password is supplied. This breaks both mysql_connect.phpt and mysql_pconnect.phpt in 5.4, as they are expecting the result to be (using password: YES). This also happens when running mysql from the command line, so the test should work around it. If the two test cases my patch changes should be testing for YES, instead of just an error, then change the connect/pconnect call to use $user rather than $user . 'unkown_real' -- Edit this bug report at https://bugs.php.net/bug.php?id=8&edit=1
Bug #55283 [Ver]: SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections
Edit report at https://bugs.php.net/bug.php?id=55283&edit=1 ID: 55283 Updated by: u...@php.net Reported by:aleksey at wepay dot com Summary:SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections Status: Verified Type: Bug Package:MySQLi related Operating System: Cent OS PHP Version:5.3.6 Assigned To:mysql Block user comment: N Private report: N New Comment: PHP 5.4 beta is scheduled for next week. Is anybody working on fixing the underlying PHP Streams issue not only with 5.3 but also 5.4? Previous Comments: [2011-08-22 21:31:56] johan...@php.net Automatic comment from SVN on behalf of johannes Revision: http://svn.php.net/viewvc/?view=revision&revision=315310 Log: - Revert r313616 (When we have a blocking SSL socket, respect the timeout option, scottmac) # This caused bug #55283, we should investigate a proper solution without # breaking anything. [2011-08-18 07:55:45] paj...@php.net You can try in German then as you both speak German as well. However it looks to me that the code speaks for itself. The connection fails after the timeout. This comment is based on this discussion on internals, http://news.php.net/php.internals/54667 . [2011-08-18 07:51:51] and...@php.net English is neither my mother tongue. [2011-08-18 07:17:15] spam2 at rhsoft dot net what try you to tell me with "I don't get your comment :(" remember that not everfybody has english as nmative language i need a way to revert this change to get PHP 5.3.7 working with mysqlnd/ssl the same way as it did the whole last year [2011-08-18 06:08:55] and...@php.net I don't get your comment :( The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55283 -- Edit this bug report at https://bugs.php.net/bug.php?id=55283&edit=1
Bug #40479 [Com]: zend_mm_heap corrupted
Edit report at https://bugs.php.net/bug.php?id=40479&edit=1 ID: 40479 Comment by: christoffer at westart dot se Reported by:rrossi at maggioli dot it Summary:zend_mm_heap corrupted Status: Feedback Type: Bug Package:Reproducible crash Operating System: Suse Linux 9.0 PHP Version:5.2.1 Block user comment: N Private report: N New Comment: I must agree with Florin, we are experiencing the same kinds of issues, both with CLI and mod_php, su_php and across 5.2.* and 5.3.*. We really need this to be fixed. Any updates? Previous Comments: [2011-08-31 07:49:32] f dot ardelian at gmail dot com The cause is pretty clear to me: when the script ends, the garbage collector starts to destroy the objects and the `unset()` in the destructor probably invokes the garbage collector again. The error message doesn't always appear on the screen nor in the error log (sometimes it does). The "Segmentation fault" always appears in the error log. Breaks if PHP is installed using apt-get or yum or comes with your Linux distro. Seems to work fine on Windows and codepads (custom compiled PHPs). Definitely breaks on Debian. Don't forget to set memory_limit to have enough room in memory to create all the objects (128M seems to be enough on Debian to create 150,000 objects). _guid = self::$maxGuid++] = $this; } public function __destruct() { unset(self::$world[$this->_guid]); } } for ($i = 0; $i < OBJECT_COUNT; ++$i) { new Object(); } // You probably won't see this because of the "zend_mm_heap corrupted" echo 'If you see this, try to increase OBJECT_COUNT to 100,000'; ?> If this code pinpoints the four and a half years-old issue, email me a beer. Florin Ardelian [2010-10-16 00:06:47] fel...@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with , is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. [2010-09-16 13:23:05] michael202 at gmx dot de The problem is still in 5.3.3 on Suse 11.2, but it is not reproducible :-( Sometimes it is twice a day sometimes every few days. Apache starts giving these messages: "child pid x exit signal Segmentation fault (11)" And if your are lucky, the scripts still return xml-results. If you get a no result from the script (i.a. white page in browser), you'll need a apache stop and start (graceful does not help) and the error_log says: "seg fault or similar nasty error detected in the parent process" [2010-08-09 10:32:10] sht dot alien at gmx dot net I had it coming when I started my unittests. But it happened out of nowhere ^^ Wehen I set USE_ZEND_ALLOC=0 it didn't go away, but instead I got a debug backtrace (as seen below). But I came up with a solution: ZendDebugger was the root of all evil. I'll check out if there's a newer version available... FAILURES! Tests: 284, Assertions: 1911, Errors: 4, Incomplete: 10, Skipped: 9. *** glibc detected *** /usr/local/zend/bin/php: free(): invalid pointer: 0x035b5a8f *** === Backtrace: = /lib/libc.so.6(+0x775b6)[0x7f56f13105b6] /lib/libc.so.6(cfree+0x73)[0x7f56f1316e53] /usr/local/zend/bin/php(zend_hash_destroy+0x7b)[0x656b7b] /usr/local/zend/bin/php(destroy_zend_class+0x55)[0x641845] /usr/local/zend/bin/php[0x656822] /usr/local/zend/bin/php(zend_hash_reverse_apply+0x59)[0x656929] /usr/local/zend/bin/php[0x63e486] /usr/local/zend/bin/php[0x64a8b2] /usr/local/zend/bin/php(php_request_shutdown+0x1ae)[0x5f9cce] /usr/local/zend/bin/php[0x6d2be4] /lib/libc.so.6(__libc_start_main+0xfd)[0x7f56f12b7c4d] /usr/local/zend/bin/php[0x45ffaa] === Memory map: 0040-009d8000 r-xp 08:01 12588460 /usr/local/zend/bin/php 00ad8000-00b5f000 rwxp 005d8000 08:01 12588460 /usr/local/zend/bin/php 00b5f000-00b7f000 rwxp 00:00 0 02b4e000-04999000 rwxp 00:00 0 [heap] 7f56e000-7f56e0021000 rwxp 00:00 0 7f56e0021000-7f56e400 ---p 00:00 0 7f56e5309000-7f56e530e000 r-xp 08:01 15842 /lib/libnss_dns-2.11.1.so 7f56e530e000-7f56e550d000 ---p 5000 08:01 15842 /lib/libnss_dns-2.11.1.so 7f56e550d000-7f56e550e000 r-xp 4000 08:01 15842
Bug #53727 [Com]: Inconsistent behavior of is_subclass_of with interfaces
Edit report at https://bugs.php.net/bug.php?id=53727&edit=1 ID: 53727 Comment by: jbondc at openmv dot com Reported by:mattknight at xymail dot co dot uk Summary:Inconsistent behavior of is_subclass_of with interfaces Status: Closed Type: Bug Package:Class/Object related Operating System: Gentoo x86_64 PHP Version:5.3.5 Assigned To:dmitry Block user comment: N Private report: N New Comment: This patch also modifies the is_a() api by allowing a string as a first argument. That seems wrong to me within the 5.3 branch. Previous Comments: [2011-07-15 15:17:18] phi...@php.net Automatic comment from SVN on behalf of philip Revision: http://svn.php.net/viewvc/?view=revision&revision=313271 Log: Updated is_a() and is_subclass_of() tests as per the removed E_WARNING from r313162 which was inspired by discussion after r312904 and PHP Bug #53727 [2011-07-04 11:00:53] dmi...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. [2011-07-04 10:55:39] dmi...@php.net Automatic comment from SVN on behalf of dmitry Revision: http://svn.php.net/viewvc/?view=revision&revision=312904 Log: Fixed bug #53727 (Inconsistent behavior of is_subclass_of with interfaces) [2011-06-30 18:45:09] ralph at smashlabs dot com Dmitry, The patch called fix-is_subclass_of-PHP_5_3.diff does the following: * Alters the existing Zend/tests/is_a.phpt to alter the bad expectation, * Adds a new test file for is_subclass_of() as Zend/tests/is_subclass_of.phpt * Finally alters is_a_impl() in the following ways: * If an object was provided as the first parameter, and we are inside of an is_subclass_of call (known by the flag only_subclass), then assign the class entry of the object * Next, determine if the instance_ce provided is the same class entry as that we are testing against (parameter 2 of the is_subclass_of() call ... if it is, return false * Now that we know the instance_ce is not the same as the class entry for the test class, allow is_a_impl to pass these class entries to instanceof_function, and return that value It is pretty straight forward, and any way I look at it, there are few consequences to this patch. Thanks, Ralph [2011-01-13 09:13:50] mattknight at xymail dot co dot uk Yes, it would also be fine to return false when comparing against an ancestral interface, just so long as the behaviour is consistent. Expected result: false true false true The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=53727 -- Edit this bug report at https://bugs.php.net/bug.php?id=53727&edit=1
Bug #55536 [Opn->Bgs]: MySQLi fetch corrupting bound variables
Edit report at https://bugs.php.net/bug.php?id=55536&edit=1 ID: 55536 Updated by: u...@php.net Reported by:taopixdev at yahoo dot co dot uk Summary:MySQLi fetch corrupting bound variables -Status: Open +Status: Bogus Type: Bug Package:MySQLi related PHP Version:Irrelevant Block user comment: N Private report: N New Comment: I think the current behavior - setting bound result variables to NULL - OK . Bound columns are explicitly mentioned as being modified when running a prepared statement: "Binds columns in the result set to variables. When mysqli_stmt_fetch() is called to fetch data, the MySQL client/server protocol places the data for the bound columns into the specified variables var1, ", http://de2.php.net/manual/en/mysqli-stmt.bind-result.php It is secondary if there is a result set or not. What's relevant in the above is the fact that bound columns are set. Setting to NULL in case of no result set makes perfectly sense. It means "setting" (as documented) and setting to "undefined" (because of no result set). Previous Comments: [2011-08-30 10:31:05] taopixdev at yahoo dot co dot uk Description: I have tested this in different versions of PHP and it seems to be a bug from version 5.3.0 onwards. It seems that from PHP version 5.3.0 onwards that when a MySQL select statement returns zero rows the bind result variable is being overwritten and set to a null value. In the example attached to this post I initialize a variable called $recordID and set it to 0; In versions of PHP prior to version 5.3.0 after the fetch has ran the $recordID would still be set to 0 when zero rows are returned. However from versions 5.3.0 onwards the $recordID variable is overwritten and set to null. Test script: --- prepare('SELECT `id`, `name` FROM MYTABLE WHERE id = ?) { if ($stmt->bind_param('i', $pID)) { if ($stmt->bind_result($recordID, $name) { if ($stmt->execute()) { $stmt->fetch(); } } } } ?> Expected result: In versions of PHP prior to version 5.3.0 after the fetch has ran the $recordID would still be set to 0 when zero rows are returned. Actual result: -- >From versions 5.3.0 onwards the $recordID variable is overwritten and set to >null. -- Edit this bug report at https://bugs.php.net/bug.php?id=55536&edit=1
Req #55542 [Asn]: SNMP class should use Exceptions instead of PHP Errors
Edit report at https://bugs.php.net/bug.php?id=55542&edit=1 ID: 55542 Updated by: lytbo...@php.net Reported by:c...@php.net Summary:SNMP class should use Exceptions instead of PHP Errors Status: Assigned Type: Feature/Change Request Package:SNMP related PHP Version:5.4.0alpha3 Assigned To:lytboris Block user comment: N Private report: N New Comment: enable SNMP::ERRNO_ANY by default is not a good idea I think. PDO has the same default behavior for throwing exceptions. Previous Comments: [2011-09-02 10:41:20] c...@php.net Thanks for implementing this so quickly. But the constructor still says: "snmp_object->exceptions_enabled = 0;", as this is a class one would rather expect OOP style exceptions as default, or? [2011-09-02 10:13:21] lytbo...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. A new SNMP object property is introduced: exceptions_enabled. Setting this property to ORed combination of SNMP::ERRNO_* errors will enable exception throwing on these errors. SNMP::ERRNO_ANY may be used to enable all posslible SNMP::ERRNO_* errors at once. [2011-09-02 10:13:19] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316032 Log: merge from trunk added SNMPException class, enabling ability to throw exceptions when a known SNMP error has occured FR #55542 [2011-09-02 10:04:08] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316029 Log: added SNMPException class, enabling ability to throw exceptions when a known SNMP error has occured FR #55542 [2011-08-30 22:15:06] c...@php.net Description: Hello Subject says all, IMHO it does not make sense to start writing a new class that does not use 100% exceptions. This bug is a follow up on #40816 which ended with: [2011-08-30 15:18 UTC] lytbo...@php.net > I have read a bunch of threads on php-dev about extensions throwing > exceptions and the last thing I remember that extension should not throw any > exception except object creation if there is no way to disable them. > Anyway, if to throw exceptions, library will throw an exception for each > error, not only parsing error. Please, please, convinced yourself that Exceptions are cool and worth refactoring the code. I'd be willing to help with writing tests :) I'd be curious about the threads you mentioned (a quick google found nothing but then the keywords are very common) but there are already some extensions (spl/php_spl.c, mysql/php_mysql.c, reflection/php_reflection.c) that do throw Exceptions. -- Edit this bug report at https://bugs.php.net/bug.php?id=55542&edit=1
Req #55542 [Asn]: SNMP class should use Exceptions instead of PHP Errors
Edit report at https://bugs.php.net/bug.php?id=55542&edit=1 ID: 55542 Updated by: c...@php.net Reported by:c...@php.net Summary:SNMP class should use Exceptions instead of PHP Errors Status: Assigned Type: Feature/Change Request Package:SNMP related PHP Version:5.4.0alpha3 Assigned To:lytboris Block user comment: N Private report: N New Comment: But PDO has a history back to PHP4 or the days where people where used to check every single return value for PEAR_Error. The SNMP class is new and could lead as good example for proper OOP style! (Or do you prefer C style $errno checking after every method call over try/catch statements? The chances that an error goes unnoticed is much lower with exceptions.) Previous Comments: [2011-09-02 11:48:34] lytbo...@php.net enable SNMP::ERRNO_ANY by default is not a good idea I think. PDO has the same default behavior for throwing exceptions. [2011-09-02 10:41:20] c...@php.net Thanks for implementing this so quickly. But the constructor still says: "snmp_object->exceptions_enabled = 0;", as this is a class one would rather expect OOP style exceptions as default, or? [2011-09-02 10:13:21] lytbo...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. A new SNMP object property is introduced: exceptions_enabled. Setting this property to ORed combination of SNMP::ERRNO_* errors will enable exception throwing on these errors. SNMP::ERRNO_ANY may be used to enable all posslible SNMP::ERRNO_* errors at once. [2011-09-02 10:13:19] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316032 Log: merge from trunk added SNMPException class, enabling ability to throw exceptions when a known SNMP error has occured FR #55542 [2011-09-02 10:04:08] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316029 Log: added SNMPException class, enabling ability to throw exceptions when a known SNMP error has occured FR #55542 The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55542 -- Edit this bug report at https://bugs.php.net/bug.php?id=55542&edit=1
Bug #55283 [Ver->Asn]: SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections
Edit report at https://bugs.php.net/bug.php?id=55283&edit=1 ID: 55283 Updated by: johan...@php.net Reported by:aleksey at wepay dot com Summary:SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections -Status: Verified +Status: Assigned Type: Bug Package:MySQLi related Operating System: Cent OS PHP Version:5.3.6 -Assigned To:mysql +Assigned To:scottmac Block user comment: N Private report: N New Comment: Scott, can you check how we can fix both things - SSL timeout while having mysqlnd SSL working? We're happy to help on the MySQL side ... Thanks! Previous Comments: [2011-09-02 11:22:37] u...@php.net PHP 5.4 beta is scheduled for next week. Is anybody working on fixing the underlying PHP Streams issue not only with 5.3 but also 5.4? [2011-08-22 21:31:56] johan...@php.net Automatic comment from SVN on behalf of johannes Revision: http://svn.php.net/viewvc/?view=revision&revision=315310 Log: - Revert r313616 (When we have a blocking SSL socket, respect the timeout option, scottmac) # This caused bug #55283, we should investigate a proper solution without # breaking anything. [2011-08-18 07:55:45] paj...@php.net You can try in German then as you both speak German as well. However it looks to me that the code speaks for itself. The connection fails after the timeout. This comment is based on this discussion on internals, http://news.php.net/php.internals/54667 . [2011-08-18 07:51:51] and...@php.net English is neither my mother tongue. [2011-08-18 07:17:15] spam2 at rhsoft dot net what try you to tell me with "I don't get your comment :(" remember that not everfybody has english as nmative language i need a way to revert this change to get PHP 5.3.7 working with mysqlnd/ssl the same way as it did the whole last year The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55283 -- Edit this bug report at https://bugs.php.net/bug.php?id=55283&edit=1
Bug #55283 [Com]: SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections
Edit report at https://bugs.php.net/bug.php?id=55283&edit=1 ID: 55283 Comment by: spam2 at rhsoft dot net Reported by:aleksey at wepay dot com Summary:SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections Status: Assigned Type: Bug Package:MySQLi related Operating System: Cent OS PHP Version:5.3.6 Assigned To:scottmac Block user comment: N Private report: N New Comment: would it not be the better solution to think about dropping the libmysql-support and use only mysqlnd - we are runnning some hundret domains and using mysqlnd since the first 5.3 release you will always have the problem of regressions and the result of auto-tests are depending how php was compiled Previous Comments: [2011-09-02 12:19:28] johan...@php.net Scott, can you check how we can fix both things - SSL timeout while having mysqlnd SSL working? We're happy to help on the MySQL side ... Thanks! [2011-09-02 11:22:37] u...@php.net PHP 5.4 beta is scheduled for next week. Is anybody working on fixing the underlying PHP Streams issue not only with 5.3 but also 5.4? [2011-08-22 21:31:56] johan...@php.net Automatic comment from SVN on behalf of johannes Revision: http://svn.php.net/viewvc/?view=revision&revision=315310 Log: - Revert r313616 (When we have a blocking SSL socket, respect the timeout option, scottmac) # This caused bug #55283, we should investigate a proper solution without # breaking anything. [2011-08-18 07:55:45] paj...@php.net You can try in German then as you both speak German as well. However it looks to me that the code speaks for itself. The connection fails after the timeout. This comment is based on this discussion on internals, http://news.php.net/php.internals/54667 . [2011-08-18 07:51:51] and...@php.net English is neither my mother tongue. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55283 -- Edit this bug report at https://bugs.php.net/bug.php?id=55283&edit=1
Bug #55067 [Asn->Csd]: MySQL doesn't support compression
Edit report at https://bugs.php.net/bug.php?id=55067&edit=1 ID: 55067 Updated by: and...@php.net Reported by:belov1985 at gmail dot com Summary:MySQL doesn't support compression -Status: Assigned +Status: Closed Type: Bug Package:MySQLi related Operating System: FreeBSD 8.2 PHP Version:5.3.6 Assigned To:ahristov Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Thanks for your report. Fix will appear in 5.3.9 Previous Comments: [2011-07-20 10:25:25] u...@php.net Andrey, can you have a look? You've been the last one working on the config9.m4. Seems buggy. [2011-06-29 09:46:55] belov1985 at gmail dot com Description: Version mysqlnd 5.0.8-dev - 20102224 - $Revision: 308673 $ Compression not supported PHP build info: ./configure --with-layout=GNU --localstatedir=/var --with-config-file-scan-dir=/usr/local/etc/php --disable-all --enable-libxml --with-pcre-regex=/usr/local --with-zlib-dir=/usr --program-prefix= --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-mcrypt --with-curl --with-jpeg-dir=/usr/local/lib/ --with-freetype-dir=/usr/local/include/freetype2/ --with-png-dir=/usr/local/lib/ --with-iconv-dir=/usr/local/lib --with-libxml-dir=/usr/local/include/ --with-libxml-dir=/usr/local --with-gd --with-bz2 --with-pcre-regex --with-iconv --with-ttf --with-zlib --with-sqlite3 --enable-session --enable-json --enable-gd-native-ttf --enable-inline-optimization --enable-mbstring --enable-xml --enable-dom --enable-simplexml --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-regex=php --with-zend-vm=CALL --disable-ipv6 --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ Some strange info i get, when do "./configure --help" --disable-mysqlnd-compression-support Enable support for the MySQL compressed protocol in mysqlnd :) -- Edit this bug report at https://bugs.php.net/bug.php?id=55067&edit=1
Bug #55536 [Bgs]: MySQLi fetch corrupting bound variables
Edit report at https://bugs.php.net/bug.php?id=55536&edit=1 ID: 55536 User updated by:taopixdev at yahoo dot co dot uk Reported by:taopixdev at yahoo dot co dot uk Summary:MySQLi fetch corrupting bound variables Status: Bogus Type: Bug Package:MySQLi related PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Sorry, I don't agree - it is not okay and definitely not bogus. The documentation for mysqli_stmt::bind_result states: "Binds columns in the result set to variables." If there are no records to fetch then there is nothing to set - ie: nothing to change. Nowhere does it say that the values are set to null. The functionality in 5.2 (and probably before) is correct so why break it in 5.3? I also do not agree with your statement: "It is secondary if there is a result set or not. What's relevant in the above is the fact that bound columns are set." What benefit does setting the values to null give? You can already detect if there are no more records by the result of the fetch command. The outcome of this is that we have to re-write and Q.A. code for no good reason. What is also extremely annoying is that this change was not documented which to me seems as if it is an accidental change to functionality (ie: a bug). We have also found one machine in our office running PHP 5.3 that works the same way as 5.2 so the functionality is not even consistent. Previous Comments: [2011-09-02 11:45:44] u...@php.net I think the current behavior - setting bound result variables to NULL - OK . Bound columns are explicitly mentioned as being modified when running a prepared statement: "Binds columns in the result set to variables. When mysqli_stmt_fetch() is called to fetch data, the MySQL client/server protocol places the data for the bound columns into the specified variables var1, ", http://de2.php.net/manual/en/mysqli-stmt.bind-result.php It is secondary if there is a result set or not. What's relevant in the above is the fact that bound columns are set. Setting to NULL in case of no result set makes perfectly sense. It means "setting" (as documented) and setting to "undefined" (because of no result set). [2011-08-30 10:31:05] taopixdev at yahoo dot co dot uk Description: I have tested this in different versions of PHP and it seems to be a bug from version 5.3.0 onwards. It seems that from PHP version 5.3.0 onwards that when a MySQL select statement returns zero rows the bind result variable is being overwritten and set to a null value. In the example attached to this post I initialize a variable called $recordID and set it to 0; In versions of PHP prior to version 5.3.0 after the fetch has ran the $recordID would still be set to 0 when zero rows are returned. However from versions 5.3.0 onwards the $recordID variable is overwritten and set to null. Test script: --- prepare('SELECT `id`, `name` FROM MYTABLE WHERE id = ?) { if ($stmt->bind_param('i', $pID)) { if ($stmt->bind_result($recordID, $name) { if ($stmt->execute()) { $stmt->fetch(); } } } } ?> Expected result: In versions of PHP prior to version 5.3.0 after the fetch has ran the $recordID would still be set to 0 when zero rows are returned. Actual result: -- >From versions 5.3.0 onwards the $recordID variable is overwritten and set to >null. -- Edit this bug report at https://bugs.php.net/bug.php?id=55536&edit=1
Bug #49532 [Com]: php5ts.dll access violation exception php5ts!_zend_mm_free_int
Edit report at https://bugs.php.net/bug.php?id=49532&edit=1 ID: 49532 Comment by: skys dot dragooon dot adsss at gmail dot com Reported by:matroy at investpsp dot ca Summary:php5ts.dll access violation exception php5ts!_zend_mm_free_int Status: Feedback Type: Bug Package:*General Issues Operating System: win32 only - Windows 2003 SP2 PHP Version:5.2.11 Assigned To:pajoye Block user comment: N Private report: N New Comment: Always the same error.. with 5.3.6 and 5.3.8... :/ Previous Comments: [2011-03-16 13:39:59] mdurovic at gmail dot com It looks like httpd crashes after this error msg in the event viewer. PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\ftproot\LocalUser\linkmarket\framework\common\php\session.class.php on line 71. That is public function write($id, $data) from the code below: _sess_db = mysql_connect('server:port', 'user', 'pw')) { return mysql_select_db('db', $this->_sess_db); } return false; } /** * Close the session * @return bool */ public function close() { if(is_resource($this->_sess_db)) { return mysql_close($this->_sess_db); } return false; } /** * Read the session * @param int session id * @return string string of the sessoin */ public function read($id) { $id = mysql_real_escape_string($id); $sql = sprintf("SELECT data FROM sessions WHERE id = '%s'", $id); if ($result = mysql_query($sql, $this->_sess_db)) { if (mysql_num_rows($result)) { $record = mysql_fetch_assoc($result); //free mysql result mysql_free_result($result); return $record['data']; } } return ''; } /** * Write the session * @param int session id * @param string data of the session */ public function write($id, $data) { $sql = sprintf("REPLACE INTO sessions (id,data,timestamp,ip,url) VALUES('%s', '%s', '%s','%s','%s')", mysql_real_escape_string($id), mysql_real_escape_string($data), mysql_real_escape_string(time()), mysql_real_escape_string($_SERVER['REMOTE_ADDR']), mysql_real_escape_string("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'])); return mysql_query($sql, $this->_sess_db); } /** * Destoroy the session * @param int session id * @return bool */ public function destroy($id) { $sql = sprintf("DELETE FROM sessions WHERE id = '%s'", $id); return mysql_query($sql, $this->_sess_db); } /** * Garbage Collector * @param int life time (sec.) * @return bool * @see session.gc_divisor 100 * @see session.gc_maxlifetime 1440 * @see session.gc_probability1 * @usage execution rate 1/100 *(session.gc_probability/session.gc_divisor) */ public function gc($max) { $sql = sprintf("DELETE FROM sessions WHERE timestamp < '%s'", mysql_real_escape_string(time() - $max)); return mysql_query($sql, $this->_sess_db); } } //ini_set('session.gc_probability', 50); ini_set('session.save_handler', 'user'); $session = new Session(); session_set_save_handler(array($session, 'open'), array($session, 'close'), array($session, 'read'), array($session, 'write'), array($session, 'destroy'), array($session, 'gc')); ?> [2011-03-11 00:28:46] paj...@php.net Without a script to reproduce your problem we will have no chance to fix it. --
Bug #55001 [Asn->Bgs]: Mysql explain command with prepared statement
Edit report at https://bugs.php.net/bug.php?id=55001&edit=1 ID: 55001 Updated by: u...@php.net Reported by:enrico dot triolo at gmail dot com Summary:Mysql explain command with prepared statement -Status: Assigned +Status: Bogus Type: Bug Package:MySQLi related Operating System: Ubuntu 11.04 PHP Version:Irrelevant Assigned To:mysql Block user comment: N Private report: N New Comment: Works fine with mysqlnd. That's a libmysql issue. Use mysqlnd instead. Because it works with mysqlnd, its not a mysqli issue either. Setting to "Bogus" as bugs.php.net is not for libmysql bug reports. Please, report over at bugs.mysql.com. -- script -- nixnutz@linux-fuxh:~/php/php-src/branches/PHP_5_4> cat foo.php -1 AND idParent NOT IN ( SELECT id FROM mytest_table)'; $link = mysqli_connect("localhost", 'root', '', 'test'); $link->query("DROP TABLE IF EXISTS mytest_table"); $link->query("CREATE TABLE mytest_table(id INT PRIMARY KEY NOT NULL, idParent INT)"); $link->query("INSERT INTO mytest_table(id, idParent) VALUES (1, -1), (2, 1)"); printf("Using prepared statement functions...\n"); $stmt = mysqli_stmt_init($link); mysqli_stmt_prepare($stmt, $sql); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); $result = mysqli_stmt_result_metadata($stmt); printf("Fields:\n"); while($field = mysqli_fetch_field($result)) printf("\t%s(%d)\n", $field->name, $field->length); mysqli_free_result($result); mysqli_stmt_bind_result($stmt, $id, $select_type, $table, $type, $possible_keys, $key, $key_len, $ref, $rows, $extra); while(mysqli_stmt_fetch($stmt)) printf("Type field value: %s\n", $type); printf("\nUsing mysqli_query...\n"); $result = mysqli_query($link, $sql); while($row = mysqli_fetch_array($result)) printf("Type field value: %s\n", $row['type']); mysqli_free_result($result); mysqli_close($link); -- libmysql - nixnutz@linux-fuxh:~/php/php-src/branches/PHP_5_4> sapi/cli/php -i | grep mysql Configure Command => './configure' '--with-mysql=/home/nixnutz/ftp/mysql-5.6.2-m5/install' '--with-mysqli=/home/nixnutz/ftp/mysql-5.6.2-m5/install/bin/mysql_config' '--with-pdo-mysql=/home/nixnutz/ftp/mysql-5.6.2-m5/install/bin/mysql_config' '--enable-debug' '--with-openssl' '--enable-pcntl' nixnutz@linux-fuxh:~/php/php-src/branches/PHP_5_4> sapi/cli/php foo.php Using prepared statement functions... Fields: id(3) select_type(19) table(64) type(10) possible_keys(4096) key(64) key_len(4096) ref(1024) rows(10) Extra(255) Type field value: ALL Type field value: unique_subq Using mysqli_query... Type field value: ALL Type field value: unique_subquery mysqlnd nixnutz@linux-fuxh:~/php/php-src/trunk> sapi/cli/php foo.php Using prepared statement functions... Fields: id(3) select_type(19) table(64) type(10) possible_keys(4096) key(64) key_len(4096) ref(1024) rows(10) Extra(255) Type field value: ALL Type field value: unique_subquery Using mysqli_query... Type field value: ALL Type field value: unique_subquery nixnutz@linux-fuxh:~/php/php-src/trunk> sapi/cli/php -i | grep mysqlnd Configure Command => './configure' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--enable-debug' '--enable-maintainer-zts' '--enable-pcntl' Previous Comments: [2011-06-08 08:48:20] enrico dot triolo at gmail dot com I'm using libmysql. Here's the output of the "php --ri mysqli" command: $php --ri mysqli mysqli MysqlI Support => enabled Client API library version => 5.1.54 Active Persistent Links => 0 Inactive Persistent Links => 0 Active Links => 0 Client API header version => 5.1.54 MYSQLI_SOCKET => /var/run/mysqld/mysqld.sock Directive => Local Value => Master Value mysqli.max_links => Unlimited => Unlimited mysqli.max_persistent => Unlimited => Unlimited mysqli.allow_persistent => On => On mysqli.default_host => no value => no value mysqli.default_user => no value => no value mysqli.default_pw => no value => no value mysqli.default_port => 3306 => 3306 mysqli.default_socket => no value => no value mysqli.reconnect => Off => Off mysqli.allow_local_infile => On => On [2011-06-08 02:17:22] johan...@php.net Are you using mysqlnd or libmysql. If libmysql which version? (check phpinfo() output or `php --ri mysqli` from command line) [2011-06-06 16:30:24] enrico dot triolo at gmail dot com Description: ---
Bug #49532 [Com]: php5ts.dll access violation exception php5ts!_zend_mm_free_int
Edit report at https://bugs.php.net/bug.php?id=49532&edit=1 ID: 49532 Comment by: skys dot dragooon dot adsss at gmail dot com Reported by:matroy at investpsp dot ca Summary:php5ts.dll access violation exception php5ts!_zend_mm_free_int Status: Feedback Type: Bug Package:*General Issues Operating System: win32 only - Windows 2003 SP2 PHP Version:5.2.11 Assigned To:pajoye Block user comment: N Private report: N New Comment: I solved my problem. This error occured with php.exe, php-cgi.exe and php-win.exe, and apache's launch.. In my case, it was due to a co-exist of PHP5.2.x and PHP5.3.x version and the bad use by my PHP5.3.x of the PHP5.2.x INI file. (PHPRC environment variable pointing to PHP5.2.x INI that I missed) Previous Comments: [2011-09-02 13:45:07] skys dot dragooon dot adsss at gmail dot com Always the same error.. with 5.3.6 and 5.3.8... :/ [2011-03-16 13:39:59] mdurovic at gmail dot com It looks like httpd crashes after this error msg in the event viewer. PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\ftproot\LocalUser\linkmarket\framework\common\php\session.class.php on line 71. That is public function write($id, $data) from the code below: _sess_db = mysql_connect('server:port', 'user', 'pw')) { return mysql_select_db('db', $this->_sess_db); } return false; } /** * Close the session * @return bool */ public function close() { if(is_resource($this->_sess_db)) { return mysql_close($this->_sess_db); } return false; } /** * Read the session * @param int session id * @return string string of the sessoin */ public function read($id) { $id = mysql_real_escape_string($id); $sql = sprintf("SELECT data FROM sessions WHERE id = '%s'", $id); if ($result = mysql_query($sql, $this->_sess_db)) { if (mysql_num_rows($result)) { $record = mysql_fetch_assoc($result); //free mysql result mysql_free_result($result); return $record['data']; } } return ''; } /** * Write the session * @param int session id * @param string data of the session */ public function write($id, $data) { $sql = sprintf("REPLACE INTO sessions (id,data,timestamp,ip,url) VALUES('%s', '%s', '%s','%s','%s')", mysql_real_escape_string($id), mysql_real_escape_string($data), mysql_real_escape_string(time()), mysql_real_escape_string($_SERVER['REMOTE_ADDR']), mysql_real_escape_string("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'])); return mysql_query($sql, $this->_sess_db); } /** * Destoroy the session * @param int session id * @return bool */ public function destroy($id) { $sql = sprintf("DELETE FROM sessions WHERE id = '%s'", $id); return mysql_query($sql, $this->_sess_db); } /** * Garbage Collector * @param int life time (sec.) * @return bool * @see session.gc_divisor 100 * @see session.gc_maxlifetime 1440 * @see session.gc_probability1 * @usage execution rate 1/100 *(session.gc_probability/session.gc_divisor) */ public function gc($max) { $sql = sprintf("DELETE FROM sessions WHERE timestamp < '%s'", mysql_real_escape_string(time() - $max)); return mysql_query($sql, $this->_sess_db); } } //ini_set('session.gc_probability', 50); ini_set('session.save_handler', 'user'); $session = new Session(); session_set_save_handler(array($sessio
Bug #50209 [Com]: Compiling with libedit cannot find readline.h
Edit report at https://bugs.php.net/bug.php?id=50209&edit=1 ID: 50209 Comment by: post at tentimes dot org Reported by:tcallawa at redhat dot com Summary:Compiling with libedit cannot find readline.h Status: Closed Type: Bug Package:Compile Failure Operating System: Linux (Fedora) PHP Version:5.2, 5.3, 6 Assigned To:felipe Block user comment: N Private report: N New Comment: It's libreadline-dev you need to add, not readline-dev. But, thanks a lot for the tip! That is just what I was missing (for 5.38). Previous Comments: [2011-07-04 12:12:07] breck7 at gmail dot com While compiling the new PHP 5.4 release I tried using: --with-readline, --with- libedit, and --with-libedit --without-readline and always got " I cannot find readline.h" In case anyone has trouble reinstalling readline, run this: sudo apt-get install libreadline-devel I found that tricky (was trying install readline, install readline--devel, install libedit, install libedit--devel, etc.). I figured I'd post this since this is the first Google result for "I cannot find readline.h" [2009-12-13 17:07:20] fel...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Thanks for the patch! [2009-12-13 17:06:49] s...@php.net Automatic comment from SVN on behalf of felipe Revision: http://svn.php.net/viewvc/?view=revision&revision=292081 Log: - Fixed bug #50209 (Compiling with libedit cannot find readline.h) (patch by tcallawa at redhat dot com) [2009-11-17 21:49:34] tcallawa at redhat dot com Description: The PHP code assumes that even with libedit in use (instead of readline), that the header can be found in readline/readline.h. libedit installs its "readline.h" into editline/ (to avoid the obvious conflict with readline). Accordingly, configure claims that libedit is not properly installed, when it is. I've written a straightforward patch to fix this: http://spot.fedorapeople.org/php-5.3.0-libedit.patch It is also possible to use pkgconfig to ask libedit for its include flags (and cflags), which would return "-I/usr/include/editline", but as that was slightly more intrusive, I did not go down that road. In addition, on a system where readline-devel and libedit-devel are both installed, the existing code checking for /usr/include/readline-devel will cause a false positive when checking for libedit, and will end up doing a compile with readline's headers and libedit's library. Reproduce code: --- ./configure --without-readline --with-libedit Expected result: checking for libedit readline replacement... yes checking for readline in -ledit... yes Actual result: -- checking for libedit readline replacement... yes configure: error: Please reinstall libedit - I cannot find readline.h -- Edit this bug report at https://bugs.php.net/bug.php?id=50209&edit=1
Bug #29992 [Com]: foreach by reference corrupts the array
Edit report at https://bugs.php.net/bug.php?id=29992&edit=1 ID: 29992 Comment by: publcishady at gmail dot com Reported by:fletch at pobox dot com Summary:foreach by reference corrupts the array Status: Bogus Type: Bug Package:Scripting Engine problem Operating System: linux PHP Version:5.0.1 Block user comment: N Private report: N New Comment: If you describe how it works that's not an excuse for unexpected results. I understand why the last element becomes a reference, but I don't understand why it SHOULD become a reference. That's obviously a bug for me. Previous Comments: [2011-07-18 05:03:24] martijn at twotribes dot com Well, it is expected by the people who designed the language perhaps, but not by me. Iterating through an array, without doing anything, shouldn't change the array. Period. If I do something similar in another language like C++, this will never be the result. [2011-07-15 11:57:04] johan...@php.net daniel, unsetting it before might also cause a wrong result. Simple example: This is simplified and probably no good architecture but such designs might make sense in some situations and breaking that adds a larger inconsistency than the current "surprising but consistent" behavior. martijn, Of course there is a reference at the end, absolutely expected and consistent with the language. [2011-07-13 06:48:49] martijn at twotribes dot com To elaborate of why I strongly feel this is a bug and not a 'feature': $a = array('a', 'b', 'c', 'd'); foreach ($a as &$v) { } var_dump($a); One would expect that every element of $a is a string. Well it was, up until I did that foreach-with-reference. That changed the last element into string reference: array(4) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" [3]=> &string(1) "d" } The PHP guys can claim that this is correct behavior all they want, but it is fundamentally wrong from a design perspective that an array changes, without doing anything to its elements. [2011-07-13 06:37:58] martijn at twotribes dot com Can someone please promote this "bogus" status to an actual bug? It completely baffles me why something so obviously wrong, has been present in PHP for almost 7(!) years. Come on guys, fix this! [2011-07-01 06:41:47] daniel at milde dot cz I agree with Looris. This behaviour is dangerous and no one expects it. I suggest unsetting the variable BEFORE each loop. This should cause no harm. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=29992 -- Edit this bug report at https://bugs.php.net/bug.php?id=29992&edit=1
Bug #55557 [Opn]: windows zip files missing content in extras directory
Edit report at https://bugs.php.net/bug.php?id=7&edit=1 ID: 7 User updated by:longneck at iname dot com Reported by:longneck at iname dot com Summary:windows zip files missing content in extras directory Status: Open Type: Bug Package:Windows Installer Operating System: windows PHP Version:5.3.8 Block user comment: N Private report: N New Comment: is there somewhere i can get what's supposed to be in the extras or mibs folder? i looked through SVN and i couldn't find it. Previous Comments: [2011-09-02 06:55:58] lytbo...@php.net Actually extras folder is empty, not only mibs is missing. [2011-08-31 20:39:33] longneck at iname dot com Description: the 5.3.x series of ZIP files on windows.php.net are missing the extras\mibs folder. the 5.2.x series does have the folder. Test script: --- n/a -- Edit this bug report at https://bugs.php.net/bug.php?id=7&edit=1
Req #55542 [Asn]: SNMP class should use Exceptions instead of PHP Errors
Edit report at https://bugs.php.net/bug.php?id=55542&edit=1 ID: 55542 Updated by: lytbo...@php.net Reported by:c...@php.net Summary:SNMP class should use Exceptions instead of PHP Errors Status: Assigned Type: Feature/Change Request Package:SNMP related PHP Version:5.4.0alpha3 Assigned To:lytboris Block user comment: N Private report: N New Comment: Here it is thread in PHP-DEV I mentioned: http://marc.info/?l=php-internals&m=129853991816725 Unless something changes I would prefer to techniques described there. Previous Comments: [2011-09-02 12:05:43] c...@php.net But PDO has a history back to PHP4 or the days where people where used to check every single return value for PEAR_Error. The SNMP class is new and could lead as good example for proper OOP style! (Or do you prefer C style $errno checking after every method call over try/catch statements? The chances that an error goes unnoticed is much lower with exceptions.) [2011-09-02 11:48:34] lytbo...@php.net enable SNMP::ERRNO_ANY by default is not a good idea I think. PDO has the same default behavior for throwing exceptions. [2011-09-02 10:41:20] c...@php.net Thanks for implementing this so quickly. But the constructor still says: "snmp_object->exceptions_enabled = 0;", as this is a class one would rather expect OOP style exceptions as default, or? [2011-09-02 10:13:21] lytbo...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. A new SNMP object property is introduced: exceptions_enabled. Setting this property to ORed combination of SNMP::ERRNO_* errors will enable exception throwing on these errors. SNMP::ERRNO_ANY may be used to enable all posslible SNMP::ERRNO_* errors at once. [2011-09-02 10:13:19] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316032 Log: merge from trunk added SNMPException class, enabling ability to throw exceptions when a known SNMP error has occured FR #55542 The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55542 -- Edit this bug report at https://bugs.php.net/bug.php?id=55542&edit=1
[PHP-BUG] Bug #55573 [NEW]: "Undefined variable" when calling closure/anon function from static property
From: Operating system: Mac OS X PHP version: 5.3.8 Package: Scripting Engine problem Bug Type: Bug Bug description:"Undefined variable" when calling closure/anon function from static property Description: When trying to call a function stored in a static property I get the "Undefined variable" notice and a "Function must be a string" fatal error. This happens whether or not the function is stored directly in the property or in an array. A work around (for now) seems to be storing the property into a temp variable. Test script: --- // Test Case 1: class Foo { public static $bar; } Foo::$bar = function() { echo 'Foo bar!'; }; Foo::$bar(); // Work around: /* $f = Foo::$bar; $f(); */ // Test Case 2: class Foo { public static $bar = array(); } Foo::$bar['bar'] = function() { echo 'Foo bar!'; }; Foo::$bar['bar'](); Expected result: Foo bar! Actual result: -- Notice: Undefined variable: bar Fatal error: Function name must be a string -- Edit bug report at https://bugs.php.net/bug.php?id=55573&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55573&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55573&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55573&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55573&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55573&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55573&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55573&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55573&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55573&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55573&r=support Expected behavior: https://bugs.php.net/fix.php?id=55573&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55573&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55573&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55573&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55573&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55573&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55573&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55573&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55573&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55573&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55573&r=mysqlcfg
Bug #55300 [Com]: \DirectoryIterator, parent::__construct() and \LogicException
Edit report at https://bugs.php.net/bug.php?id=55300&edit=1 ID: 55300 Comment by: krossekrabbe at gmail dot com Reported by:frederic dot hardy at mageekbox dot net Summary:\DirectoryIterator, parent::__construct() and \LogicException Status: Assigned Type: Bug Package:SPL related Operating System: Linux PHP Version:5.4.0alpha2 Assigned To:cataphract Block user comment: N Private report: N New Comment: No, it's not only a BC break. It's exactly the same, it is not possible to extend the class. Not when calling parent::__construct(), nor when not overriding __construct() at all. Previous Comments: [2011-08-09 08:52:19] cataphr...@php.net I wouldn't consider these duplicates. #55175 is an actual problem, this is simply an intended BC break that turned out to have a larger impact than I expected. I'll take care of both not after the beginning of next week. [2011-08-09 08:46:37] s...@php.net Actually according to my test case in https://bugs.php.net/bug.php?id=55175 - it's even happening if you don't redefine the constructor at all. It prevents extending the class altogether, which makes no sense to me. [2011-08-09 08:44:46] s...@php.net The main issue is not that it's a BC break I'd say, it's that apparently adding the call to parent::__construct does not fix the issue, the exception is always thrown if you try to have your own constructor in the extending class. BTW: This is a duplicate of https://bugs.php.net/bug.php?id=55175 IMO. [2011-08-04 06:56:27] frederic dot hardy at mageekbox dot net This BC break is a problem with the symfony 2 framework. All command throw this exception : [LogicException] In the constructor of Symfony\Component\Finder\SplFileInfo, parent::__construct() must be called and its exceptions cannot be cleared [2011-07-28 08:44:49] paj...@php.net Thing is that it is a bc break, whether it was well designed in the 1st place or not is sadly not relevant here. Is there any way to restore this behavior without bc breaks? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55300 -- Edit this bug report at https://bugs.php.net/bug.php?id=55300&edit=1
Req #55542 [Asn->Csd]: SNMP class should use Exceptions instead of PHP Errors
Edit report at https://bugs.php.net/bug.php?id=55542&edit=1 ID: 55542 Updated by: lytbo...@php.net Reported by:c...@php.net Summary:SNMP class should use Exceptions instead of PHP Errors -Status: Assigned +Status: Closed Type: Feature/Change Request Package:SNMP related PHP Version:5.4.0alpha3 Assigned To:lytboris Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: [2011-09-02 19:56:30] lytbo...@php.net Automatic comment from SVN on behalf of lytboris Revision: http://svn.php.net/viewvc/?view=revision&revision=316054 Log: documentation for SNMPException class (FR #55542) [2011-09-02 18:52:37] lytbo...@php.net Here it is thread in PHP-DEV I mentioned: http://marc.info/?l=php-internals&m=129853991816725 Unless something changes I would prefer to techniques described there. [2011-09-02 12:05:43] c...@php.net But PDO has a history back to PHP4 or the days where people where used to check every single return value for PEAR_Error. The SNMP class is new and could lead as good example for proper OOP style! (Or do you prefer C style $errno checking after every method call over try/catch statements? The chances that an error goes unnoticed is much lower with exceptions.) [2011-09-02 11:48:34] lytbo...@php.net enable SNMP::ERRNO_ANY by default is not a good idea I think. PDO has the same default behavior for throwing exceptions. [2011-09-02 10:41:20] c...@php.net Thanks for implementing this so quickly. But the constructor still says: "snmp_object->exceptions_enabled = 0;", as this is a class one would rather expect OOP style exceptions as default, or? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55542 -- Edit this bug report at https://bugs.php.net/bug.php?id=55542&edit=1
Req #54378 [Fbk->Csd]: Ability to ignore OID not increasing error
Edit report at https://bugs.php.net/bug.php?id=54378&edit=1 ID: 54378 Updated by: lytbo...@php.net Reported by:ch at lathspell dot de -Summary:Expose snmp_in/out/mib_toggle_options() +Summary:Ability to ignore OID not increasing error -Status: Feedback +Status: Closed Type: Feature/Change Request Package:SNMP related PHP Version:trunk-SVN-2011-03-24 (SVN) -Assigned To: +Assigned To:lytboris Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: [2011-07-29 00:44:11] c...@php.net Thanks, that should do it. [2011-07-18 17:02:26] lytbo...@php.net Please try using this snapshot: http://snaps.php.net/php5.4-latest.tar.gz For Windows: http://windows.php.net/snapshots/ I've added noOIDIncreasingCheck property. When set to true, walk method works exactly as snmpwalk with -Cc flag. [2011-03-24 22:30:27] ch at lathspell dot de Description: The snmpcmd(1) man page lists a lot of options, some of them should probably be better done in PHP but some, like -Pc or -Cc could be necessary in rare cases. An alternative would be to expose the "-Y" function netsnmp_config_remember(). Of course it should be documented that these function alter the global behaviour and not just the current session. Also that they are Net-SNMP specific. Test script: --- - Expected result: - Actual result: -- - -- Edit this bug report at https://bugs.php.net/bug.php?id=54378&edit=1
Bug #43410 [Fbk->NoF]: SNMP cause "PHP has encountered an Access Violation" when wrong IP or CommStr
Edit report at https://bugs.php.net/bug.php?id=43410&edit=1 ID: 43410 Updated by: lytbo...@php.net Reported by:andy_wolk at mail dot ru Summary:SNMP cause "PHP has encountered an Access Violation" when wrong IP or CommStr -Status: Feedback +Status: No Feedback Type: Bug Package:SNMP related Operating System: Windows 2003 Server Enterprise PHP Version:5.2.5 Block user comment: N Private report: N Previous Comments: [2010-09-14 10:55:17] paj...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ [2010-09-14 08:29:50] andy_wolk at mail dot ru Still got the problem. We use the latest 5.2.x version as isapi. But no luck. I think we are not alone. Check this out (a post from Mar 2010)http://stackoverflow.com/questions/154290/php-access-violation/2482839#2482839 [2008-10-29 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2008-10-21 12:06:43] j...@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Do not paste such huge texts here. Put them somewhere in net (like http://phpfi.com/) where we can check them out. [2007-11-26 11:50:45] andy_wolk at mail dot ru Description: SNMP functions cause "PHP has encountered an Access Violation" when wrong IP or Community String. IIS 6 + PHP5.2.2dev isapi module. PHP_snmp.dll (ver 5.2.2.2) All next php versions has the same problem. After this error, IIS does not can operate with snmp module and needs to be restarted. Event viewer: Faulting application w3wp.exe, version 6.0.3790.3959, faulting module unknown, version 0.0.0.0, fault address 0x010cfdf4. No errors in php_error.log Reproduce code: --- Expected result: Start...Finish Actual result: -- Start...PHP has encountered an Access Violation at -- Edit this bug report at https://bugs.php.net/bug.php?id=43410&edit=1
Bug #55573 [Opn->Bgs]: "Undefined variable" when calling closure/anon function from static property
Edit report at https://bugs.php.net/bug.php?id=55573&edit=1 ID: 55573 Updated by: johan...@php.net Reported by:luke at cywh dot com Summary:"Undefined variable" when calling closure/anon function from static property -Status: Open +Status: Bogus Type: Bug Package:Scripting Engine problem Operating System: Mac OS X PHP Version:5.3.8 Block user comment: N Private report: N New Comment: Foo::$bar['bar'](); has been a valid construct for a long time in PHP. This will first interpret $bar['bar'] and take that as method which will then be executed. So if you have $bar = array('bar' => 'baz'); Foo::$bar['bar'](); the method Foo::baz() will actually be called. Changing this is part of a bigger project which revamps the relationship between properties and methods. If/When that will be implemented I can't say. For now this is expected behavior. Previous Comments: [2011-09-02 19:12:42] luke at cywh dot com Description: When trying to call a function stored in a static property I get the "Undefined variable" notice and a "Function must be a string" fatal error. This happens whether or not the function is stored directly in the property or in an array. A work around (for now) seems to be storing the property into a temp variable. Test script: --- // Test Case 1: class Foo { public static $bar; } Foo::$bar = function() { echo 'Foo bar!'; }; Foo::$bar(); // Work around: /* $f = Foo::$bar; $f(); */ // Test Case 2: class Foo { public static $bar = array(); } Foo::$bar['bar'] = function() { echo 'Foo bar!'; }; Foo::$bar['bar'](); Expected result: Foo bar! Actual result: -- Notice: Undefined variable: bar Fatal error: Function name must be a string -- Edit this bug report at https://bugs.php.net/bug.php?id=55573&edit=1
[PHP-BUG] Req #55574 [NEW]: apache2filter code does not do syntax highlighting
From: Operating system: FreeBSD 8.2-STABLE PHP version: 5.3.8 Package: Apache2 related Bug Type: Feature/Change Request Bug description:apache2filter code does not do syntax highlighting Description: The PHP experimental apache2filter code (e.g. --with-apxs2filter) does not properly handle syntax highlighting requests, despite the documentation stating such should work. Taken from sapi/apache2filter/README: 36 At the end of conf/httpd.conf, add: 37 38 AddType application/x-httpd-php .php 39 40 If you would like to enable source code highlighting functionality add: 41 42 AddType application/x-httpd-php-source .phps sapi/apache2filter/sapi_apache2.c has the following code: 670 static void php_insert_filter(request_rec *r) 671 { 672 int content_type_len = strlen("application/x-httpd-php"); 673 674 if (r->content_type && !strncmp(r->content_type, "application/x-httpd-php", content_type_len-1)) { 675 if (r->content_type[content_type_len] == '\0' || !strncmp(r->content_type+content_type_len, "-source", sizeo f("-source"))) { 676 php_add_filter(r, r->output_filters); 677 php_add_filter(r, r->input_filters); 678 } 679 } 680 } Translated to English, all this does is cause Content-Type application/x-httpd-source documents to be parsed and run, not sent through the syntax highlighter. Testing a fetch of a .phps document confirms this; the code gets run, with no output. This is incorrect behaviour when compared to what the README states. If you compare the above code to that of, say, sapi/apache2handler/sapi_apache2.c, you will find that the handler (not filter) code there does extra work to make sure such requests get shoved through the syntax highlighter. Solution: Please pick one ((a) is obviously preferred): a) improve sapi/apache2filter/sapi_apache2.c to properly send application/x-httpd-source requests through the highlighter, b) update the README to reflect that source highlighting does not work with apxs2filter. Sub-items that should be addressed while I'm here: 1) PHP Bug 40499 should be closed as invalid; there is no "PHP-highlight" filter. I have no idea where the user got that idea. Not to mention, Set{Input,Output}Filter directives should not be used when --with-apxs2filter is used; all people need, truly, is AddType directives. Users/admins have to read the source to understand that fact. I wish this was made more apparent. https://bugs.php.net/bug.php?id=40499 2) There is no mention of --with-apxs2filter in the PHP configure flags documentation. It doesn't matter if the support is experimental -- it should be documented. http://www.php.net/manual/en/configure.about.php Test script: --- Not needed; see description. Expected result: Users/administrators expect that when apxs2filter is used, per the README, that .phps documents should render as syntax highlighted. Actual result: -- .phps documents are actually executed/parsed as code. -- Edit bug report at https://bugs.php.net/bug.php?id=55574&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55574&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55574&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55574&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55574&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55574&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55574&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55574&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55574&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55574&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55574&r=support Expected behavior: https://bugs.php.net/fix.php?id=55574&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55574&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55574&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55574&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55574&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55574&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55574&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55574&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55574&r=float No Zend Extensions: https://bu
[PHP-BUG] Bug #55575 [NEW]: strtotime() returns erroneous result on nonsense DATE_RSS format date strings
From: Operating system: Linux & Darwin PHP version: 5.3.8 Package: Date/time related Bug Type: Bug Bug description:strtotime() returns erroneous result on nonsense DATE_RSS format date strings Description: (Note: I was only able to test on 5.2.16, 5.3.0, and 5.3.4. Since there is no evidence of it being fixed in the changelog of 5.3.8, I assume it's still there.) The ninth of May, 2010, was a Sunday. However, if you assert to strtotime() that it was a Monday, it will return the Unix timestamp for Monday, May 10th. Likewise if you assert the ninth was a Tuesday, it will return the timestamp for the 11th; a Wednesday the 12th, and so on right up to returning a Unix timestamp for Saturday, 15 May 2010 if you provide it with "Saturday, 9 May 2010". Presumably, the correct behavior is one of (1) to throw an error given a self- contradictory date, (2) to return nothing at all, or (3) to ignore the day-of-the- week element and return the Unix timestamp for the date specified (e.g. 9 May 2010). Returning the timestamp for another date altogether is wrong. Test script: --- $datestring="9 May 2010 04:24:36 GMT"; print "\"\": ".strtotime($datestring)." ".date($dateformat, strtotime($datestri\ ng)) ."\n"; $datestring="Sun, 9 May 2010 04:24:36 GMT"; print "Sun: ".strtotime($datestring)." ".date($dateformat, strtotime($datestrin\ g)) ."\n"; $datestring="Mon, 9 May 2010 04:24:36 GMT"; print "Mon: ".strtotime($datestring)." ".date($dateformat, strtotime($datestrin\ g)) ."\n"; $datestring="Tue, 9 May 2010 04:24:36 GMT"; print "Tue: ".strtotime($datestring)." ".date($dateformat, strtotime($datestrin\ g)) ."\n"; Expected result: "": 1273379076 Sun, 09 May 2010 00:24:36 -0400 Sun: 1273379076 Sun, 09 May 2010 00:24:36 -0400 Mon: 1273379076 Sun, 09 May 2010 00:24:36 -0400 Tue: 1273379076 Sun, 09 May 2010 00:24:36 -0400 (Alternatively: "": 1273379076 Sun, 09 May 2010 00:24:36 -0400 Sun: 1273379076 Sun, 09 May 2010 00:24:36 -0400 Mon: Tue: ) Actual result: -- "": 1273379076 Sun, 09 May 2010 00:24:36 -0400 Sun: 1273379076 Sun, 09 May 2010 00:24:36 -0400 Mon: 1273465476 Mon, 10 May 2010 00:24:36 -0400 Tue: 1273551876 Tue, 11 May 2010 00:24:36 -0400 -- Edit bug report at https://bugs.php.net/bug.php?id=55575&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55575&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55575&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55575&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55575&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55575&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55575&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55575&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55575&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55575&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55575&r=support Expected behavior: https://bugs.php.net/fix.php?id=55575&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55575&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55575&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55575&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55575&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55575&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55575&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55575&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55575&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55575&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55575&r=mysqlcfg