[GH-ISSUE #828] Recursion on GLOBALS variable in NormalizerFormatter #320

Closed
opened 2026-03-04 02:14:06 +03:00 by kerem · 0 comments
Owner

Originally created by @Programie on GitHub (Jul 28, 2016).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/828

The NormalizerFormatter tries to normalise the GLOBALS variable which is passed in the context array in the ErrorHandler.

Normalising the GLOBALS variable ends in a recursion as the array contains an element "GLOBALS" referring to itself.

Example output of var_dump($GLOBALS) (which correctly handles recursion):

array(8) {
  ["_GET"]=>
  array(0) {
  }
  ["_POST"]=>
  array(0) {
  }
  ["_COOKIE"]=>
  array(0) {
  }
  ["_FILES"]=>
  array(0) {
  }
...
  ["GLOBALS"]=>
  *RECURSION*
}

Of course, this also affects passing other context variables containing recursive references. But using the ErrorHandler, this always seems to be a problem.

Originally created by @Programie on GitHub (Jul 28, 2016). Original GitHub issue: https://github.com/Seldaek/monolog/issues/828 The NormalizerFormatter tries to normalise the GLOBALS variable which is passed in the context array in the ErrorHandler. Normalising the GLOBALS variable ends in a recursion as the array contains an element "GLOBALS" referring to itself. Example output of `var_dump($GLOBALS)` (which correctly handles recursion): ``` array(8) { ["_GET"]=> array(0) { } ["_POST"]=> array(0) { } ["_COOKIE"]=> array(0) { } ["_FILES"]=> array(0) { } ... ["GLOBALS"]=> *RECURSION* } ``` Of course, this also affects passing other context variables containing recursive references. But using the ErrorHandler, this always seems to be a problem.
kerem closed this issue 2026-03-04 02:14:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#320
No description provided.