Re: svn: /php/php-src/branches/PHP_5_3/ NEWS ext/spl/spl_directory.c ext/spl/spl_iterators.c ext/spl/tests/bug54384.phpt
ext/spl/tests/iterator_031.phpt
| From: | Gustavo Lopes | Date: | Mon, 25 Apr 2011 14:28:52 +0000 |
| Subject: | Re: svn: /php/php-src/branches/PHP_5_3/ NEWS ext/spl/spl_directory.c ext/spl/spl_iterators.c ext/spl/tests/bug54384.phpt ext/spl/tests/iterator_031.phpt |
||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-64840@lists.php.net to get a copy of this message | ||
On Mon, 25 Apr 2011 12:32:04 +0100, Hannes Magnusson <hannes.magnusson@gmail.com> wrote:
2011/4/4 Gustavo André dos Santos Lopes <cataphract@php.net>:The "best way" is always a weighted combination of several factors (BC impact, maintainability, consistency, effort, performance, etc.), and those weights are subjective. In case of this type of bug (userspace subclass doesn't call native super constructor), I used a constructor wrapper in trunk, which is, I think the best option because it executes the check only once and as soon as currently possible (when the object is created). However, this represents a BC break because userspace classes that used to call the super constructor at a later time will no longer work. So I went with another solution for 5.3. The dual iterators got a check on each object fetch from the store because that technique was already being used in spl_iterators.c. However, this technique is tedious and error prone because it requires a change in every instance method, so in spl_directory.c I used a centralized the check in the get_method handler; this technique was already used in SPL the difference is it would emit an error instead of causing an exception to be thrown. -- Gustavo LopesUhm.. Whats the dealio with that new method? Is that really the best way to fix it?cataphract Mon, 04 Apr 2011 02:50:27 +0000Revision: http://svn.php.net/viewvc?view=revision&revision=309929 Log: - Fixed bug #54384 (Dual iterators, GlobIterator, SplFileObject and SplTempFileObject crash when user-space classes don't call the paren constructor). Bug: http://bugs.php.net/54384 (Assigned) Several SPL classes crash when parent constructor is not called