Talk:Phc-win

From wiki.swiftlytilting.com

file_put_contents in wb_generic.inc.php:

this worked for me! // PHP_VERSION < "5.0.0"

if(!function_exists('file_put_contents')) {
$file_put_contents = '
function file_put_contents($filename, $data, $flags=0, $zcontext=null)
{
	if($zcontext)
		$fp = @fopen($filename, "w+b", $flags, $zcontext);
	else
		$fp = @fopen($filename, "w+b", $flags);
	if(!$fp)
		return FALSE;
	fwrite($fp, $data);
	fclose($fp);
	return strlen($data); // std ret-val of func
} ';
eval($file_put_contents);
}

--Hans 07:36, 25 March 2006 (EST)

When creating apps with phc-win, one doesn't need to worry about PHP version compatibility. You can simply remove the if statement if you're using anything less than php 5.0, and remove the entire block if you're using 5.0+. :) --Frantik 19:38, 30 May 2006 (EDT)