3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'maríaé'; function substr_count_array( $haystack, $needle ) { $count = 0; foreach ($needle as $substring) { $count[$substring] += substr_count( $haystack, $substring); } return $count; } print_r(substr_count_array($str, array("á","é","í","ó")));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Cannot use a scalar value as an array in /in/7siHP:6 Stack trace: #0 /in/7siHP(10): substr_count_array('mar\xC3\xADa\xC3\xA9', Array) #1 {main} thrown in /in/7siHP on line 6
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:
42.53 ms | 401 KiB | 8 Q