HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers27/dndin.nl/vendor/nikic/php-parser/test/code/prettyPrinter/expr/yield.test
Yield
-----
<?php

function gen()
{
    yield;
    yield $a;
    yield $a => $b;
    $a = yield;
    $a = (yield $b);
    $a = (yield $b => $c);
}
// TODO Get rid of parens for cases 2 and 3
-----
function gen()
{
    yield;
    (yield $a);
    (yield $a => $b);
    $a = yield;
    $a = (yield $b);
    $a = (yield $b => $c);
}
// TODO Get rid of parens for cases 2 and 3
-----
<?php

function gen()
{
    $a = yield $b;
    $a = yield $b => $c;
    yield from $a;
    $a = yield from $b;
}
// TODO Get rid of parens for last case
-----
!!php7
function gen()
{
    $a = (yield $b);
    $a = (yield $b => $c);
    yield from $a;
    $a = (yield from $b);
}
// TODO Get rid of parens for last case