3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { public function out(string $msg) { print __CLASS__ . ': ' . $msg . PHP_EOL; } } class Msg { public function __toString() { return "world"; } } class Bar extends Foo { public function out($msg) { print __CLASS__ . ': ' . $msg . PHP_EOL; } } $f = new Foo(); try { $f->out('hello'); } catch (TypeError $e) { print $e->getMessage() . PHP_EOL; } try { $f->out(new Msg()); } catch (TypeError $e) { print $e->getMessage() . PHP_EOL; } $b = new Bar(); try { $b->out('hello'); } catch (TypeError $e) { print $e->getMessage() . PHP_EOL; } try { $b->out(new Msg()); } catch (TypeError $e) { print $e->getMessage() . PHP_EOL; }

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.120.0100.00624.34
8.4.110.0030.00619.00
8.4.100.0150.00518.77
8.4.90.0120.00720.42
8.4.80.0040.00518.93
8.4.70.0040.00418.76
8.4.60.0140.00818.88
8.4.50.0130.00618.78
8.4.40.0200.00019.82
8.4.30.0110.01020.27
8.4.20.0030.00617.73
8.4.10.0030.00619.59
8.3.250.0080.01118.98
8.3.240.0090.01117.31
8.3.230.0050.00316.54
8.3.220.0130.00518.74
8.3.210.0110.01016.62
8.3.200.0050.00516.85
8.3.190.0130.00717.22
8.3.180.0120.00618.84
8.3.170.0050.01416.91
8.3.160.0090.00917.05
8.3.150.0130.00616.70
8.3.140.0090.00918.31
8.3.130.0040.00416.57
8.3.120.0040.00419.00
8.3.110.0080.00018.59
8.3.100.0090.00616.79
8.3.90.0110.00726.77
8.3.80.0060.00316.63
8.3.70.0170.00318.43
8.3.60.0140.00716.50
8.3.50.0110.00323.57
8.3.40.0110.00718.79
8.3.30.0070.00718.71
8.3.20.0060.00320.78
8.3.10.0080.00020.29
8.3.00.0070.00020.95
8.2.290.0110.00720.43
8.2.280.0090.01118.37
8.2.270.0130.00716.94
8.2.260.0110.00716.66
8.2.250.0080.00018.53
8.2.240.0040.01116.67
8.2.230.0030.00620.94
8.2.220.0040.00424.06
8.2.210.0060.00926.77
8.2.200.0030.00616.50
8.2.190.0070.00716.58
8.2.180.0070.01618.26
8.2.170.0060.00922.96
8.2.160.0140.00022.25
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00319.83
8.2.110.0100.00021.12
8.2.100.0050.00917.88
8.2.90.0030.00517.75
8.2.80.0080.00018.85
8.2.70.0060.00317.63
8.2.60.0030.00617.63
8.2.50.0050.00318.05
8.2.40.0030.00619.95
8.2.30.0020.00519.46
8.2.20.0040.00418.08
8.2.10.0020.00519.22
8.2.00.0050.00319.32
8.1.330.0060.00421.77
8.1.320.0110.00816.44
8.1.310.0150.00316.34
8.1.300.0040.01516.52
8.1.290.0090.00330.84
8.1.280.0030.01425.92
8.1.270.0040.00422.00
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00723.98
8.1.230.0040.00722.70
8.1.220.0060.00318.64
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0040.00417.23
8.1.180.0030.00618.10
8.1.170.0040.00417.62
8.1.160.0000.00719.06
8.1.150.0000.00718.96
8.1.140.0080.00018.81
8.1.130.0000.00720.15
8.1.120.0000.00717.37
8.1.110.0050.00317.49
8.1.100.0000.00817.45
8.1.90.0050.00217.48
8.1.80.0090.00017.52
8.1.70.0070.00017.46
8.1.60.0030.00717.48
8.1.50.0000.00817.42
8.1.40.0040.00417.41
8.1.30.0040.00417.64
8.1.20.0030.01017.68
8.1.10.0000.00817.62
8.1.00.0090.00017.42
8.0.300.0040.00818.77
8.0.290.0000.00716.75
8.0.280.0030.00318.52
8.0.270.0070.00018.08
8.0.260.0000.00619.99
8.0.250.0000.00717.05
8.0.240.0040.00417.07
8.0.230.0030.00317.01
8.0.220.0030.00316.96
8.0.210.0070.00016.93
8.0.200.0000.00717.03
8.0.190.0070.00016.90
8.0.180.0050.00216.96
8.0.170.0000.01116.94
8.0.160.0040.00416.86
8.0.150.0070.00016.90
8.0.140.0000.00817.00
8.0.130.0050.00013.46
8.0.120.0000.00716.89
8.0.110.0040.00416.79
8.0.100.0050.00216.87
8.0.90.0030.00616.87
8.0.80.0080.01216.88
8.0.70.0040.00416.79
8.0.60.0000.00816.90
8.0.50.0000.00716.98
8.0.30.0140.00317.16
8.0.20.0110.00817.15
8.0.10.0040.00416.91
8.0.00.0110.00916.71
7.4.330.0050.00015.55
7.4.320.0000.00616.36
7.4.300.0070.00016.64
7.4.290.0000.00716.48
7.4.280.0040.00416.52
7.4.270.0000.00816.53
7.4.260.0050.00013.32
7.4.250.0030.00316.50
7.4.240.0020.00516.58
7.4.230.0030.00316.61
7.4.220.0030.00416.64
7.4.210.0060.01216.60
7.4.200.0030.00516.38
7.4.130.0100.00916.37
7.4.120.0030.01316.59
7.4.110.0100.00716.67
7.4.100.0170.00016.43
7.4.90.0130.01016.71
7.4.80.0090.01117.22
7.4.70.0080.00916.32
7.4.60.0110.00916.49
7.4.50.0090.01116.34
7.4.40.0110.00916.37
7.4.30.0070.01216.30
7.4.20.0070.01316.53
7.4.10.0110.01016.51
7.4.00.0100.00916.42
7.3.330.0070.00016.43
7.3.320.0000.00613.24
7.3.310.0030.00616.27
7.3.300.0000.00716.38
7.3.290.0040.01316.34
7.3.280.0090.00616.27
7.3.260.0030.01416.34
7.3.240.0080.01116.47
7.3.230.0170.00316.42
7.3.210.0180.00016.63
7.3.200.0130.00716.34
7.3.190.0090.01016.45
7.3.180.0090.01316.33
7.3.170.0100.00916.25
7.3.160.0090.01016.31
7.3.150.0080.01016.46
7.3.140.0120.00816.44
7.3.130.0110.00716.47
7.3.120.0090.00816.43
7.3.110.0120.00716.40
7.3.100.0100.00816.32
7.3.90.0070.01116.43
7.3.80.0080.01216.40
7.3.70.0100.01016.38
7.3.60.0060.01416.31
7.3.50.0120.00716.32
7.3.40.0090.01016.42
7.3.30.0120.00716.36
7.3.20.0090.01016.31
7.3.10.0110.00816.32
7.3.00.0100.00916.35
7.2.330.0090.00916.63
7.2.320.0150.00716.59
7.2.310.0130.00916.45
7.2.300.0050.01416.75
7.2.290.0090.01016.46
7.2.280.0100.01016.55
7.2.270.0090.01116.51
7.2.260.0080.01116.73
7.2.250.0130.00416.67
7.2.240.0110.00916.71
7.2.230.0120.00916.72
7.2.220.0090.01116.65
7.2.210.0100.00916.56
7.2.200.0100.01016.68
7.2.190.0120.00916.54
7.2.180.0090.01116.64
7.2.170.0080.01016.54
7.2.160.0090.01016.66
7.2.150.0120.01016.72
7.2.140.0130.00716.61
7.2.130.0120.00816.69
7.2.120.0130.01216.63
7.2.110.0100.01016.65
7.2.100.0100.00916.67
7.2.90.0100.01116.69
7.2.80.0100.01116.65
7.2.70.0080.01416.65
7.2.60.0110.00916.63
7.2.50.0100.01116.61
7.2.40.0100.01016.67
7.2.30.0100.01116.67
7.2.20.0110.01116.58
7.2.10.0110.01116.64
7.2.00.0110.01016.66
7.1.330.0240.01315.59
7.1.320.0280.01215.50
7.1.310.0220.01515.71
7.1.300.0270.01215.51
7.1.290.0320.00315.56
7.1.280.0230.01215.59
7.1.270.0270.00515.59
7.1.260.0320.00015.48
7.1.250.0290.00815.46
7.1.240.0280.00915.66
7.1.230.0140.01815.51
7.1.220.0280.00915.43
7.1.210.0300.00715.50
7.1.200.0210.01415.43
7.1.190.0280.00915.43
7.1.180.0320.00515.57
7.1.170.0350.00315.59
7.1.160.0210.01515.50
7.1.150.0290.00715.44
7.1.140.0240.01415.50
7.1.130.0260.01015.43
7.1.120.0230.01015.41
7.1.110.0280.00415.53
7.1.100.0350.00015.49
7.1.90.0240.00815.48
7.1.80.0200.01215.62
7.1.70.0300.00915.50
7.1.60.0280.00615.53
7.1.50.0260.01315.56
7.1.40.0190.01215.76
7.1.30.0220.00915.49
7.1.20.0630.00315.47
7.1.10.0220.01415.50
7.1.00.0370.01115.38
7.0.330.0280.01015.39
7.0.320.0250.00715.30
7.0.310.0320.00415.43
7.0.300.0330.00315.34
7.0.290.0270.00715.41
7.0.280.0170.01915.44
7.0.270.0130.02215.16
7.0.260.0300.00815.36
7.0.250.0250.00915.41
7.0.240.0180.01215.42
7.0.230.0280.00715.29
7.0.220.0240.00715.22
7.0.210.0220.01215.16
7.0.200.0180.01515.43
7.0.190.0260.00915.34
7.0.180.0180.01515.27
7.0.170.0250.00615.24
7.0.160.0240.00515.29
7.0.150.0290.00315.21
7.0.140.0270.00415.33
7.0.130.0200.01015.20
7.0.120.0150.01915.31
7.0.110.0290.00715.24
7.0.100.0220.01015.28
7.0.90.0200.00915.29
7.0.80.0290.00315.31
7.0.70.0280.00415.18
7.0.60.0250.01115.24
7.0.50.0220.01215.22
7.0.40.0290.00815.27
7.0.30.0350.01115.29
7.0.20.0330.00315.29
7.0.10.0870.00715.21
7.0.00.0230.01015.20
5.6.400.0260.00916.03
5.6.390.0190.02016.02
5.6.380.0250.01215.79
5.6.370.0260.00815.86
5.6.360.0270.01215.84
5.6.350.0230.01315.93
5.6.340.0270.01515.61
5.6.330.0200.01215.82
5.6.320.0180.01515.94
5.6.310.0190.02016.00
5.6.300.0270.00816.05
5.6.290.0290.00715.77
5.6.280.0210.01215.95
5.6.270.0250.01415.72
5.6.260.0250.00816.03
5.6.250.0160.01715.67
5.6.240.0190.01416.00
5.6.230.0180.01416.07
5.6.220.0240.01315.79
5.6.210.0260.01315.87
5.6.200.0220.01615.90
5.6.190.0190.01515.88
5.6.180.0290.00815.73
5.6.170.0310.01016.01
5.6.160.0240.00915.84
5.6.150.0210.01515.88
5.6.140.0170.01815.86
5.6.130.0220.01115.81
5.6.120.0240.01515.78
5.6.110.0210.01715.92
5.6.100.0310.01416.01
5.6.90.0240.01316.04
5.6.80.0240.01315.71
5.6.70.0270.00915.93
5.6.60.0200.01415.95
5.6.50.0330.01015.88
5.6.40.0240.01015.86
5.6.30.0240.01015.78
5.6.20.0280.00915.93
5.6.10.0200.02415.80
5.6.00.0240.00915.71
5.5.380.0200.01115.78
5.5.370.0290.00415.83
5.5.360.0220.01315.66
5.5.350.0250.01115.82
5.5.340.0320.00615.70
5.5.330.0160.02115.84
5.5.320.0210.01715.80
5.5.310.0240.01415.66
5.5.300.0210.01215.97
5.5.290.0220.01215.76
5.5.280.0260.01215.85
5.5.270.0240.01115.93
5.5.260.0240.01515.82
5.5.250.0220.01615.84
5.5.240.0280.01115.64
5.5.230.0130.02515.77
5.5.220.0180.02115.93
5.5.210.0190.01615.72
5.5.200.0240.00915.81
5.5.190.0260.01715.82
5.5.180.0220.01916.02
5.5.170.0310.00915.78
5.5.160.0260.01415.60
5.5.150.0190.01615.78
5.5.140.0320.00715.79
5.5.130.0240.00915.73
5.5.120.0170.01815.63
5.5.110.0280.01415.88
5.5.100.0230.01315.64
5.5.90.0190.02015.69
5.5.80.0270.00915.48
5.5.70.0270.01015.76
5.5.60.0250.01215.81
5.5.50.0230.01215.72
5.5.40.0230.01415.70
5.5.30.0280.01015.73
5.5.20.0240.01515.59
5.5.10.0240.01115.64
5.5.00.0310.00715.95
5.4.450.0180.00912.46
5.4.440.0190.00612.73
5.4.430.0180.00712.63
5.4.420.0190.01112.50
5.4.410.0170.01212.64
5.4.400.0140.01512.48
5.4.390.0170.01112.46
5.4.380.0240.00312.64
5.4.370.0170.01312.52
5.4.360.0150.01012.59
5.4.350.0160.00812.44
5.4.340.0180.01212.56
5.4.330.0110.01512.61
5.4.320.0240.00712.39
5.4.310.0220.01312.53
5.4.300.0160.00712.69
5.4.290.0130.01612.69
5.4.280.0220.00812.43
5.4.270.0180.00712.48
5.4.260.0260.00612.47
5.4.250.0150.01112.71
5.4.240.0190.00812.50
5.4.230.0250.00312.69
5.4.220.0100.01412.58
5.4.210.0170.01312.41
5.4.200.0300.01112.74
5.4.190.0270.00412.53
5.4.180.0150.01512.54
5.4.170.0160.01012.61
5.4.160.0170.01212.50
5.4.150.0210.00612.54
5.4.140.0140.01412.50
5.4.130.0230.00712.45
5.4.120.0230.00312.63
5.4.110.0120.01312.57
5.4.100.0240.00612.59
5.4.90.0180.00712.58
5.4.80.0150.00912.58
5.4.70.0180.00712.42
5.4.60.0180.00912.70
5.4.50.0190.01112.49
5.4.40.0110.00912.57
5.4.30.0140.01112.54
5.4.20.0140.00912.48
5.4.10.0170.01112.60
5.4.00.0150.01112.59
5.3.290.0180.01113.16
5.3.280.0140.01112.94
5.3.270.0170.01313.11
5.3.260.0140.01413.13
5.3.250.0210.00413.12
5.3.240.0240.00313.15
5.3.230.0180.01012.91
5.3.220.0240.00612.92
5.3.210.0210.00813.06
5.3.200.0200.00913.05
5.3.190.0220.01013.14
5.3.180.0200.01213.24
5.3.170.0130.01613.23
5.3.160.0170.01313.25
5.3.150.0170.00613.40
5.3.140.0210.01413.32
5.3.130.0140.01113.04
5.3.120.0190.00513.10
5.3.110.0230.00813.04
5.3.100.0160.00713.12
5.3.90.0110.01413.22
5.3.80.0120.01212.97
5.3.70.0260.01312.92
5.3.60.0140.01212.96
5.3.50.0260.01012.95
5.3.40.0210.00412.93
5.3.30.0190.00913.23
5.3.20.0220.01212.98
5.3.10.0110.01512.77
5.3.00.0180.00712.89
5.2.170.0100.01712.01
5.2.160.0160.00912.13
5.2.150.0130.01012.01
5.2.140.0140.00912.14
5.2.130.0150.00612.13
5.2.120.0180.00612.03
5.2.110.0150.00812.06
5.2.100.0130.01012.04
5.2.90.0120.01012.01
5.2.80.0130.01012.01
5.2.70.0230.00012.01
5.2.60.0090.01312.01
5.2.50.0110.01412.01
5.2.40.0180.00412.01
5.2.30.0150.00912.04
5.2.20.0120.00912.01
5.2.10.0200.00412.01
5.2.00.0130.01112.01
5.1.60.0150.00812.01
5.1.50.0170.00412.01
5.1.40.0140.00912.01
5.1.30.0140.00512.01
5.1.20.0120.01412.01
5.1.10.0160.00812.01
5.1.00.0090.01312.01
5.0.50.0160.00512.01
5.0.40.0140.00712.01
5.0.30.0100.00912.01
5.0.20.0110.01012.01
5.0.10.0070.01012.01
5.0.00.0090.00912.01
4.4.90.0080.00312.01
4.4.80.0080.00412.01
4.4.70.0090.00012.01
4.4.60.0040.00712.01
4.4.50.0070.00212.01
4.4.40.0060.00612.01
4.4.30.0070.00712.01
4.4.20.0090.00312.01
4.4.10.0080.00312.01
4.4.00.0070.00512.01
4.3.110.0070.00512.01
4.3.100.0090.00012.01
4.3.90.0000.00012.01
4.3.80.0080.00512.01
4.3.70.0040.00612.01
4.3.60.0140.00012.01
4.3.50.0050.00212.01
4.3.40.0090.00212.01
4.3.30.0080.00312.01
4.3.20.0050.00512.01
4.3.10.0070.00412.01
4.3.00.0100.00012.01

preferences:
30.73 ms | 403 KiB | 5 Q