summaryrefslogtreecommitdiff
path: root/ext/standard/tests/serialize/serialization_objects_010.phpt
blob: 7a97bb38afed7d8e2d5bd691379b60a84b4535c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Serialize() must return a string or NULL
--FILE--
<?php
Class C implements Serializable {
    public function serialize() {
        return $this;
    }

    public function unserialize($blah) {
    }
}

try {
    var_dump(serialize(new C));
} catch (Exception $e) {
    echo $e->getMessage(). "\n";
}

echo "Done";
?>
--EXPECT--
C::serialize() must return a string or NULL
Done