Better fix for #12

this will perfer reference in serialize, which will reduce the
serialized length in PHP(with php_only)