3v4l.org

run code in 300+ PHP versions simultaneously
<?php function substr_count_array($string, $arr) { foreach ($arr as $letter) $count[$letter] += substr_count($string, $letter); return $count; } $str = 'óóómaóríaéé'; print_r(substr_count_array($str, array("á","é","í","ó")));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $count in /in/nBDgT on line 5 Warning: Undefined array key "á" in /in/nBDgT on line 5 Warning: Undefined array key "é" in /in/nBDgT on line 5 Warning: Undefined array key "í" in /in/nBDgT on line 5 Warning: Undefined array key "ó" in /in/nBDgT on line 5 Array ( [á] => 0 [é] => 2 [í] => 1 [ó] => 4 )

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