Comments (3)
Hi
This happens because foreach calls rewind
on the iterator before starting iteration. See the note of https://www.php.net/manual/en/iterator.rewind.
But not to worry, you can make it work by changing your foreach line into foreach (new NoRewindIterator($fileObj) as $row)
. I tested this and it gives the expected result.
As such, I'll close this as not a bug.
from php-src.
Many thanks for your time and support @nielsdos :)
from php-src.
I've made an issue on the docs repo to extend the note to point users towards a solution: php/doc-en#3308
from php-src.
Related Issues (20)
- stream_select fails on blocking sockets except for incoming connections HOT 2
- FR: allow use class constant interpolation in strings HOT 1
- === Total 1 memory leaks detected === zend_mm_heap corrupted Segmentation fault HOT 2
- [ feature/fix ] Internal functions needs exactly number of arguments needs to be optimized / And few more old bugs HOT 5
- Stack buffer underflow when executing copy() HOT 7
- Invalid nameserver delays php-cli execution HOT 2
- AVIF image errors HOT 3
- File system group permission with is_readable and is_writable is not being honored HOT 2
- Database connections using PDO ODBC to Oracle fail after upgrade to 8.2 HOT 4
- Applying zero offset to null pointer in Zend/zend_opcode.c HOT 4
- mbstring cannot be built on Windows (commit f7e7370)
- JSON Error Message: Malformed UTF-8 characters, possibly incorrectly encoded HOT 12
- [spam]
- getAttribute('xmlns') returns NULL when using the new DOM API HOT 4
- Backward incompatibility on date function 8.1+ HOT 6
- Using NumberFormatter::DECIMAL_ALWAYS_SHOWN adds the currency symbol to format() method output HOT 1
- Improve the error message of duplicated class declaration
- sqlite PDO::quote silently corrupts strings with null bytes HOT 11
- Add "abstract constant" support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-src.