3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 元データを用意する $a = array(); $a[2]=10; $a[10]=2; $a[3]=30; $a[22]=20; $a[9]=4; $a[53]=29; //確認 echo ($a); //キーを保持してソート asort($a); //確認 echo ($a); //最初から 3 個を $b[] に代入 $i = 0; $b = array(); foreach ($a as $k=>$d){ $b[] = $k; if (3 <= ++$i){ break;} } //確認 echo ($b); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/Dcko1 on line 11 Array Warning: Array to string conversion in /in/Dcko1 on line 15 Array Warning: Array to string conversion in /in/Dcko1 on line 24 Array

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