1--TEST--
2preg_replace_callback() 3
3--FILE--
4<?php
5
6try {
7    var_dump(preg_replace_callback(1,2,3));
8} catch (\TypeError $e) {
9    echo $e->getMessage() . \PHP_EOL;
10}
11try {
12    var_dump(preg_replace_callback(1,2,3,4));
13} catch (\TypeError $e) {
14    echo $e->getMessage() . \PHP_EOL;
15}
16
17$a = 5;
18try {
19    var_dump(preg_replace_callback(1,2,3,4,$a));
20} catch (\TypeError $e) {
21    echo $e->getMessage() . \PHP_EOL;
22}
23
24?>
25--EXPECT--
26preg_replace_callback(): Argument #2 ($callback) must be a valid callback, no array or string given
27preg_replace_callback(): Argument #2 ($callback) must be a valid callback, no array or string given
28preg_replace_callback(): Argument #2 ($callback) must be a valid callback, no array or string given
29