3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = [ ['order' => null, 'seriesId' => 1], ['order' => 0, 'seriesId' => 1], ]; function validateOrderUniqueness(array $data) { $orders = array_filter(array_column($data, 'order')); $uniqueOrders = array_unique($orders); if ($orders !== $uniqueOrders) { throw new \Exception('validateOrderUniqueness fail'); } } function validateSeriesUniqueness(array $data) { $seriesIds = array_column($data, 'seriesId'); $uniqueSeriesIds = array_unique($seriesIds); if ($seriesIds !== $uniqueSeriesIds) { throw new \Exception('validateSeriesUniqueness fail'); } } validateOrderUniqueness($data); validateSeriesUniqueness($data);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Exception: validateSeriesUniqueness fail in /in/YdL3n:24 Stack trace: #0 /in/YdL3n(29): validateSeriesUniqueness(Array) #1 {main} thrown in /in/YdL3n on line 24
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:
51.53 ms | 401 KiB | 8 Q