3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function test($tableau) { var_dump($tableau); return true; } } class B extends A{ static function test($tableau) { $limit = 5; $res = true; $size = count($tableau); if( $size > $limit ) { for ($i=0; $i < round($size/$limit) ; $i++) { echo ($i*$limit); $res &= parent::test(array_splice($tableau,($i*$limit),$limit)); } } return $res; } } $ar = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o'); echo count($ar)."\n----------\n"; B::test($ar); var_dump(array_splice($ar,5,5));
Output for git.master, git.master_jit, rfc.property-hooks
15 ---------- 0array(5) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" [3]=> string(1) "d" [4]=> string(1) "e" } 5array(5) { [0]=> string(1) "k" [1]=> string(1) "l" [2]=> string(1) "m" [3]=> string(1) "n" [4]=> string(1) "o" } 10array(0) { } array(5) { [0]=> string(1) "f" [1]=> string(1) "g" [2]=> string(1) "h" [3]=> string(1) "i" [4]=> string(1) "j" }

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