3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 0 => 'ARRELEMENT_test', 1 => 'ARRELEMENT_test_v8', 2 => 'ARRELEMENT_test_v9', 3 => 'ARRELEMENT_test_v1', 4 => 'ARRELEMENT_test_v2', 5 => 'ARRELEMENT_test_v3' ); function getMaxTest($arr){ foreach($arr as $key=>$val){ preg_match('!\d+!', $val, $match); if($match){ $index[$key]= $match[0]; } } arsort($index); reset($index); $first_key = key($index); //var_dump($first_key); return $first_key; } $maxIndex = getMaxTest($arr); echo $arr[$maxIndex]; //die; //natsort($arr); //print_r(end($arr));
Output for git.master, git.master_jit, rfc.property-hooks
ARRELEMENT_test_v9

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:
41.54 ms | 1402 KiB | 4 Q