| Server IP : 162.214.74.102 / Your IP : 216.73.217.46 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ |
Upload File : |
<?php
function generator()
{
/* testYield */
yield 1;
/* testYieldFollowedByComment */
YIELD/*comment*/ 2;
/* testYieldFrom */
yield from gen2();
/* testYieldFromWithExtraSpacesBetween */
Yield From gen2();
/* testYieldFromWithTabBetween */
yield from gen2();
/* testYieldFromSplitByNewLines */
yield
FROM
gen2();
/* testYieldFromSplitByComment */
yield /* comment */ from gen2();
/* testYieldFromWithTrailingComment */
yield // comment
from gen2();
/* testYieldFromWithTrailingAnnotation */
yield // phpcs:ignore Stnd.Cat.Sniff -- for reasons.
from gen2();
/* testYieldFromSplitByNewLineAndComments */
yield
/* comment line 1
line 2 */
// another comment
from
gen2();
/* testYieldFromSplitByNewLineAndAnnotation */
YIELD
// @phpcs:disable Stnd.Cat.Sniff -- for reasons.
From
gen2();
}
/* testYieldUsedAsClassName */
class Yield {
/* testYieldUsedAsClassConstantName */
const Type YIELD = 'foo';
/* testYieldUsedAsMethodName */
public function yield() {
/* testYieldUsedAsPropertyName1 */
echo $obj->yield;
/* testYieldUsedAsPropertyName2 */
echo $obj?->yield();
/* testYieldUsedForClassConstantAccess1 */
echo MyClass::YIELD;
/* testFromUsedForClassConstantAccess1 */
echo MyClass::FROM;
}
/* testYieldUsedAsMethodNameReturnByRef */
public function &yield() {}
}
function myGen() {
/* testYieldLiveCoding */
yield