|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81048 Regression from #80915 - phpinfo(INFO_VARIABLES) "Array to string conversion"
Submitted: 2021-05-18 23:24 UTC Modified: 2021-05-19 10:10 UTC
From: webmaster at deltik dot org Assigned: cmb (profile)
Status: Closed Package: Arrays related
PHP Version: 7.4.18 OS: Ubuntu 20.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: webmaster at deltik dot org
New email:
PHP Version: OS:


 [2021-05-18 23:24 UTC] webmaster at deltik dot org
The fix for introduced a regression where phpinfo(INFO_VARIABLES) will emit an E_NOTICE reading:

> PHP Notice:  Array to string conversion …

This happens if array_walk() iterates over $_SERVER prior to phpinfo().

The regression was introduced in:
* PHP 8.0.5
* PHP 7.4.18

The commit that introduced the regression:

Test script:
ini_set("display_errors", "On");

array_walk($_SERVER, function($value, $key) {
        // NOOP

Expected result:
In the output, no match for the following string:

"Notice:  Array to string conversion"

Actual result:
PHP Notice:  Array to string conversion in /tmp/php-bug/bug.php on line 8
PHP Stack trace:
PHP   1. {main}() /tmp/php-bug/bug.php:0
PHP   2. phpinfo($what = 32) /tmp/php-bug/bug.php:8

PHP Variables

Variable => Value
$_SERVER['argv'] => 
Notice: Array to string conversion in /tmp/php-bug/bug.php on line 8

Call Stack:
    0.0001     405000   1. {main}() /tmp/php-bug/bug.php:0
    0.0001     417176   2. phpinfo($what = 32) /tmp/php-bug/bug.php:8

$_SERVER['argc'] => 1


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-05-19 09:46 UTC]
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2021-05-19 09:46 UTC]
Prior to fixing bug #80915, argv would have been omitted from the
ouput for the given script.
 [2021-05-19 10:10 UTC]
-PHP Version: 8.0.6 +PHP Version: 7.4.18
 [2021-05-19 10:10 UTC]
The following pull request has been associated:

Patch Name: Fix #81048: phpinfo(INFO_VARIABLES) "Array to string conversion"
On GitHub:
 [2021-05-19 12:11 UTC]
Automatic comment on behalf of cmb69
Log: Fix #81048: phpinfo(INFO_VARIABLES) &quot;Array to string conversion&quot;
 [2021-05-19 12:11 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 25 14:03:45 2021 UTC