Bug #77903 [Csd]: ArrayIterator stops iterating after offsetSet call
| From: | gituser at yandex dot com | Date: | Tue, 16 Apr 2019 13:19:46 +0000 |
| Subject: | Bug #77903 [Csd]: ArrayIterator stops iterating after offsetSet call | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-220481@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77903&edit=1
ID: 77903
User updated by: gituser at yandex dot com
Reported by: gituser at yandex dot com
Summary: ArrayIterator stops iterating after offsetSet call
Status: Closed
Type: Bug
Package: SPL related
Operating System: Ubuntu 18.10 (64-bit)
PHP Version: 7.3.4
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
hmm... it seems that the php bugtracker itself has a bug and doesn't recognize the period if it
is in the end of the post (it hasn't though, as the specs allows that). you may report it if
you want :) (i won't - i feel too lazy for that :)
Previous Comments:
------------------------------------------------------------------------
[2019-04-16 13:15:46] gituser at yandex dot com
btw, when you post a uri in plain text, make sure that you don't put any non-space char in the
immediate vicinity of it. e.g. if you want to put a period directly after this uri, don't
forget to add a space between them. the uri specification forbids space chars, thus the uri parser
will detect that the period isn't part of the uri. and if you don't, it may decide that
the period IS its part (since the uri specification allows that), thus breaking your uri. e.g. the
uri you provided https://github.com/php/php-src/commit/9a9eed472b05292f8e8aa82129ea5d1da4b0e0c2.
returns the 404 status code. it wouldn't if there was a space: https://github.com/php/php-src/commit/9a9eed472b05292f8e8aa82129ea5d1da4b0e0c2
.
------------------------------------------------------------------------
[2019-04-16 13:14:46] nikic@php.net
@gituser: A regression test for this issue has been added when the bug was fixed, see https://github.com/php/php-src/blob/master/ext/spl/tests/bug77903.phpt.
PHP does not use unit tests, all tests are integration tests.
As to why this was not spotted by any of the existing tests: None of them were testing the exact
sequence of operations necessary to trigger this bug.
------------------------------------------------------------------------
[2019-04-16 13:05:02] gituser at yandex dot com
nikic@php.net i'm sure such a regression could be easily detected by a unit test. how did it
happen that it did get to the production code?
don't you think there's a need to unit test this class? if so, where should i post the
request to php devs so that they'd create them? (or do they have some other priorities and
won't do this anyway?)
p.s. idk if you see my comment (the bug is closed after all). if you don't want to answer - at
least say that you've seen it please so that i don't have to repeat it to you email
directly
------------------------------------------------------------------------
[2019-04-16 08:41:33] nikic@php.net
Fixed in https://github.com/php/php-src/commit/e1b4cabbd6d5ce72bb73ec4988b91c1e62c71335
and https://github.com/php/php-src/commit/9a9eed472b05292f8e8aa82129ea5d1da4b0e0c2.
------------------------------------------------------------------------
[2019-04-16 05:41:38] gituser at yandex dot com
Hmm... Looks like SPL_Types https://www.php.net/manual/en/book.spl-types.php
which hasn't been updated for more than 5 years, isn't the same as SPL https://www.php.net/manual/en/book.spl.php
I think I found the correct category now.
------------------------------------------------------------------------
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=77903
--
Edit this bug report at https://bugs.php.net/bug.php?id=77903&edit=1