Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #75786: segfault when using spread operator on generator passed by reference ..

Decoded Output download

--TEST--
Bug #75786: segfault when using spread operator on generator passed by reference
--FILE--
<?php

function &gen($items) {
    foreach ($items as $key => &$value) {
        yield $key => $value;
    }
}

var_dump(...gen(['a', 'b', 'c']));

?>
--EXPECT--
string(1) "a"
string(1) "b"
string(1) "c"

Did this file decode correctly?

Original Code

--TEST--
Bug #75786: segfault when using spread operator on generator passed by reference
--FILE--
<?php

function &gen($items) {
    foreach ($items as $key => &$value) {
        yield $key => $value;
    }
}

var_dump(...gen(['a', 'b', 'c']));

?>
--EXPECT--
string(1) "a"
string(1) "b"
string(1) "c"

Function Calls

None

Variables

None

Stats

MD5 9cc61591c530b16985723a5b54329f17
Eval Count 0
Decode Time 102 ms