summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/errors/yield_const_by_ref_error.phpt
blob: e79f83e24a192bb14bc3fc76bb2b60dfe03d1f39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--TEST--
A notice is thrown when yielding a constant value by reference
--FILE--
<?php

function &gen() {
    yield "foo";
}

$gen = gen();
var_dump($gen->current());

?>
--EXPECTF--
Notice: Only variable references should be yielded by reference in %s on line %d
string(3) "foo"