3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tryDistributeLinksEvenly($howManyMessages, $links){ echo "testing $howManyMessages\n"; $messages = array_chunk($links, $howManyMessages, true); foreach($messages as $message){ $count = array_reduce(array_keys($message), function($a, $b){ return mb_strlen($a) + mb_strlen($b) + 2; }); var_dump($message); echo $count . "\n"; } echo "-----\n"; } function distributeLinksEvenly($links){ $howManyMessages = 0; do{ $howManyMessages++; $chunks = tryDistributeLinksEvenly($howManyMessages, $links); if($howManyMessages > 10) exit(); }while($chunks === null); return $chunks; } $v = [ 'aaaa', 'bbbb', 'ccccccc', 'dddddddddd', 'eeeeeeee', 'ffffffffffff', 'gggg', 'hhhhhh', 'iiiiiiiiiii', 'lllllll', 'mmmmmmmmmmm', 'nnnnnnn', 'ooo', ]; $v = array_combine($v, $v); distributeLinksEvenly($v);
Output for git.master, git.master_jit, rfc.property-hooks
testing 1 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["aaaa"]=> string(4) "aaaa" } 6 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["bbbb"]=> string(4) "bbbb" } 6 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["ccccccc"]=> string(7) "ccccccc" } 9 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["dddddddddd"]=> string(10) "dddddddddd" } 12 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["eeeeeeee"]=> string(8) "eeeeeeee" } 10 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["ffffffffffff"]=> string(12) "ffffffffffff" } 14 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["gggg"]=> string(4) "gggg" } 6 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["hhhhhh"]=> string(6) "hhhhhh" } 8 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" } 13 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["lllllll"]=> string(7) "lllllll" } 9 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" } 13 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["nnnnnnn"]=> string(7) "nnnnnnn" } 9 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["ooo"]=> string(3) "ooo" } 5 ----- testing 2 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(2) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" } 7 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(2) { ["ccccccc"]=> string(7) "ccccccc" ["dddddddddd"]=> string(10) "dddddddddd" } 13 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(2) { ["eeeeeeee"]=> string(8) "eeeeeeee" ["ffffffffffff"]=> string(12) "ffffffffffff" } 16 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(2) { ["gggg"]=> string(4) "gggg" ["hhhhhh"]=> string(6) "hhhhhh" } 9 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(2) { ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" ["lllllll"]=> string(7) "lllllll" } 11 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(2) { ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" ["nnnnnnn"]=> string(7) "nnnnnnn" } 11 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["ooo"]=> string(3) "ooo" } 5 ----- testing 3 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(3) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" ["ccccccc"]=> string(7) "ccccccc" } 10 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(3) { ["dddddddddd"]=> string(10) "dddddddddd" ["eeeeeeee"]=> string(8) "eeeeeeee" ["ffffffffffff"]=> string(12) "ffffffffffff" } 16 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(3) { ["gggg"]=> string(4) "gggg" ["hhhhhh"]=> string(6) "hhhhhh" ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" } 14 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(3) { ["lllllll"]=> string(7) "lllllll" ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" ["nnnnnnn"]=> string(7) "nnnnnnn" } 11 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["ooo"]=> string(3) "ooo" } 5 ----- testing 4 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(4) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" ["ccccccc"]=> string(7) "ccccccc" ["dddddddddd"]=> string(10) "dddddddddd" } 14 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(4) { ["eeeeeeee"]=> string(8) "eeeeeeee" ["ffffffffffff"]=> string(12) "ffffffffffff" ["gggg"]=> string(4) "gggg" ["hhhhhh"]=> string(6) "hhhhhh" } 9 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(4) { ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" ["lllllll"]=> string(7) "lllllll" ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" ["nnnnnnn"]=> string(7) "nnnnnnn" } 11 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["ooo"]=> string(3) "ooo" } 5 ----- testing 5 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(5) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" ["ccccccc"]=> string(7) "ccccccc" ["dddddddddd"]=> string(10) "dddddddddd" ["eeeeeeee"]=> string(8) "eeeeeeee" } 12 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(5) { ["ffffffffffff"]=> string(12) "ffffffffffff" ["gggg"]=> string(4) "gggg" ["hhhhhh"]=> string(6) "hhhhhh" ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" ["lllllll"]=> string(7) "lllllll" } 11 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(3) { ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" ["nnnnnnn"]=> string(7) "nnnnnnn" ["ooo"]=> string(3) "ooo" } 7 ----- testing 6 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(6) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" ["ccccccc"]=> string(7) "ccccccc" ["dddddddddd"]=> string(10) "dddddddddd" ["eeeeeeee"]=> string(8) "eeeeeeee" ["ffffffffffff"]=> string(12) "ffffffffffff" } 16 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(6) { ["gggg"]=> string(4) "gggg" ["hhhhhh"]=> string(6) "hhhhhh" ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" ["lllllll"]=> string(7) "lllllll" ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" ["nnnnnnn"]=> string(7) "nnnnnnn" } 11 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(1) { ["ooo"]=> string(3) "ooo" } 5 ----- testing 7 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(7) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" ["ccccccc"]=> string(7) "ccccccc" ["dddddddddd"]=> string(10) "dddddddddd" ["eeeeeeee"]=> string(8) "eeeeeeee" ["ffffffffffff"]=> string(12) "ffffffffffff" ["gggg"]=> string(4) "gggg" } 8 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(6) { ["hhhhhh"]=> string(6) "hhhhhh" ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" ["lllllll"]=> string(7) "lllllll" ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" ["nnnnnnn"]=> string(7) "nnnnnnn" ["ooo"]=> string(3) "ooo" } 7 ----- testing 8 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(8) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" ["ccccccc"]=> string(7) "ccccccc" ["dddddddddd"]=> string(10) "dddddddddd" ["eeeeeeee"]=> string(8) "eeeeeeee" ["ffffffffffff"]=> string(12) "ffffffffffff" ["gggg"]=> string(4) "gggg" ["hhhhhh"]=> string(6) "hhhhhh" } 9 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(5) { ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" ["lllllll"]=> string(7) "lllllll" ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" ["nnnnnnn"]=> string(7) "nnnnnnn" ["ooo"]=> string(3) "ooo" } 7 ----- testing 9 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(9) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" ["ccccccc"]=> string(7) "ccccccc" ["dddddddddd"]=> string(10) "dddddddddd" ["eeeeeeee"]=> string(8) "eeeeeeee" ["ffffffffffff"]=> string(12) "ffffffffffff" ["gggg"]=> string(4) "gggg" ["hhhhhh"]=> string(6) "hhhhhh" ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" } 14 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(4) { ["lllllll"]=> string(7) "lllllll" ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" ["nnnnnnn"]=> string(7) "nnnnnnn" ["ooo"]=> string(3) "ooo" } 7 ----- testing 10 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(10) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" ["ccccccc"]=> string(7) "ccccccc" ["dddddddddd"]=> string(10) "dddddddddd" ["eeeeeeee"]=> string(8) "eeeeeeee" ["ffffffffffff"]=> string(12) "ffffffffffff" ["gggg"]=> string(4) "gggg" ["hhhhhh"]=> string(6) "hhhhhh" ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" ["lllllll"]=> string(7) "lllllll" } 11 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(3) { ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" ["nnnnnnn"]=> string(7) "nnnnnnn" ["ooo"]=> string(3) "ooo" } 7 ----- testing 11 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(11) { ["aaaa"]=> string(4) "aaaa" ["bbbb"]=> string(4) "bbbb" ["ccccccc"]=> string(7) "ccccccc" ["dddddddddd"]=> string(10) "dddddddddd" ["eeeeeeee"]=> string(8) "eeeeeeee" ["ffffffffffff"]=> string(12) "ffffffffffff" ["gggg"]=> string(4) "gggg" ["hhhhhh"]=> string(6) "hhhhhh" ["iiiiiiiiiii"]=> string(11) "iiiiiiiiiii" ["lllllll"]=> string(7) "lllllll" ["mmmmmmmmmmm"]=> string(11) "mmmmmmmmmmm" } 15 Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /in/udqg5 on line 8 array(2) { ["nnnnnnn"]=> string(7) "nnnnnnn" ["ooo"]=> string(3) "ooo" } 6 -----

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:
62.95 ms | 425 KiB | 8 Q