Annotation of embedaddon/php/tests/func/010.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: function with many parameters
        !             3: --SKIPIF--
        !             4: <?php
        !             5: if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
        !             6: ?>
        !             7: --FILE--
        !             8: <?php
        !             9: 
        !            10: // the stack size + some random constant
        !            11: $boundary = 64*1024;
        !            12: $limit    = $boundary+42;
        !            13: 
        !            14: 
        !            15: function test($a,$b)
        !            16: {
        !            17:        var_dump($a === $b);
        !            18:        test2($a,$b);
        !            19: }
        !            20: 
        !            21: function test2($a, $b)
        !            22: {
        !            23:        if ($a !== $b) {
        !            24:                var_dump("something went wrong: $a !== $b");
        !            25:        }
        !            26: }
        !            27: 
        !            28: 
        !            29: // generate the function
        !            30: $str = "<?php\nfunction x(";
        !            31: 
        !            32: for($i=0; $i < $limit; ++$i) {
        !            33:        $str .= '$v'.dechex($i).($i===($limit-1) ? '' : ',');
        !            34: }
        !            35: 
        !            36: $str .= ') {
        !            37:        test($v42, \'42\');
        !            38:        test(\'4000\', $v4000);
        !            39:        test2($v300, \'300\');
        !            40:        test($v0, \'0\'); // first
        !            41:        test($v'.dechex($limit-1).", '".dechex($limit-1).'\'); // last
        !            42:        test($v'.dechex($boundary).", '".dechex($boundary).'\'); //boundary
        !            43:        test($v'.dechex($boundary+1).", '".dechex($boundary+1).'\'); //boundary+1
        !            44:        test($v'.dechex($boundary-1).", '".dechex($boundary-1).'\'); //boundary-1
        !            45: }';
        !            46: 
        !            47: // generate the function call
        !            48: $str .= "\n\nx(";
        !            49: 
        !            50: for($i=0; $i< $limit; ++$i) {
        !            51:        $str .= "'".dechex($i)."'".($i===($limit-1) ? '' : ',');
        !            52: }
        !            53: 
        !            54: $str .= ");\n";
        !            55: 
        !            56: $filename = dirname(__FILE__).'/010-file.php';
        !            57: file_put_contents(dirname(__FILE__).'/010-file.php', $str);
        !            58: unset($str);
        !            59: 
        !            60: include($filename);
        !            61: 
        !            62: echo "Done\n";
        !            63: 
        !            64: ?>
        !            65: --CLEAN--
        !            66: <?php
        !            67: @unlink(dirname(__FILE__).'/010-file.php');
        !            68: ?>
        !            69: --EXPECT--
        !            70: bool(true)
        !            71: bool(true)
        !            72: bool(true)
        !            73: bool(true)
        !            74: bool(true)
        !            75: bool(true)
        !            76: bool(true)
        !            77: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>