mirror of
https://github.com/php/php-src.git
synced 2026-04-28 02:33:17 +02:00
b5c7a83dca
Closes GH-5759
29 lines
609 B
PHP
29 lines
609 B
PHP
--TEST--
|
|
Test popen() and pclose function: error conditions
|
|
--SKIPIF--
|
|
<?php
|
|
if (strtoupper( substr(PHP_OS, 0, 3) ) == 'SUN')
|
|
die("skip Not Valid for Sun Solaris");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$file_path = __DIR__;
|
|
echo "*** Testing for error conditions ***\n";
|
|
var_dump( popen("abc.txt", "rw") ); // Invalid mode Argument
|
|
$file_handle = fopen($file_path."/popen.tmp", "w");
|
|
fclose($file_handle);
|
|
echo "\n--- Done ---";
|
|
?>
|
|
--CLEAN--
|
|
<?php
|
|
$file_path = __DIR__;
|
|
unlink($file_path."/popen.tmp");
|
|
?>
|
|
--EXPECTF--
|
|
*** Testing for error conditions ***
|
|
|
|
Warning: popen(abc.txt,rw): %s on line %d
|
|
bool(false)
|
|
|
|
--- Done ---
|