php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77916 Phar documentation example bug
Submitted: 2019-04-18 08:22 UTC Modified: 2019-04-18 08:34 UTC
From: jurrien dot dokter at springdigital dot nl Assigned: cmb (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2019-04-18 08:22 UTC] jurrien dot dokter at springdigital dot nl
Description:
------------
---
From manual page: https://php.net/phar.using.intro
---

---
$p->buildFromIterator(new RecursiveIteratorIterator(new DirectoryIterator('/path/to/project')), '/path/to/');
---

This needs to be replaced with

---
$p->buildFromIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator('/path/to/project')), '/path/to/');
---

Otherwise it'll give a pretty fatal error.

> Uncaught InvalidArgumentException: An instance of RecursiveIterator or IteratorAggregate creating it is required


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-18 08:33 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=347277
Log: Fix #77916: Phar documentation example bug
 [2019-04-18 08:34 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2019-04-18 08:34 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2019-04-18 08:35 UTC] salathe@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=5c3815de3e6c66ea1f5f463099d3bcf2c3eef195
Log: Fix #77916: Phar documentation example bug
 [2020-02-07 06:05 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=c5345ba69bf8a0905b6020a0497ce22c969c70bd
Log: Fix #77916: Phar documentation example bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 10:01:29 2024 UTC