3v4l.org

run code in 300+ PHP versions simultaneously
<?php $valid_strings = array("<p>","&nbsp;","</p>"); $test1 = '<p>asdasdasdasdasdasdasd</p>'; $test2 = '<p>&nbsp;&nbsp;&nbsp;&nbsp;</p>'; echo ContainsAnythingElseThan($test1,$valid_strings); echo ContainsAnythingElseThan($test2,$valid_strings); function ContainsAnythingElseThan($the_string,$the_valid_strings_array) { $nothing = array(""); echo count(str_replace($the_valid_strings_array,$nothing,$the_string)); }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in /in/LFm8R:18 Stack trace: #0 /in/LFm8R(10): ContainsAnythingElseThan('<p>asdasdasdasd...', Array) #1 {main} thrown in /in/LFm8R on line 18
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.91 ms | 401 KiB | 8 Q