3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!function_exists('str_contains')) { function str_contains(string $haystack, string $needle): bool { return '' === $needle || false !== strpos($haystack, $needle); } }; $types = [ 'string' => 'test', 'int' => 1, 'float' => 1.23, 'null' => null, 'true' => true, 'false' => false, 'object' => new StdClass(), 'array' => [], ]; $result = [ ]; foreach($types as $type => $val) { try { $res = str_contains($val, 'test'); } catch (Error $e) { $res = 'Fatal error triggered'; } $result[$type] = $res; } var_export($result);

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.70.0070.00718.55
8.3.60.0090.00616.63
8.3.50.0140.00718.32
8.3.40.0090.00618.84
8.3.30.0100.01018.67
8.3.20.0080.00024.18
8.3.10.0050.00224.66
8.3.00.0040.00426.16
8.2.180.0130.00925.92
8.2.170.0160.00318.95
8.2.160.0070.00722.96
8.2.150.0070.01025.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00420.94
8.2.110.0000.00820.43
8.2.100.0040.00717.91
8.2.90.0000.00917.86
8.2.80.0000.00818.91
8.2.70.0040.00417.63
8.2.60.0060.00318.03
8.2.50.0060.00318.07
8.2.40.0040.00418.16
8.2.30.0060.00318.21
8.2.20.0050.00318.06
8.2.10.0000.00719.34
8.2.00.0040.00419.21
8.1.280.0000.01425.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00418.93
8.1.230.0080.00417.77
8.1.220.0060.00317.74
8.1.210.0030.00518.77
8.1.200.0090.00017.35
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0130.00318.25
8.1.160.0070.00318.98
8.1.150.0060.00318.91
8.1.140.0000.00720.58
8.1.130.0070.00020.09
8.1.120.0000.00817.43
8.1.110.0040.00417.50
8.1.100.0020.00517.48
8.1.90.0020.00517.45
8.1.80.0040.00417.45
8.1.70.0000.00717.47
8.1.60.0040.00417.63
8.1.50.0040.00417.58
8.1.40.0030.00617.43
8.1.30.0040.00417.64
8.1.20.0030.00517.57
8.1.10.0000.00817.65
8.1.00.0080.00017.51
8.0.300.0030.00718.77
8.0.290.0000.00716.75
8.0.280.0050.00318.52
8.0.270.0040.00418.05
8.0.260.0070.00020.27
8.0.250.0000.00717.03
8.0.240.0030.00317.09
8.0.230.0000.00816.98
8.0.220.0030.00317.00
8.0.210.0030.00516.96
8.0.200.0030.00317.05
8.0.190.0000.00816.93
8.0.180.0000.00716.93
8.0.170.0070.00316.89
8.0.160.0050.00216.88
8.0.150.0050.00216.94
8.0.140.0000.00816.98
8.0.130.0030.00313.42
8.0.120.0050.00316.98
8.0.110.0000.00817.03
8.0.100.0040.00417.04
8.0.90.0050.00317.00
8.0.80.0030.01216.98
8.0.70.0000.00816.78
8.0.60.0070.00016.93
8.0.50.0080.00016.87
8.0.30.0110.00617.30
8.0.20.0080.01117.11
8.0.10.0000.00717.17
8.0.00.0100.01317.01
7.4.330.0050.00015.55
7.4.320.0030.00316.45
7.4.300.0030.00316.61
7.4.290.0000.00716.61
7.4.280.0070.00516.64
7.4.270.0060.00016.55
7.4.260.0030.00316.61
7.4.250.0000.00716.51
7.4.240.0000.00716.49
7.4.230.0080.00016.53
7.4.220.0000.00716.55
7.4.210.0070.00816.57
7.4.200.0000.00716.59
7.4.130.0200.00316.48
7.4.120.0100.01316.65
7.4.110.0060.01216.54
7.4.100.0000.01616.75
7.4.90.0160.00616.45
7.4.80.0080.01116.58
7.4.70.0150.00316.54
7.4.60.0150.00316.66
7.4.50.0150.00316.48
7.4.40.0140.00416.70
7.4.30.0120.00616.71
7.4.20.0130.00416.75
7.4.10.0070.01116.60
7.4.00.0130.00416.61
7.3.330.0070.00016.50
7.3.320.0030.00313.47
7.3.310.0000.00716.35
7.3.300.0000.00616.40
7.3.290.0050.01116.45
7.3.280.0030.01316.45
7.3.260.0040.01516.68
7.3.230.0100.00616.56
7.3.210.0170.00416.54
7.3.200.0120.00616.33
7.3.190.0120.00616.53
7.3.180.0120.01216.28
7.3.170.0030.01516.60
7.3.160.0150.00316.46
7.3.150.0060.01116.41
7.3.140.0060.01116.59
7.3.130.0070.01016.63
7.3.120.0170.00016.38
7.3.110.0100.00716.36
7.3.100.0140.00316.45
7.3.90.0080.00816.53
7.3.80.0100.00716.48
7.3.70.0100.00716.56
7.3.60.0110.00616.56
7.3.50.0100.00716.52
7.3.40.0130.01016.33
7.3.30.0140.01116.48
7.3.20.0120.00616.47
7.3.10.0230.01316.48
7.3.00.0040.01416.46
7.2.330.0100.01316.75
7.2.320.0120.00616.77
7.2.310.0120.00916.56
7.2.300.0070.01016.42
7.2.290.0090.00916.61
7.2.280.0090.00916.64
7.2.270.0120.00616.69
7.2.260.0100.00716.80
7.2.250.0150.00316.85
7.2.240.0130.00416.54
7.2.230.0090.00916.65
7.2.220.0090.00916.61
7.2.210.0090.00916.70
7.2.200.0030.01516.84
7.2.190.0130.00616.55
7.2.180.0180.00016.71
7.2.170.0100.00716.67
7.2.160.0090.00916.45
7.2.150.0070.01116.82
7.2.140.0030.01616.61
7.2.130.0040.01416.57
7.2.120.0090.00916.65
7.2.110.0060.01216.59
7.2.100.0090.00916.71
7.2.90.0160.00716.70
7.2.80.0060.01216.56
7.2.70.0090.00916.74
7.2.60.0070.01116.67
7.2.50.0150.00416.74
7.2.40.0030.01616.59
7.2.30.0040.01416.79
7.2.20.0120.00816.70
7.2.10.0050.01516.71
7.2.00.0100.00716.48

preferences:
31.26 ms | 400 KiB | 5 Q