Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexandr-parkhomenko/5e6edcb2f8660d5f42e9d0cd857f641c to your computer and use it in GitHub Desktop.
Save alexandr-parkhomenko/5e6edcb2f8660d5f42e9d0cd857f641c to your computer and use it in GitHub Desktop.
<?php
$data = [
[1,2],
[1,2,3],
[1,2,3,4]
];
$callbackTest = new CallbackFilterIterator(new ArrayIterator($data), function (&$current) {
$current['test'] = 'test';
return true;
});
$callbackTest->rewind();
$data = $callbackTest->current();
$callbackTest->next();
var_dump($data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment