3v4l.org

run code in 300+ PHP versions simultaneously
<?php $line = "HELLO WORLD HOW ARE YOU I AM JUST FINE THANKS"; $plan = [9, 20]; var_dump(plan_split($line, $plan)); function plan_split(string $line, array $plan) : array { $plan[] = strlen($line); // last substring $start = 0; $parsed = []; foreach ($plan as $end) { $parsed[] = substr($line, $start, $end); $start += $end; } return $parsed; }
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(9) "HELLO " [1]=> string(20) "WORLD HOW ARE YOU " [2]=> string(21) "I AM JUST FINE THANKS" }

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