1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-30 08:21:05 +02:00

Normalization of arrays containing self references (#1050)

Backport normalization fix from master to 1.x
This commit is contained in:
Andrew Berry
2018-06-17 11:27:33 -04:00
committed by Jordi Boggiano
parent 6e1793e966
commit 0d993d84d1
4 changed files with 23 additions and 6 deletions

View File

@@ -193,6 +193,15 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(@json_encode(array($foo, $bar)), $res);
}
public function testCanNormalizeReferences()
{
$formatter = new NormalizerFormatter();
$x = array('foo' => 'bar');
$y = array('x' => &$x);
$x['y'] = &$y;
$formatter->format($y);
}
public function testIgnoresInvalidTypes()
{
// set up the recursion