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 ];
	}