Re: Improve PHP 7 serialization

From: Date: Wed, 24 Sep 2014 05:30:36 +0000
Subject: Re: Improve PHP 7 serialization
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-77565@lists.php.net to get a copy of this message
Hi! > There is an even better way to do this; add an additional parameter to > serialize and unserialize to serialize as and unserialize as: > > $bin = serialize($data_struct, 'igbinary'); > $data_struct = unserialize($bin, 'igbinary'); This is cleaner, but if you can do this (code change), why you can't do just igbinary_serialize($data_struct)? > 3) Optionally add a function like: get_serialize_handlers() (so we > won't have to parse phpinfo()) which are the available serializers That actually makes a lot of sense, but serialize_get_handlers() might be a better name, to group them together. But right now I don't think we have such list, do we? We have php_session_register_serializer() and the list for sessions, but not for other contexts. > 6) Allow users to register serialize handlers using > register_serialize_handler()/unregister_serialize_handler() Do you think userspace serialize handlers would be popular? They would be by necessity pretty slow compared to C ones. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/

« previous php.internals (#77565) next »