Viewing File: /opt/alt/tests/alt-php80-pecl-igbinary_3.2.15-1.el8/tests/__serialize_002.phpt

--TEST--
__serialize() mechanism (002): TypeError on invalid return type
--SKIPIF--
<?php if (PHP_VERSION_ID < 70400) { echo "skip __serialize/__unserialize not supported in php < 7.4 for compatibility with serialize()"; } ?>
--FILE--
<?php

class Test {
    public function __serialize() {
        return $this;
    }
}

try {
    igbinary_serialize(new Test);
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}

?>
--EXPECT--
Test::__serialize() must return an array
Back to Directory File Manager
<