3v4l.org

run code in 300+ PHP versions simultaneously
<?php function common_parts($data) { for ($b = 1; ; $b *= 10) { $base = intdiv($data[0], $b); $matches = array_filter($data, function ($v) use ($b, $base) { return intdiv($v, $b) != $base; }); if (count($matches) == 0) break; } $base *= $b; for ($i = 1; $i < count($data); $i++) { $data[$i] = $data[$i] - $base; } return $data; } print_r(common_parts(array(670006151,670006152,670006251))); print_r(common_parts(array(670006151,670006154,670006158))); print_r(common_parts(array(670006151,670006154,670006161)));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 670006151 [1] => 152 [2] => 251 ) Array ( [0] => 670006151 [1] => 4 [2] => 8 ) Array ( [0] => 670006151 [1] => 54 [2] => 61 )

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:
67.76 ms | 405 KiB | 5 Q