1--TEST--
2preg_replace_callback() 2
3--FILE--
4<?php
5
6function f() {
7	throw new Exception();
8}
9
10try {
11var_dump(preg_replace_callback('/\w/', 'f', 'z'));
12} catch(Exception $e) {}
13
14function g($x) {
15	return "'$x[0]'";
16}
17
18var_dump(preg_replace_callback('@\b\w{1,2}\b@', 'g', array('a b3 bcd', 'v' => 'aksfjk', 12 => 'aa bb')));
19
20var_dump(preg_replace_callback('~\A.~', 'g', array(array('xyz'))));
21
22var_dump(preg_replace_callback('~\A.~', create_function('$m', 'return strtolower($m[0]);'), 'ABC'));
23?>
24--EXPECTF--
25array(3) {
26  [0]=>
27  string(12) "'a' 'b3' bcd"
28  ["v"]=>
29  string(6) "aksfjk"
30  [12]=>
31  string(9) "'aa' 'bb'"
32}
33
34Notice: Array to string conversion in %spreg_replace_callback2.php on line 17
35array(1) {
36  [0]=>
37  string(7) "'A'rray"
38}
39string(3) "aBC"
40