php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #61078 Just a little mistake in the example
Submitted: 2012-02-13 22:36 UTC Modified: 2013-02-28 21:18 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: tomek at rychtyk dot pl Assigned: jeanseb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Win 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tomek at rychtyk dot pl
New email:
PHP Version: OS:

 

 [2012-02-13 22:36 UTC] tomek at rychtyk dot pl
Description:
------------
---
From manual page: http://www.php.net/function.array-product#refsect1-function.array-product-examples
---

I think there is a mistake in the example on that page as the following:

echo "product(array()) = " . array_product(array()) . "\n";

will display:
product(array()) = 0 

not:
product(array()) = 1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-14 09:41 UTC] phpmpan at mpan dot pl
r306288 changed this behaviour. As of 5.3.6 array_product returns 1, as expected.

A warning should be added to the documentation for versions before 5.3.6.
 [2013-02-28 21:18 UTC] jeanseb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: jeanseb
 [2013-02-28 21:18 UTC] jeanseb@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.

Fixed in rev329577.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 03:00:02 2026 UTC