xref: /PHP-8.4/Zend/tests/bug31720.phpt (revision 96f2f317)
1--TEST--
2Bug #31720 (Invalid object callbacks not caught in array_walk())
3--FILE--
4<?php
5$array = array('at least one element');
6
7try {
8    array_walk($array, array($nonesuchvar,'show'));
9} catch (TypeError $e) {
10    echo $e->getMessage(), "\n";
11}
12?>
13--EXPECTF--
14Warning: Undefined variable $nonesuchvar in %s on line %d
15array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object
16