Doc #80942 [Opn->Csd]: Example for object implementing Iterator is incorrect / misleading
Edit report at https://bugs.php.net/bug.php?id=80942&edit=1
ID: 80942
Updated by: cmb@php.net
Reported by: php-bugs at allenjb dot me dot uk
Summary: Example for object implementing Iterator is
incorrect / misleading
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Fixed as <https://github.com/php/doc-en/commit/1fb0ef23d7be0d8ecd9604fce16ee1e0842c6ef6>.
Previous Comments:
------------------------------------------------------------------------
[2021-04-09 16:33:15] php-bugs at allenjb dot me dot uk
I've submitted a PR: https://github.com/php/doc-en/pull/517
------------------------------------------------------------------------
[2021-04-08 17:04:50] php-bugs at allenjb dot me dot uk
Description:
------------
---
From manual page: https://php.net/language.oop5.iterations
---
The example for an object implementing Iterator on this page has every method, including next()
returning a value, but the return types on these methods don't allow this.
While this "works", it will cause static analysis to hilight these as errors.
Additionally, the example here feels duplicitous - would it not be better to simply link to https://www.php.net/manual/en/class.iterator.php
which already has a very similar (and more correctly implemented) example?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80942&edit=1
Thread (3 messages)