????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.55 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/file/ |
Upload File : |
--TEST--
Test fpassthru() function: Basic functionality
--FILE--
<?php
/*
Prototype: int fpassthru ( resource $handle );
Description: Reads to EOF on the given file pointer from the current position
and writes the results to the output buffer.
*/
$file_name = dirname(__FILE__)."/passthru.tmp";
$write_handle = fopen($file_name, "w");
$string = "Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^
Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^\n";
if(substr(PHP_OS, 0, 3) == "WIN") {
$string = str_replace("\r",'', $string);
}
fwrite($write_handle, $string);
fclose($write_handle);
$read_handle = fopen($file_name, "r");
echo "*** Test basic functionality of fpassthru() function ***\n";
echo "\n-- Before seek operation --\n";
var_dump( fpassthru($read_handle) );
echo "\n-- After seeking position to 0 --\n";
fseek($read_handle, 0);
var_dump( fpassthru($read_handle) );
echo "\n-- After seeking position to 3 --\n";
fseek($read_handle, 3);
var_dump( fpassthru($read_handle) );
echo "\n-- After seeking position to 13 --\n";
fseek($read_handle, 13);
var_dump( fpassthru($read_handle) );
echo "\n-- After seeking position to 14 --\n";
fseek($read_handle, 14);
var_dump( fpassthru($read_handle) );
echo "\n-- After seeking position to 23 --\n";
fseek($read_handle, 23);
var_dump( fpassthru($read_handle) );
echo "\n-- After seeking position to 34 --\n";
fseek($read_handle, 34);
var_dump( fpassthru($read_handle) );
echo "\n-- After seeking position to 1000 --\n";
fseek($read_handle, 1000);
var_dump( fpassthru($read_handle) );
fclose($read_handle);
echo "*** Done ***\n";
?>
--CLEAN--
<?php
unlink(dirname(__FILE__)."/passthru.tmp");
?>
--EXPECTF--
*** Test basic functionality of fpassthru() function ***
-- Before seek operation --
Hello, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
Hello, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
int(133)
-- After seeking position to 0 --
Hello, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
Hello, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
int(133)
-- After seeking position to 3 --
lo, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
Hello, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
int(130)
-- After seeking position to 13 --
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
Hello, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
int(120)
-- After seeking position to 14 --
abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
Hello, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
int(119)
-- After seeking position to 23 --
adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
Hello, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
int(110)
-- After seeking position to 34 --
2394723947 $%$%#$%#$%#^#%^
Hello, world
, abcdefg adsdsfdf
8u2394723947 $%$%#$%#$%#^#%^
int(99)
-- After seeking position to 1000 --
int(0)
*** Done ***