3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = 1234455; $b = 54456; function digits_in_both($x, $y) { $in_both = []; $split_y = str_split($y); foreach(str_split($x) as $n) { $key = array_search($n, $split_y); if($key !== false) { $in_both[] = $n; unset($split_y[$key]); } } return $in_both; } $in_both = digits_in_both(123445, 54456); var_export($in_both); var_dump(count($in_both));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => '4', 1 => '4', 2 => '5', )int(3)

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