original_string: private static function unserializeValue( &$string ) {
  		$error = null;
  		set_error_handler( function ( $errno, $errstr ) use ( &$error ) {
  			$error = $errstr;
  			return true;
  		} );
  		$ret = unserialize( $string );
  		restore_error_handler();
  
  		if ( $error !== null ) {
  			self::$logger->error( 'Value unserialization failed: ' . $error );
  			return [ false, null ];
  		}
  
  		$serialized = serialize( $ret );
  		$l = strlen( $serialized );
  		if ( substr( $string, 0, $l ) !== $serialized ) {
  			self::$logger->error(
  				'Value unserialization failed: read value does not match original string'
  			);
  			return [ false, null ];
  		}
  
  		$string = substr( $string, $l );
  		return [ true, $ret ];
  	}
code: private static function unserializeValue( &$string ) {
  		$error = null;
  		set_error_handler( function ( $errno, $errstr ) use ( &$error ) {
  			$error = $errstr;
  			return true;
  		} );
  		$ret = unserialize( $string );
  		restore_error_handler();
  
  		if ( $error !== null ) {
  			self::$logger->error( 'Value unserialization failed: ' . $error );
  			return [ false, null ];
  		}
  
  		$serialized = serialize( $ret );
  		$l = strlen( $serialized );
  		if ( substr( $string, 0, $l ) !== $serialized ) {
  			self::$logger->error(
  				'Value unserialization failed: read value does not match original string'
  			);
  			return [ false, null ];
  		}
  
  		$string = substr( $string, $l );
  		return [ true, $ret ];
  	}
code_tokens: private static function unserializeValue ( & $ string ) { $ error = null ; set_error_handler ( function ( $ errno , $ errstr ) use ( & $ error ) { $ error = $ errstr ; return true ; } ) ; $ ret = unserialize ( $ string ) ; restore_error_handler ( ) ; if ( $ error !== null ) { self :: $ logger -> error ( 'Value unserialization failed: ' . $ error ) ; return [ false , null ] ; } $ serialized = serialize ( $ ret ) ; $ l = strlen ( $ serialized ) ; if ( substr ( $ string , 0 , $ l ) !== $ serialized ) { self :: $ logger -> error ( 'Value unserialization failed: read value does not match original string' ) ; return [ false , null ] ; } $ string = substr ( $ string , $ l ) ; return [ true , $ ret ] ; }
docstring: Unserialize a value with error logging
  @param string &$string On success, the portion used is removed
  @return array ( bool $success, mixed $value )
docstring_tokens: Unserialize a value with error logging