summaryrefslogtreecommitdiff
path: root/Zend/tests/bug70895.phpt
blob: 1a28d9ef5cefc931592529595012bf7e52362bf9 (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
--TEST--
Bug #70895 null ptr deref and segfault with crafted callable
--FILE--
<?php

try {
    array_map("%n", 0);
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}
try {
    array_map("%n %i", 0);
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}
try {
    array_map("%n %i aoeu %f aoeu %p", 0);
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}
?>
--EXPECT--
array_map(): Argument #1 ($callback) must be a valid callback, function "%n" not found or invalid function name
array_map(): Argument #1 ($callback) must be a valid callback, function "%n %i" not found or invalid function name
array_map(): Argument #1 ($callback) must be a valid callback, function "%n %i aoeu %f aoeu %p" not found or invalid function name