Description
Using an anonymous class object with PhpRedis causes a segmentation fault during the serialization flow.
The following code reproduces the issue:
<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
$obj = new class() {};
$redis->set('payload', $obj);
$redis->get('payload');
Expected behavior
PhpRedis should throw a normal PHP exception/error similar to:
Serialization of 'class@anonymous' is not allowed
Actual behavior
PHP crashes with a segmentation fault.
Description
Using an anonymous class object with PhpRedis causes a segmentation fault during the serialization flow.
The following code reproduces the issue:
Expected behavior
PhpRedis should throw a normal PHP exception/error similar to:
Serialization of 'class@anonymous' is not allowedActual behavior
PHP crashes with a segmentation fault.