summaryrefslogtreecommitdiff
path: root/ext/gd/tests/gdimage_prevent_serialization.phpt
blob: e1e33127d1d3af1e7dc91c324d742861cc398a47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
GdImage instances must not be serialized
--SKIPIF--
<?php
if(!extension_loaded('gd')) {
    die('skip gd extension is not loaded');
}
?>
--FILE--
<?php

    $img_src = imagecreatetruecolor(32, 32);
    var_dump(serialize($img_src));

?>
--EXPECTF--
Fatal error: Uncaught Exception: Serialization of 'GdImage' is not allowed in %s:%d
Stack trace:
#0 %s(%d): serialize(Object(GdImage))
#1 {main}
  thrown in %s on line %d