/* Binary Data Test */
- $cmd = $php . ' -n -r \"readfile(@getenv(\'TEST_PHP_EXECUTABLE\')); \"';
- $cmd = $php . ' -n -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ;
+ if (substr(PHP_OS, 0, 3) != 'WIN') {
+ $cmd = $php . ' -n -r \"readfile(@getenv(\'TEST_PHP_EXECUTABLE\')); \"';
+ $cmd = $php . ' -n -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ;
+ } else {
+ $cmd = $php . ' -n -r \"readfile(@getenv(\\\\\\"TEST_PHP_EXECUTABLE\\\\\\")); \"';
+ $cmd = $php . ' -n -r " passthru(\''.$cmd.'\');" > '.$tmpfile ;
+ }
exec($cmd);
if (md5_file($php) == md5_file($tmpfile)) {
--TEST--
Bug #24313 (file_exists() throws a warning on nonexistent files when is open_basedir enabled)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip "/dev" is not available');
+}
+?>
--INI--
open_basedir=/dev
--FILE--
<?php
$out = array();
$status = -1;
-exec($_ENV['TEST_PHP_EXECUTABLE'].' -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status);
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ exec($_ENV['TEST_PHP_EXECUTABLE'].' -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status);
+} else {
+ exec($_ENV['TEST_PHP_EXECUTABLE'].' -r "for($i=1;$i<=5000;$i++) echo $i,\' \';"', $out, $status);
+}
print_r($out);
?>
--EXPECT--
$out = array();
$status = -1;
$php = getenv('TEST_PHP_EXECUTABLE');
-exec($php . ' -r \''
- . '$lengths = array(10,20000,10000,5,10000,3);'
- . 'foreach($lengths as $length) {'
- . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);'
- . ' print "\n";'
- . '}\'', $out, $status);
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ exec($php . ' -r \''
+ . '$lengths = array(10,20000,10000,5,10000,3);'
+ . 'foreach($lengths as $length) {'
+ . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);'
+ . ' print "\n";'
+ . '}\'', $out, $status);
+} else {
+ exec($php . ' -r "'
+ . '$lengths = array(10,20000,10000,5,10000,3);'
+ . 'foreach($lengths as $length) {'
+ . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);'
+ . ' print \\"\\n\\";'
+ . '}"', $out, $status);
+}
for ($i=0;$i<6;$i++)
print "md5(line $i)= " . md5($out[$i]) . " (length " .
strlen($out[$i]) . ")\n";
--TEST--
Bug #39367 (clearstatcache() doesn't clear realpath cache)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip no symlinks on Windows');
+}
+?>
--FILE--
<?php
function test() {
--TEST--
mkdir(dir, 0777) tests
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip no symlinks on Windows');
+}
+?>
--FILE--
<?php
Warning: fopen(): Plainfiles wrapper disabled in %s on line %d
-Warning: fopen(file:///%s): failed to open stream: no suitable wrapper could be found in %s on line %d
+Warning: fopen(file://%s): failed to open stream: no suitable wrapper could be found in %s on line %d
bool(false)
bool(true)
resource(%d) of type (stream)
}
array(3) {
["dirname"]=>
- string(1) "/"
+ string(1) "%e"
["basename"]=>
string(0) ""
["filename"]=>
}
array(4) {
["dirname"]=>
- string(1) "/"
+ string(1) "%e"
["basename"]=>
string(1) "."
["extension"]=>
string(12) "pathinfo.php"
string(8) "pathinfo"
string(3) "php"
-string(%d) "%s/strings"
-string(%d) "%s/strings"
+string(%d) "%s%estrings"
+string(%d) "%s%estrings"
string(12) "pathinfo.php"
string(3) "php"
string(12) "pathinfo.php"
-string(%d) "%s/strings"
+string(%d) "%s%estrings"
string(12) "pathinfo.php"
-string(%d) "%s/strings"
-string(%d) "%s/strings"
+string(%d) "%s%estrings"
+string(%d) "%s%estrings"
Done
--TEST--
Bug #38524 (strptime() does not initialize the internal date storage structure)
+--SKIPIF--
+<?php if (!function_exists('strptime')) echo "SKIP"; ?>
--FILE--
<?php
var_dump(strptime('2006-08-20', '%Y-%m-%d'));