1--TEST--
2Arguments to fiber callback
3--FILE--
4<?php
5
6$fiber = new Fiber(function (int $x): int {
7    return $x + Fiber::suspend($x);
8});
9
10$x = $fiber->start(1);
11$fiber->resume(0);
12var_dump($fiber->getReturn());
13
14$fiber = new Fiber(function (int $x): int {
15    return $x + Fiber::suspend($x);
16});
17
18$fiber->start('test');
19
20?>
21--EXPECTF--
22int(1)
23
24Fatal error: Uncaught TypeError: {closure:%s:%d}(): Argument #1 ($x) must be of type int, string given in %s:%d
25Stack trace:
26#0 [internal function]: {closure:%s:%d}('test')
27#1 %sstart-arguments.php(%d): Fiber->start('test')
28#2 {main}
29  thrown in %sstart-arguments.php on line %d
30