3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach ([ 'boolean' => 'true', 'double' => '1.2', 'integer' => '1', 'resource' => 'STDOUT', ] as $type => $value) { $functionName = "foo_{$type}"; $code = <<<EOT function {$functionName}({$type} \$i) { } {$functionName}({$value}); EOT; echo "Testing {$type} with\n", str_replace($functionName, 'foo', $code), "\nresults in:\n "; try { eval($code); echo "success.\n"; } catch (TypeError $e) { $message = str_replace($functionName, 'foo', $e->getMessage()); $message = substr($message, 0, strpos($message, ', called in ')); echo $message, "\n"; } echo "\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.4.10.0070.01319.65
8.3.140.0030.00620.72
8.3.130.0070.00416.76
8.3.120.0140.00418.97
8.3.110.0080.00820.94
8.3.100.0030.00516.64
8.3.90.0080.00026.77
8.3.80.0000.00819.36
8.3.70.0150.00618.25
8.3.60.0140.00716.63
8.3.50.0030.01018.23
8.3.40.0120.00318.97
8.3.30.0040.01118.88
8.3.20.0040.00421.80
8.3.10.0000.00821.85
8.3.00.0060.00319.56
8.2.250.0100.01016.49
8.2.240.0100.01017.12
8.2.230.0040.00422.58
8.2.220.0000.00837.54
8.2.210.0040.00426.77
8.2.200.0090.00018.88
8.2.190.0060.00916.75
8.2.180.0100.01318.29
8.2.170.0100.01019.08
8.2.160.0140.00322.96
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00421.14
8.2.110.0030.00720.92
8.2.100.0130.00017.80
8.2.90.0070.00318.03
8.2.80.0060.00318.16
8.2.70.0040.00417.63
8.2.60.0000.00817.63
8.2.50.0030.00618.04
8.2.40.0040.00418.04
8.2.30.0030.00719.45
8.2.20.0030.00617.95
8.2.10.0000.00818.08
8.2.00.0030.00617.99
8.1.300.0160.00318.06
8.1.290.0060.00330.84
8.1.280.0100.01025.92
8.1.270.0060.00323.97
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0040.00422.19
8.1.230.0000.01020.91
8.1.220.0000.00817.74
8.1.210.0000.00919.00
8.1.200.0000.00817.35
8.1.190.0080.00017.35
8.1.180.0090.00018.10
8.1.170.0040.00417.62
8.1.160.0040.00418.94
8.1.150.0000.00719.07
8.1.140.0050.00217.75
8.1.130.0080.00017.46
8.1.120.0000.00717.46
8.1.110.0110.00017.36
8.1.100.0080.00417.40
8.1.90.0070.00517.44
8.1.80.0080.00417.42
8.1.70.0080.00417.34
8.1.60.0110.00217.54
8.1.50.0060.00617.47
8.1.40.0060.00617.54
8.1.30.0100.00317.56
8.1.20.0070.00717.65
8.1.10.0040.00917.53
8.1.00.0050.00917.41
8.0.300.0000.00719.86
8.0.290.0000.00716.75
8.0.280.0040.00418.52
8.0.270.0040.00416.80
8.0.260.0000.00716.89
8.0.250.0040.00416.95
8.0.240.0050.00217.05
8.0.230.0110.00016.94
8.0.220.0080.00416.94
8.0.210.0090.00216.94
8.0.200.0090.00316.93
8.0.190.0070.00417.01
8.0.180.0050.00716.83
8.0.170.0050.00617.02
8.0.160.0070.00416.89
8.0.150.0080.00316.93
8.0.140.0070.00416.86
8.0.130.0070.00415.11
8.0.120.0090.00216.91
8.0.110.0020.00916.87
8.0.100.0050.00516.91
8.0.90.0090.00416.83
8.0.80.0070.01216.94
8.0.70.0030.00916.85
8.0.60.0110.00116.98
8.0.50.0050.00616.99
8.0.30.0120.00617.07
8.0.20.0080.01117.11
8.0.10.0110.00617.08
8.0.00.0120.00716.96
7.4.330.0020.00215.55
7.4.320.0070.00016.42
7.4.300.0060.00416.49
7.4.290.0060.00416.48
7.4.280.0090.00216.61
7.4.270.0070.00316.48
7.4.260.0070.00416.53
7.4.250.0060.00416.45
7.4.240.0090.00016.47
7.4.230.0000.00916.51
7.4.220.0060.00416.52
7.4.210.0060.00816.63
7.4.200.0080.00116.39
7.4.190.0000.01316.52
7.4.180.0000.01016.42
7.4.160.0050.00916.36
7.4.150.0050.00816.49
7.4.140.0080.01017.16
7.4.130.0110.00616.34
7.4.120.0110.01016.49
7.4.110.0110.00916.40
7.4.100.0130.00716.47
7.4.90.0120.00816.40
7.4.80.0130.00616.88
7.4.70.0110.00716.47
7.4.60.0060.00916.43
7.4.50.0060.01116.48
7.4.40.0100.00816.48
7.4.30.0100.00816.47
7.4.20.0080.01116.51
7.4.10.0100.00816.49
7.4.00.0090.01016.07
7.3.330.0060.00414.89
7.3.320.0070.00414.97
7.3.310.0070.00416.35
7.3.300.0070.00416.34
7.3.290.0050.00516.45
7.3.280.0100.00516.47
7.3.270.0080.00716.33
7.3.260.0060.01216.51
7.3.250.0090.00716.39
7.3.240.0100.01116.44
7.3.230.0140.00616.52
7.3.220.0130.00816.36
7.3.210.0150.00716.44
7.3.200.0100.00916.48
7.3.190.0090.01016.41
7.3.180.0130.00516.46
7.3.170.0100.00916.50
7.3.160.0110.00716.37
7.3.150.0080.00916.45
7.3.140.0100.01016.44
7.3.130.0080.01116.44
7.3.120.0100.00916.16
7.3.110.0120.00616.01
7.3.100.0100.00915.98
7.3.90.0120.00716.04
7.3.80.0120.00615.97
7.3.70.0090.00915.74
7.3.60.0090.00815.69
7.3.50.0100.00815.66
7.3.40.0100.00715.63
7.3.30.0110.00915.64
7.3.20.0130.00916.15
7.3.10.0170.00716.11
7.3.00.0100.01016.13
7.2.340.0170.01116.63
7.2.330.0170.01016.59
7.2.320.0160.00716.66
7.2.310.0150.01016.60
7.2.300.0160.00816.53
7.2.290.0140.01116.56
7.2.280.0120.01116.64
7.2.270.0130.01116.61
7.2.260.0140.01016.68
7.2.250.0140.00916.38
7.2.240.0130.00816.28
7.2.230.0100.01216.19
7.2.220.0110.01016.19
7.2.210.0140.00816.15
7.2.200.0120.00816.00
7.2.190.0100.01015.93
7.2.180.0120.00915.88
7.2.170.0100.01015.84
7.2.160.0150.00815.89
7.2.150.0110.01116.33
7.2.140.0120.00816.36
7.2.130.0130.00816.37
7.2.120.0150.00716.36
7.2.110.0120.00816.33
7.2.100.0150.00816.30
7.2.90.0180.00916.29
7.2.80.0140.00916.24
7.2.70.0150.00816.31
7.2.60.0130.00816.31
7.2.50.0120.00916.31
7.2.40.0120.00816.69
7.2.30.0190.00916.52
7.2.20.0140.00816.49
7.2.10.0140.00816.46
7.2.00.0130.01016.47
7.1.330.0130.01015.33
7.1.320.0240.00815.38
7.1.310.0150.00915.29
7.1.300.0120.00915.22
7.1.290.0140.00915.20
7.1.280.0190.00815.25
7.1.270.0140.00915.24
7.1.260.0130.00815.19
7.1.250.0150.00815.15
7.1.240.0160.00815.21
7.1.230.0160.00715.21
7.1.220.0240.00815.22
7.1.210.0150.01115.15
7.1.200.0140.00715.22
7.1.190.0310.00815.15
7.1.180.0140.00915.15
7.1.170.0140.00915.17
7.1.160.0230.01015.31
7.1.150.0280.00915.34
7.1.140.0180.00715.33
7.1.130.0160.01015.28
7.1.120.0140.01115.31
7.1.110.0180.00815.34
7.1.100.0300.00915.31
7.1.90.0160.00715.26
7.1.80.0140.00815.35
7.1.70.0200.00815.27
7.1.60.0170.00917.09
7.1.50.0160.00917.07
7.1.40.0190.00917.00
7.1.30.0190.00917.03
7.1.20.0150.00917.03
7.1.10.0130.00815.26
7.1.00.0140.00715.23
7.0.330.0140.00814.83
7.0.320.0110.01015.07
7.0.310.0360.00714.87
7.0.300.0200.00814.90
7.0.290.0150.00715.06
7.0.280.0130.00814.92
7.0.270.0120.01014.99
7.0.260.0110.01115.07
7.0.250.0140.00815.09
7.0.240.0140.00815.13
7.0.230.0140.00615.06
7.0.220.0170.00715.05
7.0.210.0140.00815.11
7.0.200.0120.00815.04
7.0.190.0170.00715.05
7.0.180.0160.00815.07
7.0.170.0140.00715.12
7.0.160.0120.01015.07
7.0.150.0120.00815.07
7.0.140.0140.01015.01
7.0.130.0130.00715.02
7.0.120.0130.00815.08
7.0.110.0140.00815.06
7.0.100.0140.00715.01
7.0.90.0130.00815.01
7.0.80.0140.00815.01
7.0.70.0130.00715.03
7.0.60.0160.00715.06
7.0.50.0140.00615.04
7.0.40.0140.00715.03
7.0.30.0140.01115.04
7.0.20.0150.00815.02
7.0.10.0120.00915.07
7.0.00.0150.00815.05
5.6.400.0140.01015.17
5.6.390.0150.01015.03
5.6.380.0140.00815.07
5.6.370.0160.00915.13
5.6.360.0150.00915.21
5.6.350.0130.01015.23
5.6.340.0140.01015.19
5.6.330.0150.00915.28
5.6.320.0130.01015.27
5.6.310.0140.00915.29
5.6.300.0140.01215.49
5.6.290.0150.01115.51
5.6.280.0140.01315.53
5.6.270.0130.01615.62
5.6.260.0120.01415.57
5.6.250.0130.01615.56
5.6.240.0160.01215.63
5.6.230.0130.01515.55
5.6.220.0140.01215.55
5.6.210.0130.01315.57
5.6.200.0120.01515.57
5.6.190.0160.01115.60
5.6.180.0150.01215.58
5.6.170.0150.01215.51
5.6.160.0150.01415.60
5.6.150.0160.01215.61
5.6.140.0140.01315.55
5.6.130.0150.01415.54
5.6.120.0150.01415.57
5.6.110.0140.01515.56
5.6.100.0130.01615.53
5.6.90.0150.01415.52
5.6.80.0140.01515.47
5.6.70.0140.01315.43
5.6.60.0140.01315.44
5.6.50.0160.01215.43
5.6.40.0150.01315.44
5.6.30.0150.01315.50
5.6.20.0140.01515.42
5.6.10.0160.01315.45
5.6.00.0150.01215.43
5.5.380.0150.00914.92
5.5.370.0140.00914.83
5.5.360.0140.00914.84
5.5.350.0140.00914.86
5.5.340.0140.00914.91
5.5.330.0160.00614.89
5.5.320.0140.01014.85
5.5.310.0140.00914.92
5.5.300.0150.00914.87
5.5.290.0160.00814.87
5.5.280.0140.01014.80
5.5.270.0140.01014.86
5.5.260.0150.00714.82
5.5.250.0130.01014.88
5.5.240.0140.00914.82
5.5.230.0130.00914.87
5.5.220.0130.00814.79
5.5.210.0130.00914.83
5.5.200.0120.01114.78
5.5.190.0140.00914.85
5.5.180.0140.01014.88
5.5.170.0140.00915.06
5.5.160.0140.00914.77
5.5.150.0140.00914.91
5.5.140.0150.00814.84
5.5.130.0140.00814.83
5.5.120.0130.01014.84
5.5.110.0140.00814.80
5.5.100.0140.00914.75
5.5.90.0120.00914.74
5.5.80.0120.00914.79
5.5.70.0150.00814.79
5.5.60.0140.00814.74
5.5.50.0130.00914.85
5.5.40.0130.01014.82
5.5.30.0120.01014.79
5.5.20.0130.01014.82
5.5.10.0140.00814.85
5.5.00.0140.00914.79
5.4.450.0100.00912.21
5.4.440.0100.00812.16
5.4.430.0110.00612.15
5.4.420.0130.00512.21
5.4.410.0110.00612.23
5.4.400.0100.00612.17
5.4.390.0100.00712.13
5.4.380.0110.00612.15
5.4.370.0100.00712.11
5.4.360.0110.00612.09
5.4.350.0120.00612.15
5.4.340.0110.00612.11
5.4.330.0100.00712.11
5.4.320.0110.00712.10
5.4.310.0110.00712.12
5.4.300.0100.00612.09
5.4.290.0100.00712.11
5.4.280.0110.00612.17
5.4.270.0110.00712.16
5.4.260.0080.00912.08
5.4.250.0110.00512.11
5.4.240.0120.00612.14
5.4.230.0110.00712.10
5.4.220.0100.00712.10
5.4.210.0110.00712.12
5.4.200.0120.00612.10
5.4.190.0130.00412.11
5.4.180.0100.00712.10
5.4.170.0120.00512.11
5.4.160.0110.00612.08
5.4.150.0120.00612.11
5.4.140.0100.00812.19
5.4.130.0100.00812.19
5.4.120.0120.00612.13
5.4.110.0120.00512.15
5.4.100.0100.00712.16
5.4.90.0100.00712.18
5.4.80.0100.00712.18
5.4.70.0100.00712.13
5.4.60.0100.00612.18
5.4.50.0120.00712.19
5.4.40.0120.00612.18
5.4.30.0100.00812.18
5.4.20.0120.00612.17
5.4.10.0120.00612.17
5.4.00.0100.00712.09
5.3.290.0130.00512.08
5.3.280.0100.00612.01
5.3.270.0100.00712.01
5.3.260.0100.00812.02
5.3.250.0070.00812.07
5.3.240.0100.00711.95
5.3.230.0110.00611.99
5.3.220.0110.00612.02
5.3.210.0100.00812.00
5.3.200.0100.00811.98
5.3.190.0100.00812.03
5.3.180.0110.00812.15
5.3.170.0100.00612.13
5.3.160.0110.00612.17
5.3.150.0090.00812.14
5.3.140.0110.00612.10
5.3.130.0110.00712.07
5.3.120.0110.00612.08
5.3.110.0110.00712.07
5.3.100.0100.00712.08
5.3.90.0090.00812.14
5.3.80.0100.00712.04
5.3.70.0100.00612.01
5.3.60.0080.00812.09
5.3.50.0110.00612.03
5.3.40.0110.00612.03
5.3.30.0090.00612.04
5.3.20.0090.00712.04
5.3.10.0110.00611.90
5.3.00.0090.00811.89
5.2.170.0080.00611.42
5.2.160.0080.00711.39
5.2.150.0100.00511.37
5.2.140.0080.00611.37
5.2.130.0090.00611.40
5.2.120.0100.00511.35
5.2.110.0100.00511.37
5.2.100.0080.00611.37
5.2.90.0080.00611.39
5.2.80.0100.00511.32
5.2.70.0090.00611.35
5.2.60.0090.00611.30
5.2.50.0090.00611.35
5.2.40.0080.00611.33
5.2.30.0090.00711.29
5.2.20.0070.00811.26
5.2.10.0090.00511.21
5.2.00.0090.00611.14
5.1.60.0070.00610.91
5.1.50.0090.00410.89
5.1.40.0070.00610.96
5.1.30.0090.00410.97
5.1.20.0080.00510.96
5.1.10.0070.00510.96
5.1.00.0080.00410.87
5.0.50.0080.00310.70
5.0.40.0070.00410.70
5.0.30.0070.00410.68
5.0.20.0060.00510.65
5.0.10.0060.00510.66
5.0.00.0050.00510.65
4.4.90.0050.00410.63
4.4.80.0060.00310.63
4.4.70.0060.00210.63
4.4.60.0050.00310.63
4.4.50.0040.00310.63
4.4.40.0040.00410.63
4.4.30.0050.00310.63
4.4.20.0050.00210.63
4.4.10.0050.00310.63
4.4.00.0040.00310.63
4.3.110.0040.00410.63
4.3.100.0050.00310.63
4.3.90.0050.00310.63
4.3.80.0050.00310.63
4.3.70.0050.00310.63
4.3.60.0040.00310.63
4.3.50.0050.00310.63
4.3.40.0040.00310.63
4.3.30.0030.00310.63
4.3.20.0030.00410.63
4.3.10.0040.00210.63
4.3.00.0040.00310.63

preferences:
34 ms | 403 KiB | 5 Q