gdimage_prevent_serialization.phpt 351 B

1234567891011121314151617
  1. --TEST--
  2. GdImage instances must not be serialized
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. $img_src = imagecreatetruecolor(32, 32);
  8. var_dump(serialize($img_src));
  9. ?>
  10. --EXPECTF--
  11. Fatal error: Uncaught Exception: Serialization of 'GdImage' is not allowed in %s:%d
  12. Stack trace:
  13. #0 %s(%d): serialize(Object(GdImage))
  14. #1 {main}
  15. thrown in %s on line %d