File: bug02352-php80.phpt

package info (click to toggle)
xdebug 3.4.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,096 kB
  • sloc: ansic: 19,944; php: 6,217; xml: 4,172; pascal: 534; makefile: 4; sh: 2
file content (41 lines) | stat: -rw-r--r-- 956 bytes parent folder | download
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--TEST--
Test for bug #2352: Crash with storing exception traces and __invoke (< PHP 8.1)
--SKIPIF--
<?php
require __DIR__ . '/../utils.inc';
check_reqs('PHP < 8.1');
?>
--INI--
xdebug.mode=develop
--FILE--
<?php
class RedisProxy {
	function __construct(public Closure $c)
	{
	}

	function __call($method, $args)
	{
		$this->c->__invoke($args);
	}
}

$c = function(array $args)
{
	throw new Exception();
};

$rp = new RedisProxy($c);
$rp->isConnected();
?>
--EXPECTF--
Fatal error: Uncaught Exception in %sbug02352-php80.php on line 15

Exception:  in %sbug02352-php80.php on line 15

Call Stack:
%w%f %w%d   1. {main}() %sbug02352-php80.php:0
%w%f %w%d   2. RedisProxy->isConnected() %sbug02352-php80.php:19
%w%f %w%d   3. RedisProxy->__call($method = 'isConnected', $args = []) %sbug02352-php80.php:19
%w%f %w%d   4. Closure->__invoke(%s = []) %sbug02352-php80.php:9
%w%f %w%d   5. {closure:%sbug02352-php80.php:13-16}($args = []) %sbug02352-php80.php:9