All pastes #184815 Raw Edit

dexen

public php v1 · immutable
#184815 ·published 2006-09-28 09:55 UTC
rendered paste body
	/** Throws \p $exceptionClass in case of failure of \p $callback . 		Throws \p $exceptionClass with message as printed by callable \p $callback when the returned value equals \p $condition .  */	function throwError( $callback, $parms, $exceptionClass, $condition = FALSE ) {		if ( $parms === NULL )			$parms = array();				ob_start();				$v = call_user_func_array( $callback, $parms );				$e = ob_get_clean();		if ( $v === $condition )			throw new $exceptionClass( $e );		return $v;	}