1--TEST--
2__sleep() can return references
3--FILE--
4<?php
5
6class Test {
7    public $x = 42;
8    public function __sleep() {
9        $name = 'x';
10        return [&$name];
11    }
12}
13
14var_dump(serialize(new Test));
15
16?>
17--EXPECT--
18string(28) "O:4:"Test":1:{s:1:"x";i:42;}"
19