1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00
Files
archived-php-src/ext/gd/tests/gdimage_prevent_serialization.phpt
T
2020-02-03 22:52:20 +01:00

22 lines
429 B
PHP

--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