#49515 [Com]: Class members with the same name ought to raise an E_STRICT error or notice.
ID: 49515 Comment by: oorza2k5 at gmail dot com Reported By: oorza2k5 at gmail dot com Status: Open Bug Type: Feature/Change Request Operating System: Irrelevant PHP Version: 5.3.0 New Comment: Any chance this gets looked at? Previous Comments: [2009-09-09 20:56:41] oorza2k5 at gmail dot com Description: When you store a closure as a class property, while having a method with the same name, it's unclear (I don't think this is documented anywhere) what $obj->name($arg) will do. If this is the case, a warning about code ambiguity ought to be raised. This is a potentially very confusing scenario, perhaps an E_STRICT error ought to be raised whenever two class members share the same name, regardless of whether a property contains a closure or not. Reproduce code: --- class foo { public $bar; public function bar() { echo "Inside a method!"; } } $obj = new foo(); $obj->bar = function() { echo "Inside a closure!"; }; $obj->bar(); Expected result: Notice: Inside a method! Actual result: -- Inside a method! -- Edit this bug report at http://bugs.php.net/?id=49515&edit=1
#50355 [NEW]: Trying to access a magical property by reference only raises an E_NOTICE.
From: oorza2k5 at gmail dot com Operating system: Irrelevant PHP version: 5.3.1 PHP Bug Type: *General Issues Bug description: Trying to access a magical property by reference only raises an E_NOTICE. Description: When trying to access a magically returned (via __get()) property of a class, only an E_NOTICE is raised. While a function like array_pop will return a value (without modifying the overloaded property), some other operations will have less predictable results, such as array access via the "[]" syntax. Because a lot of distributions ship with a "$something | ~E_NOTICE" level of error reporting, and the "black box" ideas of object oriented programming (a developer trying to push an element onto a member array in an API class, for instance), this could be a very hard circumstance to debug. Furthermore, any case I can think of where this notice will be raised will never perform as expected, it will force the developer to re-engineer his solution. Because any case where this error would be raised will force a rewrite, I think that this circumstance should raise a fatal error instead. The fix is trivial enough that I did not attach a patch, but would be glad to in the future, if necessary. Reproduce code: --- $var; } } $inst = new foo(); var_dump(array_pop($inst->bar)); Expected result: PHP Fatal Error: Indirect modification of overloaded property foo::$bar has no effect in /home/blahblah/test.php on line 10 Actual result: -- PHP Notice: Indirect modification of overloaded property foo::$bar has no effect in /home/blahblah/test.php on line 10 -- Edit bug report at http://bugs.php.net/?id=50355&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50355&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50355&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50355&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50355&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50355&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50355&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50355&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50355&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50355&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50355&r=support Expected behavior: http://bugs.php.net/fix.php?id=50355&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50355&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50355&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50355&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50355&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=50355&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50355&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50355&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50355&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50355&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50355&r=mysqlcfg
#49516 [NEW]: Serializing a closure throws an exception
From: oorza2k5 at gmail dot com Operating system: irrelevant PHP version: 5.3.0 PHP Bug Type: Class/Object related Bug description: Serializing a closure throws an exception Description: As far as I'm aware, exceptions are not supposed to be thrown by default, but rather errors are supposed to be raised. Serializing a closure throws an exception, when it should be raising an E_ERROR instead. Reproduce code: --- http://bugs.php.net/?id=49516&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49516&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49516&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49516&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49516&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49516&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49516&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49516&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49516&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49516&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49516&r=support Expected behavior: http://bugs.php.net/fix.php?id=49516&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49516&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49516&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49516&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49516&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=49516&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49516&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49516&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49516&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49516&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49516&r=mysqlcfg
#49515 [NEW]: Class members with the same name ought to raise an E_STRICT error or notice.
From: oorza2k5 at gmail dot com Operating system: Irrelevant PHP version: 5.3.0 PHP Bug Type: Scripting Engine problem Bug description: Class members with the same name ought to raise an E_STRICT error or notice. Description: When you store a closure as a class property, while having a method with the same name, it's unclear (I don't think this is documented anywhere) what $obj->name($arg) will do. If this is the case, a warning about code ambiguity ought to be raised. This is a potentially very confusing scenario, perhaps an E_STRICT error ought to be raised whenever two class members share the same name, regardless of whether a property contains a closure or not. Reproduce code: --- class foo { public $bar; public function bar() { echo "Inside a method!"; } } $obj = new foo(); $obj->bar = function() { echo "Inside a closure!"; }; $obj->bar(); Expected result: Notice: Inside a method! Actual result: -- Inside a method! -- Edit bug report at http://bugs.php.net/?id=49515&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49515&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49515&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49515&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49515&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49515&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49515&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49515&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49515&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49515&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49515&r=support Expected behavior: http://bugs.php.net/fix.php?id=49515&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49515&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49515&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49515&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49515&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=49515&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49515&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49515&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49515&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49515&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49515&r=mysqlcfg
#49175 [NEW]: mod_files.sh patch
From: oorza2k5 at gmail dot com Operating system: *nix PHP version: 5.3.0 PHP Bug Type: Session related Bug description: mod_files.sh patch Description: here's a script, mod_files.sh, in ext/session for creating directory tree with depth X for sessions. As it stands, it's pretty poorly documented and very basic. I got exceptionally bored and rewrote most of it, the patch is attached. It runs fine for me in linux (with sh version 4.0). I don't have any other *NIX systems to test it out on, so I can't verify that it works in anything but linux, sorry. What I changed: 1. Usage now properly reflects arguments, and is better explained. 2. Will create directory given if it doesn't exist 3. Will hop into interactive select if directory already has contents 4. Switched from "test" to "[[ ]]" as it's easier to read and _should_ be just as supported. Reproduce code: --- Patch is available at http://pastebin.ca/1520039 Expected result: (Old behavior) $ sh mod_files.sh usage: mod_files.sh basedir depth $ sh mod_files.sh /foo 3 mod_files.sh: line 13: test: : integer expression expected mkdir: cannot create directory `/foo/0': No such file or directory Actual result: -- (New behavior) $ sh mod_files.sh Usage: mod_files.sh BASE_DIRECTORY DEPTH MAJOR_PHP_VERSION BASE_DIRECTORY will be created if it doesn't exist DEPTH must be an integer number >0 MAJOR_PHP_VERSION should be one of 4, 5, or 6 $sh mod_files.sh /foo 3 5 Directory /foo is not empty! What would you like to do? 1) Delete directory contents 3) Quit 2) Choose another directory #? 1 Deleting /foo contents... Creating session path in /foo with a depth of 3 for PHP Version 5.X -- Edit bug report at http://bugs.php.net/?id=49175&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49175&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49175&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49175&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49175&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49175&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49175&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49175&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49175&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49175&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49175&r=support Expected behavior: http://bugs.php.net/fix.php?id=49175&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49175&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49175&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49175&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49175&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=49175&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49175&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49175&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49175&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49175&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49175&r=mysqlcfg
#47840 [Com]: __call ignored when extending PDO
ID: 47840 Comment by: oorza2k5 at gmail dot com Reported By: oorza2k5 at gmail dot com Status: Feedback Bug Type: PDO related Operating System: Linux PHP Version: 5.2.9 New Comment: It works as expected in the latest CVS under Windows... I don't have a non-production Linux install to test with, so if someone else could verify it's fixed in CVS (under Linux), that'd be great. Previous Comments: [2009-03-30 16:48:36] fel...@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ [2009-03-30 16:45:08] oorza2k5 at gmail dot com Description: Exact same issue (that was supposedly resolved) as #44425, but now with a MySQL 5.1 database. __call() doesn't do anything when extending PDO. This bug is clearly not fixed. Reproduce code: --- Reproduce code: --- '; } function foo() { echo "Called foo in ".__CLASS__.''; } } $a = new test('mysql:dbname=test;host=localhost','user','pw'); $a->foo(); $a->bar(); ?> Expected result: "Called foo in test Called bar in test" Actual result: -- Called foo in test Fatal error: Call to undefined method test::bar() in test4.php on line 12 -- Edit this bug report at http://bugs.php.net/?id=47840&edit=1
#47840 [NEW]: __call ignored when extending PDO
From: oorza2k5 at gmail dot com Operating system: Linux PHP version: 5.2.9 PHP Bug Type: PDO related Bug description: __call ignored when extending PDO Description: Exact same issue (that was supposedly resolved) as #44425, but now with a MySQL 5.1 database. __call() doesn't do anything when extending PDO. This bug is clearly not fixed. Reproduce code: --- Reproduce code: --- '; } function foo() { echo "Called foo in ".__CLASS__.''; } } $a = new test('mysql:dbname=test;host=localhost','user','pw'); $a->foo(); $a->bar(); ?> Expected result: "Called foo in test Called bar in test" Actual result: -- Called foo in test Fatal error: Call to undefined method test::bar() in test4.php on line 12 -- Edit bug report at http://bugs.php.net/?id=47840&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47840&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47840&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47840&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47840&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47840&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47840&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47840&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47840&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47840&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47840&r=support Expected behavior: http://bugs.php.net/fix.php?id=47840&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47840&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47840&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47840&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47840&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=47840&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47840&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47840&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47840&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47840&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47840&r=mysqlcfg