xref: /PHP-8.1/Zend/tests/fibers/get-return.phpt (revision c276c16b)
1--TEST--
2Test fiber return value
3--FILE--
4<?php
5
6$fiber = new Fiber(function (): string {
7    $value = Fiber::suspend("x");
8    return $value;
9});
10
11$value = $fiber->start();
12var_dump($value);
13var_dump($fiber->resume($value . "y"));
14var_dump($fiber->getReturn());
15
16?>
17--EXPECT--
18string(1) "x"
19NULL
20string(2) "xy"
21