- fix SKIPIF for PHP4
authorMichael Wallner <mike@php.net>
Tue, 25 Sep 2007 17:11:41 +0000 (17:11 +0000)
committerMichael Wallner <mike@php.net>
Tue, 25 Sep 2007 17:11:41 +0000 (17:11 +0000)
tests/skip.inc

index 5665d5dddd141f65563b86bfea15a3911cdae10e..63ae05cff423c3f4f13a78d403a6a18d92966f4a 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
+if (!function_exists('fprintf')) {
+       function fprintf(){ $a=func_get_args(); $s=array_shift($a); return fwrite($s, call_user_func_array('sprintf',$a)); }
+}
 function skipif($if, $skip) { if ($if) { fprintf(STDOUT, "skip $skip"); exit(); }}
 function checkcgi() { skipif(!strncasecmp('CLI', PHP_SAPI, 3), 'need CGI SAPI'); }
 function checkext($ext) { skipif(!extension_loaded($ext), "need ext/$ext"); }