3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rfcs = ['Typed Properties', 'PHP Attributes', 'Functional Interfaces', 'Closure from callable function', 'Forbid dynamic calls to scope introspection functions', 'Callable prototypes']; $numberOfCharsBeforeTrimRequired = 150; $perRFC = (int)($numberOfCharsBeforeTrimRequired / count($rfcs)); $done = []; do { $lastTrimNeeded = count($rfcs); $remaining = 0; foreach ($rfcs as $i => $rfc) { if (strlen($rfc) <= $perRFC) { $done[] = $rfc; $remaining += $perRFC - strlen($rfc); unset($rfcs[$i]); } } $perRFC += (int)($remaining / count($rfcs)); } while ($lastTrimNeeded > count($rfcs)); foreach ($rfcs as $rfc) { $done[] = substr($rfc, 0, $perRFC); } // get total length to check algo $totalLen = 0; foreach ($done as $rfc) { $totalLen += strlen($rfc); } var_dump($done, $totalLen);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { [0]=> string(16) "Typed Properties" [1]=> string(14) "PHP Attributes" [2]=> string(21) "Functional Interfaces" [3]=> string(19) "Callable prototypes" [4]=> string(30) "Closure from callable function" [5]=> string(50) "Forbid dynamic calls to scope introspection functi" } int(150)

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:
166.77 ms | 406 KiB | 5 Q