Copy of php-serialize found at http://www.aagh.net/projects/ruby-php-serialize