unserialize()
Jelmer Schreuder wrote on Saturday 16th of July 2011:Why would you want that? Seems pretty useless, only adds overhead and nothing usefull compared to unserialize().
Format::factory($serialized_string,'serialized'); Format::factory(unserialize($serialized_string));
$format = Format::factory(array('example', 'something')); $this->response->body = $format->{'to_'.$output}();
Jelmer Schreuder wrote on Saturday 16th of July 2011:In that case you don't understand what the Format class is meant for. It's meant to input something and help you convert/format it to something else. Making it unserialize is nonsense because of this:
Format::factory($serialized_string,'serialized'); Format::factory(unserialize($serialized_string));
The second example is exactly as much code as the first, and you'd never want to be able to do this in multiple ways. While this might be usefull the other way around:
$format = Format::factory(array('example', 'something')); $this->response->body = $format->{'to_'.$output}();
Where $output might contain 'serialized', 'json', 'xml', etc...
It looks like you're new here. If you want to get involved, click one of these buttons!