1--TEST--
2Cloning and serializing finfo is not supported
3--EXTENSIONS--
4fileinfo
5--FILE--
6<?php
7
8$finfo = new finfo;
9var_dump($finfo->buffer("Test string"));
10try {
11    $finfo2 = clone $finfo;
12    var_dump($finfo2->buffer("Test string"));
13} catch (Error $e) {
14    echo $e->getMessage(), "\n";
15}
16try {
17    $finfo3 = unserialize(serialize($finfo));
18    var_dump($finfo3->buffer("Test string"));
19} catch (Exception $e) {
20    echo $e->getMessage(), "\n";
21}
22
23?>
24--EXPECTF--
25string(%d) "%s"
26Trying to clone an uncloneable object of class finfo
27Serialization of 'finfo' is not allowed
28