3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ "this is a sample test" => "asample test", "sample test1 \n new line content" => "test1 new" ]; $whitechars=[' ',"\t","\r","\n"]; foreach ($tests as $input => $check) { $pattern='~'.preg_replace('~\S(?!$)\K\s*~','\s*',$check).'~'; if(preg_match($pattern,$input)){ echo "Using Pattern: ($pattern) Found: "; }else{ echo "Did Not Find: "; } /* if (strpos(preg_replace('~\s+~', '', $input), preg_replace('~\s+~', '', $check))!==false){ echo "Found: "; }else{ echo "Did Not Find: "; } */ /* if (strpos(str_replace($whitechars, '', $input), str_replace($whitechars, '', $check))!==false){ echo "Found: "; }else{ echo "Did Not Find: "; } */ echo "$check IN $input"; echo "\n---\n"; }

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.5.10.0140.00316.50
8.5.00.0080.00520.21
8.4.150.0020.00014.05
8.4.140.0160.00817.81
8.4.130.0090.01118.07
8.4.120.0040.00520.57
8.4.110.0040.00720.77
8.4.100.0110.01017.86
8.4.90.0090.01220.54
8.4.80.0090.00918.92
8.4.70.0060.00320.68
8.4.60.0100.01020.52
8.4.50.0110.00920.61
8.4.40.0150.00618.03
8.4.30.0040.00419.58
8.4.20.0000.01219.60
8.4.10.0030.01719.63
8.3.280.0100.01018.71
8.3.270.0130.00616.75
8.3.260.0140.00716.93
8.3.250.0110.00819.04
8.3.240.0090.01116.88
8.3.230.0040.00516.90
8.3.220.0150.00418.76
8.3.210.0130.00618.65
8.3.200.0030.00616.81
8.3.190.0080.01117.04
8.3.180.0120.00718.88
8.3.170.0120.00617.10
8.3.160.0060.00316.66
8.3.150.0130.00618.67
8.3.140.0030.00617.10
8.3.130.0080.00018.54
8.3.120.0040.00419.21
8.3.110.0080.00020.94
8.3.100.0080.00024.06
8.3.90.0030.00626.77
8.3.80.0050.00518.55
8.3.70.0110.00716.61
8.3.60.0120.00318.44
8.3.50.0090.01217.44
8.3.40.0100.00718.59
8.3.30.0160.00318.76
8.3.20.0000.00721.91
8.3.10.0000.00823.60
8.3.00.0050.00322.11
8.2.290.0160.00316.96
8.2.280.0060.00418.31
8.2.270.0110.00718.82
8.2.260.0070.01117.20
8.2.250.0080.00316.55
8.2.240.0040.00417.28
8.2.230.0040.00422.58
8.2.220.0000.00937.54
8.2.210.0030.00526.77
8.2.200.0030.00616.75
8.2.190.0040.01516.75
8.2.180.0120.00616.63
8.2.170.0090.00622.96
8.2.160.0100.00322.28
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0110.00019.46
8.2.110.0060.00320.52
8.2.100.0090.00318.16
8.2.90.0080.00019.22
8.2.80.0040.00417.97
8.2.70.0060.00317.88
8.2.60.0110.00017.80
8.2.50.0030.00518.07
8.2.40.0040.00418.22
8.2.30.0020.00518.04
8.2.20.0040.00418.15
8.2.10.0040.00418.09
8.2.00.0040.00418.16
8.1.330.0090.00616.56
8.1.320.0080.01018.19
8.1.310.0110.00716.41
8.1.300.0110.00718.71
8.1.290.0070.00418.88
8.1.280.0110.01125.92
8.1.270.0070.00024.66
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0030.00623.83
8.1.230.0090.00318.92
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00617.50
8.1.190.0000.00817.47
8.1.180.0080.00018.10
8.1.170.0080.00018.75
8.1.160.0040.00418.96
8.1.150.0050.00222.13
8.1.140.0040.00417.72
8.1.130.0030.00519.09
8.1.120.0030.00617.63
8.1.110.0040.00417.60
8.1.100.0000.00717.60
8.1.90.0040.00417.52
8.1.80.0060.00317.55
8.1.70.0000.00817.50
8.1.60.0040.00417.79
8.1.50.0000.00917.70
8.1.40.0030.00617.66
8.1.30.0000.00917.76
8.1.20.0040.00417.70
8.1.10.0050.00317.66
8.1.00.0090.00017.64
8.0.300.0040.00418.96
8.0.290.0060.00317.00
8.0.280.0040.00418.47
8.0.270.0050.00517.30
8.0.260.0040.00417.10
8.0.250.0070.00017.13
8.0.240.0070.00017.15
8.0.230.0000.00917.13
8.0.220.0050.00317.09
8.0.210.0070.00016.99
8.0.200.0070.00017.19
8.0.190.0040.00417.06
8.0.180.0070.00417.12
8.0.170.0000.01017.11
8.0.160.0030.00317.20
8.0.150.0030.00317.02
8.0.140.0000.00816.98
8.0.130.0060.00013.54
8.0.120.0050.00317.04
8.0.110.0040.00417.13
8.0.100.0000.00817.22
8.0.90.0080.00017.07
8.0.80.0090.00617.00
8.0.70.0040.00417.08
8.0.60.0040.00417.05
8.0.50.0040.00417.09
8.0.30.0070.01117.43
8.0.20.0120.01217.45
8.0.10.0040.00417.08
8.0.00.0080.01216.90
7.4.330.0030.00415.55
7.4.320.0060.00316.73
7.4.300.0060.00016.72
7.4.290.0030.00316.84
7.4.280.0040.00416.77
7.4.270.0000.00816.67
7.4.260.0000.00816.80
7.4.250.0040.00416.83
7.4.240.0030.00316.91
7.4.230.0070.00016.71
7.4.220.0080.00016.89
7.4.210.0110.01116.69
7.4.200.0070.00016.91
7.4.160.0110.00816.86
7.4.140.0110.01217.86
7.4.130.0040.01416.74
7.4.120.0120.00516.66
7.4.110.0070.01016.66
7.4.100.0060.01117.04
7.4.90.0100.01416.67
7.4.80.0070.01519.39
7.4.70.0040.01716.83
7.4.60.0080.00816.49
7.4.50.0100.00716.72
7.4.40.0080.00816.62
7.4.00.0130.00315.06
7.3.330.0030.00313.46
7.3.320.0030.00313.27
7.3.310.0000.00816.47
7.3.300.0000.00816.57
7.3.290.0090.00716.53
7.3.280.0060.01216.51
7.3.260.0110.00816.48
7.3.240.0080.01016.61
7.3.230.0030.01316.76
7.3.210.0070.01416.67
7.3.200.0090.00616.43
7.3.190.0140.01016.60
7.3.180.0130.00516.38
7.3.170.0120.00416.33
7.3.160.0110.00716.50
7.2.330.0070.01016.92
7.2.320.0130.01216.63
7.2.310.0100.01316.82
7.2.300.0130.00616.85
7.2.290.0130.00516.88
7.2.60.0030.00917.00
7.2.30.0130.01020.13
7.2.20.0140.00920.14
7.2.10.0100.01419.99
7.2.00.0050.01319.84
7.1.200.0060.00615.86
7.1.150.0080.00918.97
7.1.140.0060.01518.50
7.1.130.0060.01518.81
7.1.120.0060.01018.84
7.1.110.0090.01118.25
7.1.100.0060.01018.40
7.1.90.0080.00918.64
7.1.80.0090.00618.20
7.1.70.0080.00717.38
7.1.60.0330.01435.30
7.1.50.0320.01635.13
7.1.40.0230.01334.70
7.1.30.0260.01334.99
7.1.20.0270.01934.89
7.1.10.0060.01016.91
7.1.00.0060.01616.90

preferences:
40.55 ms | 403 KiB | 5 Q