3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( '0' => 25, '1' => 30, '2' => 35, '3' => 40, '4' => 45, '5' => 50, '6' => 55, '7' => 60, '8' => 65, '9' => 70, '10' => 75, '11' => 80, '12' => 85, ); $key = 3; $count = 5; $slice = array_slice( $array, ( ( $key - $count ) > 0 ) ? ( $key - $count) : 0 , ( ( $key - $count ) > 0 ) ? ( (2 * $count) + 1 ) : ( (2 * $count) + ( $key - $count + 1 ) ) ); echo '<pre>'; print_r($slice); die;
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [0] => 25 [1] => 30 [2] => 35 [3] => 40 [4] => 45 [5] => 50 [6] => 55 [7] => 60 [8] => 65 )

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