3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datasets = array( // less than 10 entries array('127.0.0.1'=>45, '10.0.0.9'=>32, '172.16.0.4'=>'16'), // more than 10 entries array( '10.0.0.1'=>30, '10.0.0.2'=>31, '10.0.0.3'=>32, '10.0.0.4'=>33, '10.0.0.5'=>34, '10.0.0.6'=>35, '10.0.0.7'=>36, '10.0.0.8'=>37, '10.0.0.9'=>40, '10.0.0.10'=>41, '10.0.0.11'=>42, '10.0.0.12'=>43, '10.0.0.13'=>50, '10.0.0.14'=>51, '10.0.0.15'=>52, '10.0.0.16'=>53 ) ); foreach ($datasets as $all_ips) { arsort($all_ips); $top10 = array_slice($all_ips, 0, 10); var_export($top10); echo "\r\n-----\r\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
array ( '127.0.0.1' => 45, '10.0.0.9' => 32, '172.16.0.4' => '16', ) ----- array ( '10.0.0.16' => 53, '10.0.0.15' => 52, '10.0.0.14' => 51, '10.0.0.13' => 50, '10.0.0.12' => 43, '10.0.0.11' => 42, '10.0.0.10' => 41, '10.0.0.9' => 40, '10.0.0.8' => 37, '10.0.0.7' => 36, ) -----

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:
42.63 ms | 402 KiB | 8 Q