3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); function f($s){while(!$a&&++$i<strlen($s))for($j=0;$b=substr($s,$j++,$i);)strpos($s,$b)==strrpos($s,$b)&&($a[]=$b);return$a;} echo "------\n"; var_dump(f("")); echo "\n"; // -> [""] var_dump(f("abcaa")); // -> ["b","c"] var_dump(f("rererere")); echo "\n"; // -> ["ererer"] var_dump(f("asdfasdfd")); echo "\n"; // -> ["fa","fd"] var_dump(f("ffffhhhhfffffhhhhhfffhhh")); echo "\n"; // -> ["hffff","fffff","hhhhh","hfffh"] var_dump(f("asdfdfasddfdfaddsasadsasadsddsddfdsasdf")); echo "\n"; // -> ["fas","fad","add","fds"] echo "------\n";
Output for git.master, git.master_jit, rfc.property-hooks
------ NULL array(2) { [0]=> string(1) "b" [1]=> string(1) "c" } array(1) { [0]=> string(6) "ererer" } array(2) { [0]=> string(2) "fa" [1]=> string(2) "fd" } array(4) { [0]=> string(5) "hffff" [1]=> string(5) "fffff" [2]=> string(5) "hhhhh" [3]=> string(5) "hfffh" } array(4) { [0]=> string(3) "fas" [1]=> string(3) "fad" [2]=> string(3) "add" [3]=> string(3) "fds" } ------

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