mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Avoid having output_buffering cause this test to improperly fail.
This commit is contained in:
parent
1a0b455d71
commit
f22fb07ecd
1 changed files with 7 additions and 8 deletions
|
@ -4,9 +4,13 @@ Formatted print functions
|
||||||
--GET--
|
--GET--
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
|
|
||||||
|
$fp = fopen("php://stdout", "w") or die("Arrggsgg!!");
|
||||||
|
$x = fprintf($fp, "fprintf test 1:%.5s\n", "abcdefghij");
|
||||||
|
var_dump($x);
|
||||||
|
fclose($fp);
|
||||||
|
|
||||||
printf("printf test 1:%s\n", "simple string");
|
printf("printf test 1:%s\n", "simple string");
|
||||||
printf("printf test 2:%d\n", 42);
|
printf("printf test 2:%d\n", 42);
|
||||||
printf("printf test 3:%f\n", 10.0/3);
|
printf("printf test 3:%f\n", 10.0/3);
|
||||||
|
@ -41,14 +45,11 @@ printf("printf test 29:%2\$-2d %1\$2d\n", 1, 2);
|
||||||
print("printf test 30:"); printf("%0\$s", 1); print("x\n");
|
print("printf test 30:"); printf("%0\$s", 1); print("x\n");
|
||||||
vprintf("vprintf test 1:%2\$-2d %1\$2d\n", array(1, 2));
|
vprintf("vprintf test 1:%2\$-2d %1\$2d\n", array(1, 2));
|
||||||
|
|
||||||
$fp = fopen("php://stdout", "w") or die("Arrggsgg!!");
|
|
||||||
$x = fprintf($fp, "fprintf test 1:%.5s\n", "abcdefghij");
|
|
||||||
var_dump($x);
|
|
||||||
fclose($fp);
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
|
fprintf test 1:abcde
|
||||||
|
int(20)
|
||||||
printf test 1:simple string
|
printf test 1:simple string
|
||||||
printf test 2:42
|
printf test 2:42
|
||||||
printf test 3:3.333333
|
printf test 3:3.333333
|
||||||
|
@ -82,5 +83,3 @@ printf test 28:02 1
|
||||||
printf test 29:2 1
|
printf test 29:2 1
|
||||||
printf test 30:x
|
printf test 30:x
|
||||||
vprintf test 1:2 1
|
vprintf test 1:2 1
|
||||||
fprintf test 1:abcde
|
|
||||||
int(20)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue