PHP  
 PHP_5_3
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for tests/func/010.phpt ('function with many parameters')

Script

1: <?php
2:
3:
// the stack size + some random constant
4:
$boundary 64*1024;
5:
$limit    $boundary+42;
6:
7:
8: function 
test($a,$b)
9: {
10:     
var_dump($a === $b);
11:     
test2($a,$b);
12: }
13:
14: function 
test2($a$b)
15: {
16:     if (
$a !== $b) {
17:         
var_dump("something went wrong: $a !== $b");
18:     }
19: }
20:
21:
22:
// generate the function
23:
$str "<?php\nfunction x(";
24:
25: for(
$i=0$i $limit; ++$i) {
26:     
$str .= '$v'.dechex($i).($i===($limit-1) ? '' ',');
27: }
28:
29:
$str .= ') {
30:     test($v42, \'42\');
31:     test(\'4000\', $v4000);
32:     test2($v300, \'300\');
33:     test($v0, \'0\'); // first
34:     test($v'
.dechex($limit-1).", '".dechex($limit-1).'\'); // last
35:     test($v'
.dechex($boundary).", '".dechex($boundary).'\'); //boundary
36:     test($v'
.dechex($boundary+1).", '".dechex($boundary+1).'\'); //boundary+1
37:     test($v'
.dechex($boundary-1).", '".dechex($boundary-1).'\'); //boundary-1
38: }'
;
39:
40:
// generate the function call
41:
$str .= "\n\nx(";
42:
43: for(
$i=0$i$limit; ++$i) {
44:     
$str .= "'".dechex($i)."'".($i===($limit-1) ? '' ',');
45: }
46:
47:
$str .= ");\n";
48:
49:
$filename dirname(__FILE__).'/010-file.php';
50:
file_put_contents(dirname(__FILE__).'/010-file.php'$str);
51: unset(
$str);
52:
53: include(
$filename);
54:
55: echo 
"Done\n";
56:
57:
?>
58:

Expected

bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
Done

Output

** ERROR: process timed out **

Diff

001+ ** ERROR: process timed out **
001- bool(true)
002- bool(true)
003- bool(true)
004- bool(true)
005- bool(true)
006- bool(true)
007- bool(true)
008- Done

 

Generated at Sun, 27 Jul 2014 12:58:43 +0000 (3 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.