3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sizes = [ '200', '195', '190', '188', '186', '184', '182', '180', '178', '176', '174', '172', '170', '165', '160', ]; sort($sizes); $sizes = array_combine($sizes, $sizes); $keyRange = []; foreach($sizes as $key => &$size) { if (isset($sizes[$key+1])) { $sizes[$key] = range($size, $sizes[$key+1]-1); } } var_dump($sizes); $misterKeysRange = $sizes; $misterKeys = []; foreach($misterKeysRange as $value => $keys) { $values = array_map(function() use ($value){ return $value; }, $keys); $arr = array_combine($keys, $values); //var_dump($arr); $misterKeys = $misterKeys+$arr; } var_dump($misterKeys);
Output for git.master, git.master_jit, rfc.property-hooks
array(15) { [160]=> string(3) "160" [165]=> string(3) "165" [170]=> string(3) "170" [172]=> string(3) "172" [174]=> string(3) "174" [176]=> string(3) "176" [178]=> string(3) "178" [180]=> string(3) "180" [182]=> string(3) "182" [184]=> string(3) "184" [186]=> string(3) "186" [188]=> string(3) "188" [190]=> string(3) "190" [195]=> string(3) "195" [200]=> &string(3) "200" } Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, string given in /in/DPdJR:33 Stack trace: #0 /in/DPdJR(33): array_map(Object(Closure), '160') #1 {main} thrown in /in/DPdJR on line 33
Process exited with code 255.

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