<?php
$gen = (function() {
yield from [null, new class { function __destruct() { throw new Exception; } }];
})();
function foo($gen) {
$gen->valid();
}
foo($gen);
function spray() {}
spray(...range(1, 20));
$gen->throw(new Error);
Fatal error: Uncaught Error in /in/QeJLV:15
Stack trace:
#0 {main}
Next Exception in /in/QeJLV:4
Stack trace:
#0 /in/QeJLV(4): class@anonymous->__destruct()
#1 [internal function]: {closure:/in/QeJLV:3}()
#2 /in/QeJLV(15): Generator->throw(Object(Error))
#3 {main}
thrown in /in/QeJLV on line 4
Process exited with code 255.
Output for 8.2.21 - 8.2.29, 8.3.9 - 8.3.25
Fatal error: Uncaught Error in /in/QeJLV:15
Stack trace:
#0 {main}
Next Exception in /in/QeJLV:4
Stack trace:
#0 /in/QeJLV(4): class@anonymous->__destruct()
#1 [internal function]: {closure}()
#2 /in/QeJLV(15): Generator->throw(Object(Error))
#3 {main}
thrown in /in/QeJLV on line 4
Process exited with code 255.
Fatal error: Uncaught Exception in /in/QeJLV:4
Stack trace:
#0 [internal function]: class@anonymous->__destruct()
#1 /in/QeJLV(15): Generator->throw(Object(Error))
#2 {main}
Next Error in /in/QeJLV:15
Stack trace:
#0 {main}
thrown in /in/QeJLV on line 15
Process exited with code 255.
Output for 7.0.0
Fatal error: Uncaught Error in /in/QeJLV:15
Stack trace:
#0 {main}
thrown in /in/QeJLV on line 15
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Parse error: syntax error, unexpected ',', expecting ']' in /in/QeJLV on line 4
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Parse error: syntax error, unexpected '[' in /in/QeJLV on line 4
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected 'from' (T_STRING) in /in/QeJLV on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/QeJLV on line 4
Process exited with code 255.