3v4l.org

run code in 300+ PHP versions simultaneously
<?php function shutdown(): \Generator { try { yield; } finally { echo 'UNSET BEFORE yield', PHP_EOL; yield; } } $generator = shutdown(); $generator->rewind();
Output for 8.1rc1 - rc3
UNSET BEFORE yield Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator in /in/JQEOj:8 Stack trace: #0 [internal function]: shutdown() #1 {main} thrown in /in/JQEOj on line 8
Process exited with code 255.
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.23, 7.3.16 - 7.3.31, 7.4.4 - 7.4.25, 8.0.0 - 8.0.12
UNSET BEFORE yield Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator in /in/JQEOj:8 Stack trace: #0 {main} thrown in /in/JQEOj on line 8
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.4.0
UNSET BEFORE yield
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
Parse error: syntax error, unexpected ':', expecting '{' in /in/JQEOj on line 2
Process exited with code 255.
Output for 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected ':', expecting '{' in /in/JQEOj on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'{'' in /in/JQEOj on line 2
Process exited with code 255.

preferences:
51.5 ms | 466 KiB | 5 Q