1--TEST-- 2WeakReference serials 3--FILE-- 4<?php 5$wr = WeakReference::create(new stdClass); 6 7try { 8 serialize($wr); 9} catch (Exception $ex) { 10 var_dump($ex->getMessage()); 11} 12 13$wrs = 'O:13:"WeakReference":0:{}'; 14 15try { 16 var_dump(unserialize($wrs)); 17} catch (Exception $ex) { 18 var_dump($ex->getMessage()); 19} 20?> 21--EXPECT-- 22string(47) "Serialization of 'WeakReference' is not allowed" 23string(49) "Unserialization of 'WeakReference' is not allowed" 24