3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [5, true, 'FooBar'], [8, true, 'Bar'], [18, true, 'IsTied'], ]; $result = []; $longest = 0; foreach ($array as $row) { $len = strlen($row[2]); if ($len >= $longest) { $longest = $len; $result[$len][] = $row; } } var_export($result[$longest] ?? []);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 0 => 5, 1 => true, 2 => 'FooBar', ), 1 => array ( 0 => 18, 1 => true, 2 => 'IsTied', ), )

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:
139.51 ms | 405 KiB | 5 Q