3v4l.org

run code in 500+ PHP versions simultaneously
<?php // continuing with complex anagrams // if we have "babc" and we want a signature for this to get // --> [1, 2, 1, 0, 0, 0, ... , 0] function buildingSignature($input) { $signature = array_fill(0, 26, 0); $input = strtolower($input); for ($i = 0; $i < strlen($input); $i++) { $char = $input[$i]; $signature[ord($char) - ord('a')] += 1; } return $signature; } echo '<pre>';print_r(buildingSignature("babc"));echo '</pre>';die; var_dump(buildingSignature("babc"));die;
Output for git.master_jit, git.master
<pre>Array ( [0] => 1 [1] => 2 [2] => 1 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 0 [17] => 0 [18] => 0 [19] => 0 [20] => 0 [21] => 0 [22] => 0 [23] => 0 [24] => 0 [25] => 0 ) </pre>

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:
40.54 ms | 772 KiB | 4 Q