mirror of
https://github.com/php/php-src.git
synced 2025-01-05 18:33:56 +08:00
46f9fed0d8
Handle this in the implementation of get_current_key of user_it, so that the callers may assume that the key is not a reference. Fixes oss-fuzz #33018.
16 lines
222 B
PHP
16 lines
222 B
PHP
--TEST--
|
|
Iterator::key() with by-ref return
|
|
--FILE--
|
|
<?php
|
|
class Test extends ArrayIterator {
|
|
function &key() {
|
|
return $foo;
|
|
}
|
|
}
|
|
foreach (new Test([0]) as $k => $v) {
|
|
var_dump($k);
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
NULL
|