1--TEST--
2__serialize() mechanism (002): TypeError on invalid return type
3--FILE--
4<?php
5
6class Test {
7    public function __serialize() {
8        return $this;
9    }
10}
11
12try {
13    serialize(new Test);
14} catch (TypeError $e) {
15    echo $e->getMessage(), "\n";
16}
17
18?>
19--EXPECT--
20Test::__serialize() must return an array
21