Bug #81048 [Ver->Csd]: Regression from #80915 - phpinfo(INFO_VARIABLES) "Array to string conversion"
Edit report at https://bugs.php.net/bug.php?id=81048&edit=1
ID: 81048
Updated by: git@php.net
Reported by: webmaster at deltik dot org
Summary: Regression from #80915 - phpinfo(INFO_VARIABLES)
"Array to string conversion"
-Status: Verified
+Status: Closed
Type: Bug
Package: Arrays related
Operating System: Ubuntu 20.04
PHP Version: 7.4.18
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb69
Revision: https://github.com/php/php-src/commit/36b9bdeeeca066909e2fd687dc5a2089b0112bb0
Log: Fix #81048: phpinfo(INFO_VARIABLES) "Array to string conversion"
Previous Comments:
------------------------------------------------------------------------
[2021-05-19 10:10:32] cmb@php.net
The following pull request has been associated:
Patch Name: Fix #81048: phpinfo(INFO_VARIABLES) "Array to string conversion"
On GitHub: https://github.com/php/php-src/pull/7014
Patch: https://github.com/php/php-src/pull/7014.patch
------------------------------------------------------------------------
[2021-05-19 09:46:47] cmb@php.net
Prior to fixing bug #80915, argv would have been omitted from the
ouput for the given script.
------------------------------------------------------------------------
[2021-05-18 23:24:03] webmaster at deltik dot org
Description:
------------
The fix for https://bugs.php.net/bug.php?id=80915 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:
https://github.com/php/php-src/commit/206fd35a98375522a53818ec4ef6e0585b1055dd
Test script:
---------------
<?php
error_reporting(E_ALL);
ini_set("display_errors", "On");
array_walk($_SERVER, function($value, $key) {
// NOOP
});
phpinfo(INFO_VARIABLES);
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
phpinfo()
PHP Variables
Variable => Value
⦠[ TRUNCATED ] â¦
$_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
Array
$_SERVER['argc'] => 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81048&edit=1
Thread (4 messages)