3v4l.org

run code in 300+ PHP versions simultaneously
<?php function str_contains_old(string $hay, string $needle): bool { return mb_stripos($hay, $needle) !== false; } $str1 = 'Hello world!'; $str2 = 'hello'; var_dump(str_contains_old($str1, $str2)); // gives bool(true) // str_contains var_dump(str_contains($str1, $str2)); // gives bool(false) $str1 = 'Część'; $str2 = 'cZĘŚĆ'; var_dump(str_contains_old($str1, $str2)); // gives bool(true) // str_contains var_dump(str_contains($str1, $str2)); // gives bool(false) $str1 = 'Część'; $str2 = 'czesc'; var_dump(str_contains_old($str1, $str2)); // gives bool(false) // str_contains var_dump(str_contains($str1, $str2)); // gives bool(false)

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.4.10.0130.00620.05
8.3.140.0150.00316.78
8.3.130.0080.00018.07
8.3.120.0040.00418.78
8.3.110.0090.00620.94
8.3.100.0160.00018.13
8.3.90.0080.00026.77
8.3.80.0050.00516.50
8.3.70.0070.01316.58
8.3.60.0090.00618.28
8.3.50.0070.00718.33
8.3.40.0070.00718.84
8.3.30.0120.00319.37
8.3.20.0040.00424.18
8.3.10.0090.00024.66
8.3.00.0080.00026.16
8.2.260.0110.00418.82
8.2.250.0030.00518.43
8.2.240.0030.00617.18
8.2.230.0050.00522.58
8.2.220.0060.00324.06
8.2.210.0060.01326.77
8.2.200.0060.00916.73
8.2.190.0110.00418.29
8.2.180.0150.00025.92
8.2.170.0120.00318.79
8.2.160.0100.00722.96
8.2.150.0000.00725.66
8.2.140.0000.00724.66
8.2.130.0080.00026.16
8.2.120.0040.00419.82
8.2.110.0030.00720.47
8.2.100.0040.00817.76
8.2.90.0050.00317.50
8.2.80.0090.00017.97
8.2.70.0030.00617.80
8.2.60.0080.00017.93
8.2.50.0060.00318.10
8.2.40.0040.00419.45
8.2.30.0070.00017.94
8.2.20.0000.00720.46
8.2.10.0040.00418.12
8.2.00.0030.00719.23
8.1.310.0140.00018.59
8.1.300.0100.00718.45
8.1.290.0030.00630.84
8.1.280.0080.00625.92
8.1.270.0050.00223.99
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0060.00323.92
8.1.230.0030.00719.01
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0050.00517.36
8.1.190.0060.00317.10
8.1.180.0050.00318.10
8.1.170.0050.00318.59
8.1.160.0000.00818.88
8.1.150.0000.00718.71
8.1.140.0080.00017.45
8.1.130.0030.00318.92
8.1.120.0050.00317.50
8.1.110.0050.00217.45
8.1.100.0040.00417.44
8.1.90.0020.00517.37
8.1.80.0060.00317.52
8.1.70.0000.00717.46
8.1.60.0000.00817.68
8.1.50.0040.00417.57
8.1.40.0160.00317.64
8.1.30.0220.00417.59
8.1.20.0130.01017.73
8.1.10.0190.00517.41
8.1.00.0220.00317.48
8.0.300.0040.00419.64
8.0.290.0060.00316.75
8.0.280.0000.00718.47
8.0.270.0040.00316.84
8.0.260.0060.00018.42
8.0.250.0030.00316.87
8.0.240.0040.00416.84
8.0.230.0000.00716.92
8.0.220.0040.00416.93
8.0.210.0000.00716.87
8.0.200.0000.01016.98
8.0.190.0030.00616.98
8.0.180.0180.00316.84
8.0.170.0180.00316.90
8.0.160.0200.00016.71
8.0.150.0160.00516.72
8.0.140.0190.00316.83
8.0.130.0120.00916.75
8.0.120.0180.00416.91
8.0.110.0150.00416.84
8.0.100.0190.00416.79
8.0.90.0150.00616.89
8.0.80.0200.00016.81
8.0.70.0030.00716.82
8.0.60.0000.00916.82
8.0.50.0140.00416.77
8.0.30.0170.00316.94
8.0.20.0170.00416.87
8.0.10.0200.00017.00
7.4.330.0050.00015.55
7.4.320.0030.00316.66
7.4.300.0000.01016.58
7.4.290.0190.00316.64
7.4.280.0230.00016.46
7.4.270.0160.00516.57
7.4.260.0210.00016.64
7.4.250.0050.01416.57
7.4.240.0030.01016.59
7.4.230.0090.00316.55
7.4.220.0120.00316.47
7.4.210.0030.01016.61
7.4.200.0120.00316.45
7.4.190.0060.00516.54
7.4.180.0080.00516.57
7.4.160.0100.00316.47
7.4.150.0000.00816.61
7.4.140.0100.00016.38
7.4.130.0030.00816.45
7.4.120.0030.00916.40
7.4.110.0060.00616.47
7.4.100.0110.00716.62
7.4.90.0160.00416.53
7.4.80.0080.01316.47
7.4.70.0150.00616.49
7.4.60.0130.00716.41
7.4.50.0130.00616.25
7.4.40.0220.00416.44
7.4.30.0310.00016.35
7.4.20.0160.00616.54
7.4.10.0100.01316.52
7.4.00.0190.00416.57

preferences:
59.16 ms | 406 KiB | 6 Q