Req #55128 [Ana]: SplFixedArray::fromArray() does not use extended class
Edit report at https://bugs.php.net/bug.php?id=55128edit=1 ID: 55128 User updated by:ar at ez dot no Reported by:ar at ez dot no Summary:SplFixedArray::fromArray() does not use extended class Status: Analyzed Type: Feature/Change Request Package:SPL related Operating System: * PHP Version:5.3.6 Block user comment: N Private report: N New Comment: that sounds like potentially breaking code. cant see the patch from here(surfing on kindle while on vacation), but isn`t it something like new static() that can be used? Previous Comments: [2011-07-26 10:10:24] larue...@php.net After much thought, I think there maybe no reason for fixedarray extended class to define it's own constructor, since we provide fixedarrary::__construct and fromArray already, and extended class should only get an instance through calling them. so I think we can make fixedarray::__construct final to make this feature works. [2011-07-26 09:57:47] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311674267 URL: https://bugs.php.net/patch-display.php?bug=55128patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instancerevision=1311674267 [2011-07-26 09:49:52] larue...@php.net hmm, that's a really problem, if we want to provide this feature, we should make fixedarray::__construct final. [2011-07-26 08:36:08] cataphr...@php.net What if FixedCollection has a constructor? [2011-07-26 05:35:55] larue...@php.net The following patch has been added/updated: Patch Name: php-5-3-splfixedarray-fromarray-should-return-call-scope-instance Revision: 1311658555 URL: https://bugs.php.net/patch-display.php?bug=55128patch=php-5-3-splfixedarray-fromarray-should-return-call-scope-instancerevision=1311658555 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=55128 -- Edit this bug report at https://bugs.php.net/bug.php?id=55128edit=1
[PHP-BUG] Req #55128 [NEW]: SplFixedArray::fromArray() does not use extended class
From: Operating system: * PHP version: 5.3.6 Package: SPL related Bug Type: Feature/Change Request Bug description:SplFixedArray::fromArray() does not use extended class Description: It would be nice if SplFixedArray::fromArray() returned the child class instance instead of SplFixedArray instance. Test script: --- class FixedCollection extends SplFixedArray { // impl } $collection = FixedCollection::fromArray( array( 22, 42 ) ); if ( 'FixedCollection' !== get_class( $collection ) ) trigger_error( fromArray() does not use 'new static' ) Expected result: I would have expected that function returned an instance of FixedCollection. -- Edit bug report at https://bugs.php.net/bug.php?id=55128edit=1 -- Try a snapshot (PHP 5.2): https://bugs.php.net/fix.php?id=55128r=trysnapshot52 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55128r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55128r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55128r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55128r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55128r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55128r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55128r=needscript Try newer version: https://bugs.php.net/fix.php?id=55128r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55128r=support Expected behavior: https://bugs.php.net/fix.php?id=55128r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55128r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55128r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55128r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55128r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=55128r=dst IIS Stability: https://bugs.php.net/fix.php?id=55128r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55128r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55128r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55128r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55128r=mysqlcfg Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55128r=trysnapshot54
#49280 [NEW]: Not possible to detect mysqlnd in php
From: ar at ez dot no Operating system: All PHP version: 5.3.0 PHP Bug Type: MySQLi related Bug description: Not possible to detect mysqlnd in php Description: There doesn't seem to be possible to cleanly* detect that mysqlnd is currently in use. * Constant would be nice, preferably already in 5.3.next Detecting by presence off 'mysqli_fetch_all' or other functions is not exactly clean. Use case: Disabling / enabling Persistent Connections based on application specific settings. See: http://issues.ez.no/IssueView.php?Id=15315 -- Edit bug report at http://bugs.php.net/?id=49280edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49280r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49280r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49280r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49280r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49280r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49280r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49280r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49280r=needscript Try newer version: http://bugs.php.net/fix.php?id=49280r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49280r=support Expected behavior: http://bugs.php.net/fix.php?id=49280r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49280r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49280r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49280r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49280r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=49280r=dst IIS Stability: http://bugs.php.net/fix.php?id=49280r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49280r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49280r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49280r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49280r=mysqlcfg
#49280 [Com]: Not possible to detect mysqlnd in php
ID: 49280 Comment by: ar at ez dot no Reported By: ar at ez dot no Status: Open Bug Type: MySQLi related Operating System: All PHP Version: 5.3.0 New Comment: Seems to be possible with something like this as well: strpos( mysqli_get_client_info(), 'mysqlnd ' ) !== false But constant would still be a bit cleaner. Previous Comments: [2009-08-17 14:10:00] ar at ez dot no Description: There doesn't seem to be possible to cleanly* detect that mysqlnd is currently in use. * Constant would be nice, preferably already in 5.3.next Detecting by presence off 'mysqli_fetch_all' or other functions is not exactly clean. Use case: Disabling / enabling Persistent Connections based on application specific settings. See: http://issues.ez.no/IssueView.php?Id=15315 -- Edit this bug report at http://bugs.php.net/?id=49280edit=1
#49280 [Com]: Not possible to detect mysqlnd in php
ID: 49280 Comment by: ar at ez dot no Reported By: ar at ez dot no Status: Feedback Bug Type: MySQLi related Operating System: * PHP Version: 5.3.0 New Comment: Hi jani! I'm not trying to workaround anything, its just that Persistent Connections are only supported on mysqli when mysqlnd is used. So it doesn't help to detect php version using PHP_VERSION, as the end user might have mysqlnd disabled / not compiled in. It is possible to detect it by by using function_exists. But since you guys might add those extra mysqlnd functions to the other mysql driver as well, that is not reliable not to mention clean. see: http://no.php.net/mysqli.mysqlnd For what I'm trying to do: eZ Publish like other php projects abstracts things, one of those is Persistent connection, witch is abstracted into a ini setting (changeable in admin gui). So I need to prepend p: IF user has mysqlnd, or trow a warning about unsupported setting. Previous Comments: [2009-08-17 14:30:15] j...@php.net So you want to circumvent a bug by adding a constant instead of fixing the actual bug? Can you please explain WHAT does not work like it should when you have enabled mysqlnd..? [2009-08-17 14:21:35] ar at ez dot no Seems to be possible with something like this as well: strpos( mysqli_get_client_info(), 'mysqlnd ' ) !== false But constant would still be a bit cleaner. [2009-08-17 14:10:00] ar at ez dot no Description: There doesn't seem to be possible to cleanly* detect that mysqlnd is currently in use. * Constant would be nice, preferably already in 5.3.next Detecting by presence off 'mysqli_fetch_all' or other functions is not exactly clean. Use case: Disabling / enabling Persistent Connections based on application specific settings. See: http://issues.ez.no/IssueView.php?Id=15315 -- Edit this bug report at http://bugs.php.net/?id=49280edit=1
#49280 [Fbk-Opn]: Not possible to detect mysqlnd in php
ID: 49280 User updated by: ar at ez dot no Reported By: ar at ez dot no -Status: Feedback +Status: Open Bug Type: MySQLi related Operating System: * PHP Version: 5.3.0 New Comment: see above comment. Previous Comments: [2009-08-17 14:53:12] ar at ez dot no Hi jani! I'm not trying to workaround anything, its just that Persistent Connections are only supported on mysqli when mysqlnd is used. So it doesn't help to detect php version using PHP_VERSION, as the end user might have mysqlnd disabled / not compiled in. It is possible to detect it by by using function_exists. But since you guys might add those extra mysqlnd functions to the other mysql driver as well, that is not reliable not to mention clean. see: http://no.php.net/mysqli.mysqlnd For what I'm trying to do: eZ Publish like other php projects abstracts things, one of those is Persistent connection, witch is abstracted into a ini setting (changeable in admin gui). So I need to prepend p: IF user has mysqlnd, or trow a warning about unsupported setting. [2009-08-17 14:30:15] j...@php.net So you want to circumvent a bug by adding a constant instead of fixing the actual bug? Can you please explain WHAT does not work like it should when you have enabled mysqlnd..? [2009-08-17 14:21:35] ar at ez dot no Seems to be possible with something like this as well: strpos( mysqli_get_client_info(), 'mysqlnd ' ) !== false But constant would still be a bit cleaner. [2009-08-17 14:10:00] ar at ez dot no Description: There doesn't seem to be possible to cleanly* detect that mysqlnd is currently in use. * Constant would be nice, preferably already in 5.3.next Detecting by presence off 'mysqli_fetch_all' or other functions is not exactly clean. Use case: Disabling / enabling Persistent Connections based on application specific settings. See: http://issues.ez.no/IssueView.php?Id=15315 -- Edit this bug report at http://bugs.php.net/?id=49280edit=1
#49280 [Opn]: ext/mysqlnd: Not possible to detect mysqlnd in php
ID: 49280 User updated by: ar at ez dot no Reported By: ar at ez dot no Status: Open Bug Type: Feature/Change Request Operating System: * PHP Version: 5.3.0 New Comment: And you really should be checking if mysql*.allow_persistent is on or off anyway We don't need hide php warnings, so if php trows a understandable warning in such a case, then that would be sufficient. So, for my use case this is not valid anymore then, Thanks;) But as long as mysqlnd behaves differently then the old mysql client, I would vote for such a constant anyway. Or you can close with reference to the first comment(2:21) on how to detect mysqlnd if you absolutely need to know about it in code. Previous Comments: [2009-08-17 17:18:45] j...@php.net p: is allowed always since PHP 5.3.0. You only get a warning when someone has disabled persistent connections with mysqli.allow_persistent ini option. You don't need to know whether it's mysqlnd or libmysql that is used. And you really should be checking if mysql*.allow_persistent is on or off anyway. :) [2009-08-17 14:53:12] ar at ez dot no Hi jani! I'm not trying to workaround anything, its just that Persistent Connections are only supported on mysqli when mysqlnd is used. So it doesn't help to detect php version using PHP_VERSION, as the end user might have mysqlnd disabled / not compiled in. It is possible to detect it by by using function_exists. But since you guys might add those extra mysqlnd functions to the other mysql driver as well, that is not reliable not to mention clean. see: http://no.php.net/mysqli.mysqlnd For what I'm trying to do: eZ Publish like other php projects abstracts things, one of those is Persistent connection, witch is abstracted into a ini setting (changeable in admin gui). So I need to prepend p: IF user has mysqlnd, or trow a warning about unsupported setting. [2009-08-17 14:30:15] j...@php.net So you want to circumvent a bug by adding a constant instead of fixing the actual bug? Can you please explain WHAT does not work like it should when you have enabled mysqlnd..? [2009-08-17 14:21:35] ar at ez dot no Seems to be possible with something like this as well: strpos( mysqli_get_client_info(), 'mysqlnd ' ) !== false But constant would still be a bit cleaner. [2009-08-17 14:10:00] ar at ez dot no Description: There doesn't seem to be possible to cleanly* detect that mysqlnd is currently in use. * Constant would be nice, preferably already in 5.3.next Detecting by presence off 'mysqli_fetch_all' or other functions is not exactly clean. Use case: Disabling / enabling Persistent Connections based on application specific settings. See: http://issues.ez.no/IssueView.php?Id=15315 -- Edit this bug report at http://bugs.php.net/?id=49280edit=1