summaryrefslogtreecommitdiff
path: root/Zend/tests/bug46106.phpt
blob: 7f0ae66debfe3110940a87ecb8b9754f05e0540b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
Bug #46106 (Memory leaks when using global statement)
--FILE--
<?php
$foo = array(1);

function foobar($errno, $errstr, $errfile, $errline) { }

set_error_handler('foobar');

function test($x) {
    global $foo;

    $x->invokeArgs(array(0));
}

$x = new ReflectionFunction('str_pad');
try {
    test($x);
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}
?>
DONE
--EXPECT--
str_pad() expects at least 2 arguments, 1 given
DONE