xref: /PHP-8.1/ext/reflection/tests/bug74949.phpt (revision f8d79582)
1--TEST--
2Bug #74949 (null pointer dereference in _function_string)
3--FILE--
4<?php
5
6$f = function () {};
7
8$r = new ReflectionMethod($f, "__invoke");
9
10unset($f);
11
12echo $r, "\n";
13
14try  {
15    echo $r->getPrototype();
16} catch (Exception $e) {
17    echo $e->getMessage(), "\n";
18}
19?>
20--EXPECT--
21Method [ <internal> public method __invoke ] {
22}
23
24Method Closure::__invoke does not have a prototype
25