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
Req #51987 [Com]: Datetime fails to parse an ISO 8601 ordinal date (extended format)
Edit report at http://bugs.php.net/bug.php?id=51987&edit=1 ID: 51987 Comment by: jbondc at openmv dot com Reported by:jbondc at openmv dot com Summary:Datetime fails to parse an ISO 8601 ordinal date (extended format) Status: Open Type: Feature/Change Request Package:Date/time related Operating System: FreeBSD PHP Version:5.2.13 Block user comment: N Private report: N New Comment: This patch needs: re2c -d -b -o ext/date/lib/parse_date.c ext/date/lib/parse_date.re It also fixes tests that were failing in trunk. I changed the behavior of timelib_parse_from_format() to always initialized seconds, minutes, hours to 0 if they are not set. Previous Comments: [2010-06-03 15:38:31] sala...@php.net Forgive my initial hastiness, I overlooked the fact that doy should always be 3- digits in length. Sorry!! [2010-06-03 15:04:19] der...@php.net It's a feature request though, *but* before we add it we must be certain that it doesn't conflict. [2010-06-03 14:55:14] jbondc at openmv dot com Please leave this bug open, I will look at submitting a patch. There is no reason not to support: $d2 = new Datetime('1985-001'); $d2 = new Datetime('1985-002'); ... $d2 = new Datetime('1985-365'); AND $d2 = new Datetime('1985-01'); $d2 = new Datetime('1985-12'); [2010-06-03 14:36:21] sala...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Currently only YYdoy and YY.doy are supported. Adding in YY-doy would conflict with existing support for YY-mm. See http://php.net/datetime.formats for details of what is currently available. (Key: YY = four-digit year, doy = day of year, mm = month number.) -------------------- [2010-06-03 13:55:51] jbondc at openmv dot com Description: PHP 5.2.12 with Suhosin-Patch 0.9.7 (cli) (built: Dec 30 2009 15:41:26) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies Test script: --- // Ordinal date â 12 April 1985 $d1 = new Datetime('1985102'); // OK $d2 = new Datetime('1985-102'); // Exception: DateTime::__construct(): Failed to parse time string (1985-102) at position 7 (2): Unexpected character -- Edit this bug report at http://bugs.php.net/bug.php?id=51987&edit=1
Bug #52335 [Asn]: fseek() on memory stream behavior different then file
Edit report at http://bugs.php.net/bug.php?id=52335&edit=1 ID: 52335 User updated by:jbondc at openmv dot com Reported by:jbondc at openmv dot com Summary:fseek() on memory stream behavior different then file Status: Assigned Type: Bug Package:Streams related Operating System: FreeBSD 7.2 PHP Version:5.2.14RC2 Assigned To:cataphract Block user comment: N Private report: N New Comment: Thanks, saw the changes in fseek.xml What about adding streamWrapper::hasFeature(/* int */$featureId) const STREAM_FEAT_FWDSEEK = 1; const STREAM_FEAT_OTHER = 2; //... $stream = new File_Stream('/tmp/foo'); $stream->isSupported(STREAM_FEAT_FWDSEEK); // true fseek($stream, 1024); // NULL bytes added $stream = new Memory_Stream('/tmp/foo'); $stream->isSupported(STREAM_FEAT_FWDSEEK); // false fseek($stream, 1024); // false The goal is to have a consistent api to write to a binary stream. I can give it some more thought, other stream 'features'. Previous Comments: [2010-11-13 16:10:48] cataphr...@php.net I've fixed the doc part, but on a closer inspection the behavior of the memory stream on past-the-end-of-file seeks could be improved. [2010-11-13 16:09:54] cataphr...@php.net Automatic comment from SVN on behalf of cataphract Revision: http://svn.php.net/viewvc/?view=revision&revision=305317 Log: - Behavior when seeking past the end of file. Partially addresses bug #52335. - Expanded note on how the stream may not support seeking. -------------------- [2010-07-14 13:18:10] jbondc at openmv dot com Description: May not be a bug but a documentation issue With a file, fseek() to an offset that doesn't exist results in NULL bytes added. Using a memory stream, fseek() just fails. Which one is the expected behavior? Also for streamWrapper::stream_seek() Test script: --- $sp = fopen("php://memory", 'w+'); fseek($sp, 1024); // fails why? echo fwrite($sp, "abc");// 3 fseek($sp, 1024); // echo fread($sp, 3); // NULL.. $sp = fopen("/tmp/foo", 'w+'); fseek($sp, 1024); echo fwrite($sp, "abc");// 3 fseek($sp, 1024); echo fread($sp, 3); // abc Expected result: 3abc3abc Actual result: -- 33abc -- Edit this bug report at http://bugs.php.net/bug.php?id=52335&edit=1
[PHP-BUG] Bug #52335 [NEW]: fseek() on memory stream behavior different then file
From: Operating system: FreeBSD 7.2 PHP version: 5.2.14RC2 Package: Streams related Bug Type: Bug Bug description:fseek() on memory stream behavior different then file Description: May not be a bug but a documentation issue With a file, fseek() to an offset that doesn't exist results in NULL bytes added. Using a memory stream, fseek() just fails. Which one is the expected behavior? Also for streamWrapper::stream_seek() Test script: --- $sp = fopen("php://memory", 'w+'); fseek($sp, 1024); // fails why? echo fwrite($sp, "abc");// 3 fseek($sp, 1024); // echo fread($sp, 3); // NULL.. $sp = fopen("/tmp/foo", 'w+'); fseek($sp, 1024); echo fwrite($sp, "abc");// 3 fseek($sp, 1024); echo fread($sp, 3); // abc Expected result: 3abc3abc Actual result: -- 33abc -- Edit bug report at http://bugs.php.net/bug.php?id=52335&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52335&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52335&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52335&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=52335&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52335&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=52335&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=52335&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=52335&r=needscript Try newer version: http://bugs.php.net/fix.php?id=52335&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=52335&r=support Expected behavior: http://bugs.php.net/fix.php?id=52335&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=52335&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=52335&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=52335&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52335&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=52335&r=dst IIS Stability: http://bugs.php.net/fix.php?id=52335&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=52335&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=52335&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=52335&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=52335&r=mysqlcfg
Bug #51987 [Bgs]: Datetime fails to parse an ISO 8601 ordinal date (extended format)
Edit report at http://bugs.php.net/bug.php?id=51987&edit=1 ID: 51987 User updated by: jbondc at openmv dot com Reported by: jbondc at openmv dot com Summary: Datetime fails to parse an ISO 8601 ordinal date (extended format) Status: Bogus Type: Bug Package: Date/time related Operating System: FreeBSD PHP Version: 5.2.13 New Comment: Please leave this bug open, I will look at submitting a patch. There is no reason not to support: $d2 = new Datetime('1985-001'); $d2 = new Datetime('1985-002'); ... $d2 = new Datetime('1985-365'); AND $d2 = new Datetime('1985-01'); $d2 = new Datetime('1985-12'); Previous Comments: [2010-06-03 14:36:21] sala...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Currently only YYdoy and YY.doy are supported. Adding in YY-doy would conflict with existing support for YY-mm. See http://php.net/datetime.formats for details of what is currently available. (Key: YY = four-digit year, doy = day of year, mm = month number.) -------------------- [2010-06-03 13:55:51] jbondc at openmv dot com Description: PHP 5.2.12 with Suhosin-Patch 0.9.7 (cli) (built: Dec 30 2009 15:41:26) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies Test script: --- // Ordinal date â 12 April 1985 $d1 = new Datetime('1985102'); // OK $d2 = new Datetime('1985-102'); // Exception: DateTime::__construct(): Failed to parse time string (1985-102) at position 7 (2): Unexpected character -- Edit this bug report at http://bugs.php.net/bug.php?id=51987&edit=1
[PHP-BUG] Bug #51987 [NEW]: Datetime fails to parse an ISO 8601 ordinal date (extended format)
From: Operating system: FreeBSD PHP version: 5.2.13 Package: Date/time related Bug Type: Bug Bug description:Datetime fails to parse an ISO 8601 ordinal date (extended format) Description: PHP 5.2.12 with Suhosin-Patch 0.9.7 (cli) (built: Dec 30 2009 15:41:26) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies Test script: --- // Ordinal date â 12 April 1985 $d1 = new Datetime('1985102'); // OK $d2 = new Datetime('1985-102'); // Exception: DateTime::__construct(): Failed to parse time string (1985-102) at position 7 (2): Unexpected character -- Edit bug report at http://bugs.php.net/bug.php?id=51987&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51987&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51987&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=51987&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=51987&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51987&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51987&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51987&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51987&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51987&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51987&r=support Expected behavior: http://bugs.php.net/fix.php?id=51987&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51987&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51987&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51987&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51987&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=51987&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51987&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51987&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51987&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51987&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51987&r=mysqlcfg