1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/spl/tests/SplFileObject_next_variation002.phpt
Christoph M. Becker ee5711de33 Fix #81477: LimitIterator + SplFileObject regression in 8.0.1
We must not free the read line, if the `READ_AHEAD` flag is set.  This
also restores the expectations of SplFileObject_next_variation002.phpt.

Closes GH-7518.
2021-09-29 16:17:14 +02:00

31 lines
483 B
PHP

--TEST--
SPL: SplFileObject::next variation 002, read ahead
--CREDITS--
Ricardo Oedietram <ricardo@odracir.nl>
Erwin Poeze <erwin.poeze@gmail.com>
#PFZ June PHP TestFest 2012
--FILE--
<?php
//line 2
//line 3
//line 4
//line 5
$s = new SplFileObject(__FILE__);
$s->seek(2);
echo $s->current();
$s->next();
echo $s->current();
$s->setFlags(SplFileObject::READ_AHEAD);
$s->seek(2);
echo $s->current();
$s->next();
echo $s->current();
?>
--EXPECT--
//line 3
//line 4
//line 3
//line 4