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');

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.110.0100.00020.94
8.3.100.0030.00724.06
8.3.90.0040.00426.77
8.3.80.0060.00318.43
8.3.70.0270.00717.81
8.3.60.0080.00618.43
8.3.50.0090.00318.25
8.3.40.0150.01217.81
8.3.30.0210.00017.81
8.3.20.0250.00017.81
8.3.10.0220.00417.81
8.3.00.0240.01017.81
8.2.230.0050.00322.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0040.00818.51
8.2.190.0310.00917.81
8.2.180.0310.01217.81
8.2.170.0350.00717.81
8.2.160.0220.00717.81
8.2.150.0190.01317.81
8.2.140.0320.00317.81
8.2.130.0200.00317.81
8.2.120.0230.00017.81
8.2.110.0220.00617.81
8.2.100.0140.01017.81
8.2.90.0220.00017.81
8.2.80.0220.00017.81
8.2.70.0300.00417.81
8.2.60.0230.00417.81
8.2.50.0180.00717.81
8.2.40.0130.00917.81
8.2.30.0140.00717.81
8.2.20.0190.00317.81
8.2.10.0220.00417.81
8.2.00.0210.00517.81
8.1.290.0000.00930.84
8.1.280.0250.00317.81
8.1.270.0170.00917.81
8.1.260.0170.00717.81
8.1.250.0190.01017.81
8.1.240.0120.01217.81
8.1.230.0150.00917.81
8.1.220.0220.00317.81
8.1.210.0140.01017.81
8.1.200.0150.00617.81
8.1.190.0180.00417.81
8.1.180.0210.00317.81
8.1.170.0200.00417.81
8.1.160.0180.00717.81
8.1.150.0210.00417.81
8.1.140.0190.00517.81
8.1.130.0240.00017.81
8.1.120.0210.00317.81
8.1.110.0180.00217.81
8.1.100.0180.00317.81
8.1.90.0180.00517.81
8.1.80.0200.00717.81
8.1.70.0200.00317.81
8.1.60.0290.00417.81
8.1.50.0200.00917.81
8.1.40.0200.00717.81
8.1.30.0240.00317.81
8.1.20.0220.00317.81
8.1.10.0110.01117.81
8.1.00.0230.00317.81

preferences:
34.47 ms | 403 KiB | 5 Q