Re: [PHP-DEV] Change of $depth behaviour in json_encode() on PHP 8.1

2021-10-17 Thread Benjamin Morel
> > > This is a bug. Please report it on https://bugs.php.net/ > > See https://3v4l.org/vFgh0 > > https://github.com/php/php-src/commit/f9f8c1c79cac1b03279190e0c5513a51881615f9 > https://github.com/php/php-src/pull/6811 > > Best Regards, > Kamil > Thank you! Reported as

Re: [PHP-DEV] Change of $depth behaviour in json_encode() on PHP 8.1

2021-10-17 Thread Kamil Tekiela
Hi Benjamin, This is a bug. Please report it on https://bugs.php.net/ See https://3v4l.org/vFgh0 https://github.com/php/php-src/commit/f9f8c1c79cac1b03279190e0c5513a51881615f9 https://github.com/php/php-src/pull/6811 Best Regards, Kamil

[PHP-DEV] Change of $depth behaviour in json_encode() on PHP 8.1

2021-10-17 Thread Benjamin Morel
Hi internals, I noticed a change of behaviour on PHP 8.1: https://3v4l.org/DoG4A ``` // depth 1 $a = new \stdClass(); // depth 2 $b = new \stdClass(); $b->x = $a; // depth 3 $c = new \stdClass(); $c->x = [$a]; var_export(json_encode($a, 0, 0)); echo "\n"; var_export(json_encode($b, 0, 1));