Edit report at https://bugs.php.net/bug.php?id=40459&edit=1
ID: 40459 Updated by: s...@php.net Reported by: clay at killersoft dot com Summary: Stat and Dir stream wrapper methods do not call constructor Status: Re-Opened Type: Bug Package: Streams related Operating System: irrelevant PHP Version: 5.2.1 Assigned To: stas Block user comment: N Private report: N New Comment: See also: https://github.com/php/php-src/pull/93 Previous Comments: ------------------------------------------------------------------------ [2012-05-04 12:47:27] jschipp...@php.net I believe this issue is still present. I have attached a test case to demonstrate the problem. When looking at main/streams/userspace.c, it is clear that only in user_wrapper_opener() the constructor of the user space class is called (the "if (uwrap->ce->constructor) {}" block). ------------------------------------------------------------------------ [2012-05-04 12:46:05] jschipp...@php.net The following patch has been added/updated: Patch Name: bug-40459 Revision: 1336135565 URL: https://bugs.php.net/patch-display.php?bug=40459&patch=bug-40459&revision=1336135565 ------------------------------------------------------------------------ [2008-07-21 01:00:02] 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-07-13 15:56:45] j...@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi ------------------------------------------------------------------------ [2007-02-13 07:01:33] clay at killersoft dot com Description: ------------ The following methods in a userspace stream wrapper will not call the constructor: url_stat() dir_opendir() rmdir() mkdir() rename() unlink() Reproduce code: --------------- http://killersoft.com/misc/Test_Stream.php.txt Expected result: ---------------- Any time a line of output beginning with '== [method] CALLED' appears, that line should contain an 'obj: ' value with a uniqid value, indicating that the constructor was called. Actual result: -------------- == dir_opendir METHOD CALLED (obj: ) == ... == dir_readdir METHOD CALLED (obj: ) == ... == dir_closedir METHOD CALLED (obj: ) == ... == url_stat METHOD CALLED (obj: ) == ... == mkdir METHOD CALLED (obj: ) == ... == rmdir METHOD CALLED (obj: ) == ... == unlink METHOD CALLED (obj: ) == ... == rename METHOD CALLED (obj: ) == ... ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=40459&edit=1