3v4l.org

run code in 300+ PHP versions simultaneously
<?php class OnlyPendingDeletion extends FilterIterator { public function __construct(array $items) { parent::__construct(new ArrayIterator($items)); } public function accept() { $item = $this->current(); $fourthOfJan = strtotime('2014-01-04'); return $fourthOfJan > strtotime($item['date']); } } $array = array( array('id' => 1, 'date' > '2014-01-01'), array('id' => 2, 'date' > '2014-01-02'), array('id' => 3, 'date' > '2014-01-03'), array('id' => 4, 'date' > '2014-01-04'), array('id' => 5, 'date' > '2014-01-05'), array('id' => 6, 'date' > '2014-01-06'), array('id' => 7, 'date' > '2014-01-07'), ); $items = OnlyPendingDeletion($items); echo 'Pending: ', count($items), PHP_EOL; foreach ($items as $item) { echo 'id: ', $item['id'], PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of OnlyPendingDeletion::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/lNc2E on line 6 Fatal error: Uncaught Error: Call to undefined function OnlyPendingDeletion() in /in/lNc2E:23 Stack trace: #0 {main} thrown in /in/lNc2E on line 23
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
47.01 ms | 401 KiB | 8 Q