3v4l.org

run code in 300+ PHP versions simultaneously
<?php $messages = array( 'ircBot hey', 'hey ircBot', 'hey ircBot naa', 'hey MircBot', ); foreach ($messages as $message) { // using in_array $isMentioned = in_array('ircbot', preg_split('/\s+/', mb_strtolower($message))); printf("%s = {$message}\n", $isMentioned ? 'true' : 'false'); // using regex word boundaries $isMentioned = preg_match('/\b(ircBot)\b/i', $message); printf("%s = {$message}\n", $isMentioned ? 'true' : 'false'); }
Output for git.master, git.master_jit, rfc.property-hooks
true = ircBot hey true = ircBot hey true = hey ircBot true = hey ircBot true = hey ircBot naa true = hey ircBot naa false = hey MircBot false = hey MircBot

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:
26.88 ms | 401 KiB | 8 Q