<?php
function test(...$data){
var_dump($data);
}
test(...(function(){
yield 0;
yield 1;
yield 2;
yield 3;
yield 4;
})());
- Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- array(5) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
[4]=>
int(4)
}
- Output for 5.6.0 - 5.6.40
- Parse error: syntax error, unexpected '(', expecting ',' or ')' in /in/7i47p on line 13
Process exited with code 255. - Output for 5.5.0 - 5.5.38
- Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/7i47p on line 3
Process exited with code 255.
preferences:
144.2 ms | 408 KiB | 5 Q