3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isSpam($comment) { // Pattern to match common phrases and links $pattern = '/(Like or Not\?|Check:)\s*(https?:\/\/[^\s]+)/i'; // Check if the pattern matches if (preg_match($pattern, $comment)) { return true; } // Known spam phrases (can be expanded) $knownSpam = [ "Like or Not? Check:", ]; // Calculate similarity with known spam phrases foreach ($knownSpam as $spam) { if (similar_text($spam, substr($comment, 0, strlen($spam))) / strlen($spam) > 0.8) { return true; } } return false; } echo isSpam('like or not');
Output for git.master, git.master_jit, rfc.property-hooks

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:
25.57 ms | 405 KiB | 5 Q