3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file1 = 'orders1.txt'; $file1CounterPart = 'order1-items.txt'; $file2 = 'orders2.txt'; $file2CounterPart = 'order2-items.txt'; $files = [$file1, $file1CounterPart, $file2, $file2CounterPart]; var_dump($files); function passes(array $files) { $orders = array_filter($files, function ($file) { return preg_match('/^orders\d+\.txt$/', $file); }); $orderItems = array_filter($files, function ($file) { return preg_match('/^order\d+\.txt$/', $file); }); var_dump($orders); var_dump($orderItems); } // var_dump( // [ // [ // 'orders1.txt', // 'order1-items.txt' // ], // [ // 'orders2.txt', // 'order2-items.txt' // ] // ] // );
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { [0]=> string(11) "orders1.txt" [1]=> string(16) "order1-items.txt" [2]=> string(11) "orders2.txt" [3]=> string(16) "order2-items.txt" }

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:
56.68 ms | 401 KiB | 8 Q