Annotation of embedaddon/php/Zend/tests/bug47320.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #47320 ($php_errormsg out of scope in functions)
                      3: --INI--
                      4: display_errors=0
                      5: track_errors=1
                      6: --FILE--
                      7: <?php
                      8: if (!@substr('no 2nd parameter')) {
                      9:     echo '$php_errormsg in global: ' . $php_errormsg . "\n";
                     10: }
                     11: 
                     12: function foo() {
                     13:     if (!@strpos('no 2nd parameter')) {
                     14:         echo '$php_errormsg in function: ' . $php_errormsg . "\n";
                     15: 
                     16:         echo '$GLOBALS[php_errormsg] in function: ' .
                     17:                 $GLOBALS['php_errormsg'] . "\n";
                     18:     }
                     19: }
                     20: 
                     21: foo();
                     22: ?>
                     23: --EXPECT--
                     24: $php_errormsg in global: substr() expects at least 2 parameters, 1 given
                     25: $php_errormsg in function: strpos() expects at least 2 parameters, 1 given
                     26: $GLOBALS[php_errormsg] in function: substr() expects at least 2 parameters, 1 given

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