Skip to content

Error: Undefined offset: 1 in PHPInfo.php line 54 #1

@ZeroThe2nd

Description

@ZeroThe2nd

Using the following code in a function:

ob_start();
phpinfo();
$phpinfoAsString = ob_get_contents();
ob_get_clean();

$phpInfo = new PHPInfo();
$phpInfo->setText($phpinfoAsString);
return response()->json($phpInfo->get());

Results in an "Undefined offset: 1 in PHPInfo.php line 54" which is being triggered by the last line where $phpInfo->get() is being called as part of the response.

The code is running from a Lumen controller (Laravel API).
Versions:
"Lumen": "Lumen (5.6.4) (Laravel Components 5.6.*)",
"PHP": "7.1.19"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions