3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sub_string($pattern, $subject) { $n = strlen($subject); $m = strlen($pattern); for ($i = 0; $i < $n-$m; $i++) { $j = 0; while ($j < $m && $subject[$i+$j] == $pattern[$j]) { $j++; } if ($j == $m){ return 1; }else{ return 0; } } } echo sub_string("!!!!", "damn you");

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.60.0120.00616.63
8.3.50.0100.00718.19
8.3.40.0120.00318.88
8.3.30.0040.01118.89
8.3.20.0040.00419.30
8.3.10.0050.00323.48
8.3.00.0080.00020.77
8.2.180.0150.00418.41
8.2.170.0070.00722.96
8.2.160.0100.00721.98
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00419.83
8.2.120.0000.00826.35
8.2.110.0140.00720.38
8.2.100.0110.00017.78
8.2.90.0050.00317.88
8.2.80.0040.00417.97
8.2.70.0040.00417.80
8.2.60.0050.00318.34
8.2.50.0060.00318.10
8.2.40.0070.00019.30
8.2.30.0070.00019.42
8.2.20.0040.00418.18
8.2.10.0030.00518.13
8.2.00.0030.00517.71
8.1.280.0060.01025.92
8.1.270.0040.00418.83
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00323.92
8.1.230.0040.00720.90
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0070.00717.11
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0030.00518.51
8.1.160.0040.00418.81
8.1.150.0040.00418.77
8.1.140.0030.00322.10
8.1.130.0050.00320.23
8.1.120.0070.00017.38
8.1.110.0000.00717.35
8.1.100.0040.00417.37
8.1.90.0040.00417.36
8.1.80.0000.00717.44
8.1.70.0000.00717.47
8.1.60.0030.00517.61
8.1.50.0050.00317.49
8.1.40.0030.00617.42
8.1.30.0000.00817.68
8.1.20.0080.00017.59
8.1.10.0030.00617.46
8.1.00.0020.00517.37
8.0.300.0030.00518.77
8.0.290.0060.00316.75
8.0.280.0070.00018.45
8.0.270.0070.00017.20
8.0.260.0030.00318.45
8.0.250.0000.00716.88
8.0.240.0040.00416.85
8.0.230.0040.00416.91
8.0.220.0070.00316.79
8.0.210.0030.00316.90
8.0.200.0000.00716.91
8.0.190.0000.00816.87
8.0.180.0040.00416.98
8.0.170.0000.00816.93
8.0.160.0040.00416.79
8.0.150.0060.00316.73
8.0.140.0040.00416.69
8.0.130.0050.00013.32
8.0.120.0040.00416.87
8.0.110.0000.00716.69
8.0.100.0040.00417.02
8.0.90.0040.00416.85
8.0.80.0030.01316.87
8.0.70.0050.00216.80
8.0.60.0000.00716.91
8.0.50.0070.00016.77
8.0.30.0100.01016.90
8.0.20.0090.01617.40
8.0.10.0040.00416.98
8.0.00.0110.01016.92
7.4.330.0050.00015.55
7.4.320.0000.00616.48
7.4.300.0000.00616.65
7.4.290.0000.00716.59
7.4.280.0040.00416.60
7.4.270.0040.00416.65
7.4.260.0000.00716.58
7.4.250.0050.00316.56
7.4.240.0000.00816.43
7.4.230.0000.00816.63
7.4.220.0050.00316.50
7.4.210.0100.00416.46
7.4.200.0000.00816.68
7.4.160.0120.00616.49
7.4.140.0120.00517.86
7.4.130.0100.00716.48
7.4.120.0080.00916.47
7.4.110.0030.01716.48
7.4.100.0140.00316.49
7.4.90.0060.01316.64
7.4.80.0130.00919.39
7.4.70.0160.00816.59
7.4.60.0130.00316.44
7.4.50.0060.00916.59
7.4.40.0060.01016.38
7.4.00.0030.00914.98
7.3.330.0000.00513.19
7.3.320.0060.00013.36
7.3.310.0070.00016.34
7.3.300.0040.00416.36
7.3.290.0070.00016.22
7.3.280.0130.00716.35
7.3.260.0070.01216.50
7.3.240.0100.00916.45
7.3.230.0100.01016.45
7.3.210.0080.00816.30
7.3.200.0060.00916.41
7.3.190.0130.00316.40
7.3.180.0080.01416.28
7.3.170.0120.00616.36
7.3.160.0080.00816.28
7.3.10.0070.00716.77
7.3.00.0050.00516.38
7.2.330.0150.00916.57
7.2.320.0060.01216.61
7.2.310.0060.01016.70
7.2.300.0090.00616.84
7.2.290.0080.00916.69
7.2.130.0070.00417.07
7.2.120.0040.01116.97
7.2.110.0530.00615.67
7.2.100.0370.00815.60
7.2.90.0110.01015.69
7.2.80.0120.00815.60
7.2.70.0110.00415.86
7.2.60.0220.00715.73
7.2.50.0340.00915.92
7.2.40.0180.00415.87
7.2.30.0630.00515.69
7.2.20.0330.01215.75
7.2.10.0430.00515.93
7.2.00.0460.00315.85
7.1.250.0030.00615.77
7.1.230.1030.00714.07
7.1.220.0660.00013.92
7.1.210.1210.01013.64
7.1.200.0280.00613.33
7.1.190.0350.00413.83
7.1.180.0740.00613.88
7.1.170.0670.00313.55
7.1.160.0810.00713.59
7.1.150.0700.01013.21
7.1.140.0770.01013.78
7.1.130.1170.00713.40
7.1.120.1080.00013.82
7.1.110.0790.00013.61
7.1.100.0840.00613.58
7.1.90.0990.00713.89
7.1.80.0920.00013.71
7.1.70.0880.01013.96
7.1.60.0900.01431.78
7.1.50.2100.01031.59
7.1.40.0800.00331.82
7.1.30.0210.01731.94
7.1.20.0400.01131.64
7.1.10.0040.01113.55
7.1.00.0040.01113.96
5.6.380.0110.00814.48

preferences:
62.01 ms | 400 KiB | 5 Q