3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = array(1, 5, 2.5); $arr = array(); foreach ($str as $s) { $arr[$s][1]['a'] = $s; } echo '<pre>'; var_dump($arr); echo '</pre>'; ksort($arr); echo '<pre>'; var_dump($arr); echo '</pre>';
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Implicit conversion from float 2.5 to int loses precision in /in/e2adF on line 6 <pre>array(3) { [1]=> array(1) { [1]=> array(1) { ["a"]=> int(1) } } [5]=> array(1) { [1]=> array(1) { ["a"]=> int(5) } } [2]=> array(1) { [1]=> array(1) { ["a"]=> float(2.5) } } } </pre><pre>array(3) { [1]=> array(1) { [1]=> array(1) { ["a"]=> int(1) } } [2]=> array(1) { [1]=> array(1) { ["a"]=> float(2.5) } } [5]=> array(1) { [1]=> array(1) { ["a"]=> int(5) } } } </pre>

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