3v4l.org

run code in 300+ PHP versions simultaneously
<?php spl_autoload_register(function($cname){ if ($cname == 'IMyInterface') { interface IMyInterface { // Use any class or interface constant as value of FOO. // I'll just use some constant available out of the box, to keep it simple: const FOO = FilesystemIterator::CURRENT_AS_PATHNAME; } } elseif ($cname == 'Foo') { class Foo implements IMyInterface {} } elseif ($cname == 'Bar') { class Bar extends Foo implements IMyInterface {} } }); // Foo is super-class for Bar. // uncomment below line to trigger the error: $F = new Foo(); // this should run without errors at any time, but if Foo is instantiated // prior to this line, then the error is triggered: $B = new Bar();

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.00117.38
8.4.110.0100.01018.05
8.4.100.0120.01017.81
8.4.90.0080.00320.88
8.4.80.0110.00918.98
8.4.70.0110.00822.27
8.4.60.0110.01018.86
8.4.50.0120.00722.57
8.4.40.0120.00317.81
8.4.30.0090.00619.54
8.4.20.0190.00019.35
8.4.10.0100.00019.45
8.3.250.0120.00616.30
8.3.240.0060.00416.63
8.3.230.0100.01016.55
8.3.220.0050.00218.88
8.3.210.0140.00716.56
8.3.200.0040.00516.84
8.3.190.0130.00517.10
8.3.180.0110.00816.61
8.3.170.0070.01117.11
8.3.160.0180.00018.25
8.3.150.0110.00716.30
8.3.140.0000.00817.21
8.3.130.0000.01018.36
8.3.120.0040.01219.01
8.3.110.0150.00916.41
8.3.100.0090.00016.54
8.3.90.0170.00026.77
8.3.80.0040.00719.36
8.3.70.0140.00418.30
8.3.60.0030.01218.68
8.3.50.0090.01116.44
8.3.40.0060.00918.46
8.3.30.0110.00418.77
8.3.20.0050.00318.66
8.3.10.0080.00023.65
8.3.00.0080.00317.50
8.2.290.0070.00216.68
8.2.280.0140.00418.45
8.2.270.0110.00717.54
8.2.260.0040.00416.54
8.2.250.0040.00418.31
8.2.240.0080.00818.20
8.2.230.0120.01220.94
8.2.220.0040.00424.06
8.2.210.0050.00326.77
8.2.200.0080.00018.88
8.2.190.0070.01016.58
8.2.180.0070.00718.56
8.2.170.0120.00322.96
8.2.160.0080.00818.94
8.2.150.0070.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00421.12
8.2.110.0030.00621.18
8.2.100.0090.00317.71
8.2.90.0000.00917.84
8.2.80.0080.00019.10
8.2.70.0030.00718.04
8.2.60.0030.00617.68
8.2.50.0040.00418.10
8.2.40.0040.00420.19
8.2.30.0000.00719.31
8.2.20.0000.00717.97
8.2.10.0060.00318.05
8.2.00.0040.00418.33
8.1.330.0100.00916.09
8.1.320.0120.00717.87
8.1.310.0040.00418.38
8.1.300.0030.00618.17
8.1.290.0030.00730.84
8.1.280.0140.00625.92
8.1.270.0050.00219.96
8.1.260.0030.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00322.38
8.1.230.0040.00720.89
8.1.220.0090.00017.78
8.1.210.0000.00918.95
8.1.200.0060.00317.48
8.1.190.0060.00317.35
8.1.180.0000.00818.10
8.1.170.0050.00318.51
8.1.160.0000.00718.89
8.1.150.0040.00418.90
8.1.140.0030.00319.09
8.1.130.0040.00418.98
8.1.120.0000.00717.40
8.1.110.0040.00417.32
8.1.100.0000.00717.32
8.1.90.0000.00817.50
8.1.80.0040.00417.48
8.1.70.0030.00317.44
8.1.60.0000.00717.51
8.1.50.0090.00017.41
8.1.40.0060.00317.60
8.1.30.0060.00317.59
8.1.20.0070.00317.68
8.1.10.0050.00317.52
8.1.00.0000.00817.41
8.0.300.0000.00820.04
8.0.290.0040.00416.59
8.0.280.0060.00318.45
8.0.270.0030.00317.24
8.0.260.0060.00017.18
8.0.250.0000.00716.96
8.0.240.0080.00016.88
8.0.230.0040.00416.84
8.0.220.0030.00316.75
8.0.210.0070.00016.89
8.0.200.0030.00316.96
8.0.190.0000.00816.94
8.0.180.0070.00016.93
8.0.170.0050.00616.89
8.0.160.0000.00717.00
8.0.150.0050.00316.84
8.0.140.0070.00016.84
8.0.130.0000.00613.28
8.0.120.0000.00716.89
8.0.110.0040.00416.85
8.0.100.0050.00216.87
8.0.90.0040.00416.95
8.0.80.0000.02116.95
8.0.70.0000.00716.90
8.0.60.0000.00716.87
8.0.50.0030.00516.74
8.0.30.0070.01017.11
8.0.20.0130.00717.40
8.0.10.0000.00716.96
8.0.00.0050.01316.67
7.4.330.0000.00515.55
7.4.320.0030.00316.64
7.4.300.0000.00716.61
7.4.290.0000.00716.58
7.4.280.0060.00316.59
7.4.270.0070.00016.41
7.4.260.0040.00416.48
7.4.250.0030.00316.36
7.4.240.0070.00016.61
7.4.230.0000.00816.39
7.4.220.0000.00716.70
7.4.210.0100.01016.50
7.4.200.0070.00016.63
7.4.160.0110.00716.38
7.4.150.0110.00717.40
7.4.140.0120.00917.86
7.4.130.0090.00916.38
7.4.120.0100.00916.60
7.4.110.0100.00716.53
7.4.100.0110.01116.58
7.4.90.0040.01216.39
7.4.80.0070.01118.02
7.4.70.0090.00716.53
7.4.60.0080.00916.47
7.4.50.0080.00816.51
7.4.40.0120.00716.60
7.4.30.0060.01616.38
7.4.20.0150.00516.08
7.4.10.0080.01116.19
7.4.00.0090.00815.77
7.3.330.0050.00013.32
7.3.320.0060.00013.16
7.3.310.0000.00816.32
7.3.300.0070.00016.21
7.3.290.0100.00916.24
7.3.280.0060.00816.26
7.3.270.0160.00617.40
7.3.260.0110.00816.52
7.3.250.0130.00616.43
7.3.240.0080.01016.31
7.3.230.0070.01016.32
7.3.210.0090.00916.21
7.3.200.0070.01216.44
7.3.190.0100.00616.34
7.3.180.0120.00516.60
7.3.170.0070.01216.52
7.3.160.0100.00816.29
7.3.150.0060.01616.62
7.3.140.0100.01116.32
7.3.130.0060.01016.32
7.3.120.0060.01216.53
7.3.110.0070.01016.19
7.3.100.0060.01616.28
7.3.90.0120.00416.47
7.3.80.0060.00916.25
7.3.70.0100.00816.46
7.3.60.0030.01316.35
7.3.50.0060.01416.40
7.3.40.0050.01716.50
7.3.30.0060.01316.38
7.3.20.0130.01416.50
7.3.10.0080.01716.53
7.3.00.0140.00716.40
7.2.330.0120.00616.67
7.2.320.0080.01116.42
7.2.310.0140.00916.74
7.2.300.0090.01116.67
7.2.290.0080.01016.54
7.2.280.0090.01316.55
7.2.270.0040.01316.36
7.2.260.0070.01116.64
7.2.250.0150.00316.59
7.2.240.0030.01316.74
7.2.230.0150.00816.50
7.2.220.0080.01016.76
7.2.210.0140.00316.55
7.2.200.0150.00416.28
7.2.190.0040.01416.61
7.2.180.0120.01216.59
7.2.170.0200.00516.38
7.2.160.0130.01316.75
7.2.150.0090.01716.63
7.2.140.0090.01816.77
7.2.130.0200.00616.54
7.2.120.0120.01016.71
7.2.110.0140.00916.58
7.2.100.0220.01116.53
7.2.90.0070.01416.81
7.2.80.0870.01215.71
7.2.70.1380.01215.63
7.2.60.0680.01116.18
7.2.50.0980.00915.73
7.2.40.1120.00615.76
7.2.30.0720.01215.70
7.2.20.0750.01015.85
7.2.10.1080.00916.37
7.2.00.0840.01016.30
7.1.330.0130.00615.41
7.1.320.0110.00515.52
7.1.310.0100.01215.64
7.1.300.0160.01315.52
7.1.290.0330.00915.53
7.1.280.0040.01415.61
7.1.270.0170.00715.55
7.1.260.0190.01015.43
7.1.250.0090.00915.40
7.1.240.0050.01615.44
7.1.230.0140.00815.58
7.1.220.0190.00415.46
7.1.210.0060.01415.41
7.1.200.0570.00914.98
7.1.190.2020.00714.47
7.1.180.0800.00514.54
7.1.170.0660.01214.58
7.1.160.0930.00414.48
7.1.150.0860.00714.46
7.1.140.1180.01014.66
7.1.130.0960.00915.33
7.1.120.0570.01015.29
7.1.110.0820.00615.13
7.1.100.1000.00915.09
7.1.90.0690.01114.69
7.1.80.0580.01015.06
7.1.70.0580.00714.66
7.1.60.0610.01126.58
7.1.50.0400.00926.51
7.1.40.0410.00926.46
7.1.30.0620.00926.49
7.1.20.0590.01326.62
7.1.10.0390.00814.67
7.1.00.0240.00914.67
7.0.330.0140.00515.37
7.0.320.0040.01415.13
7.0.310.1370.00814.42
7.0.300.0790.00714.13
7.0.290.1020.01214.38
7.0.280.0670.01114.06
7.0.270.0970.00914.80
7.0.260.0570.00914.94
7.0.250.0650.00814.83
7.0.240.1150.01314.61
7.0.230.0610.01214.72
7.0.220.0640.00914.77
7.0.210.0230.00914.42
7.0.200.0370.00514.34
7.0.190.0700.00814.41
7.0.180.0260.00914.32
7.0.170.0910.01014.38
7.0.160.0460.00714.33
7.0.150.0370.01114.39
7.0.140.0220.01114.43
7.0.130.0400.00814.44
7.0.120.0390.00914.59
7.0.110.0390.01414.44
7.0.100.0380.00614.38
7.0.90.0470.00714.41
7.0.80.0540.00914.45
7.0.70.0380.00414.38
7.0.60.0320.01114.27
7.0.50.0380.01014.43
7.0.40.0250.01214.49
7.0.30.0530.00714.39
7.0.20.0290.00914.48
7.0.10.0270.00814.40
7.0.00.0310.00714.43
5.6.400.0070.01515.89
5.6.390.0060.02116.08
5.6.380.0080.01515.79
5.6.370.0110.01616.09
5.6.360.0040.01615.60
5.6.350.0120.00916.00
5.6.340.0130.00715.87
5.6.330.0080.01316.05
5.6.320.0090.01816.16
5.6.310.0080.01516.17
5.6.300.0150.02316.93
5.6.290.0140.02417.17
5.6.280.0190.02617.01
5.6.270.0150.03116.95
5.6.260.0120.03216.96
5.6.250.0120.02817.03
5.6.240.0160.03016.91
5.6.230.0140.03217.05
5.6.220.0120.03116.87
5.6.210.0140.02516.90
5.6.200.0140.02517.04
5.6.190.0090.03117.14
5.6.180.0150.02017.19
5.6.170.0160.02117.15
5.6.160.0170.02517.07
5.6.150.0110.02916.97
5.6.140.0090.03317.03
5.6.130.0080.02817.10
5.6.120.0110.02817.00
5.6.110.0100.02816.87
5.6.100.0130.02816.99
5.6.90.0130.02817.04
5.6.80.0110.02516.65
5.6.70.0110.02516.81
5.6.60.0130.02516.64
5.6.50.0140.02616.74
5.6.40.0080.02716.69
5.6.30.0100.02516.84
5.6.20.0130.02316.77
5.6.10.0150.02016.68
5.6.00.0090.02716.66
5.5.380.0080.01013.58
5.5.370.0080.01113.49
5.5.360.0030.01413.71
5.5.350.0100.00913.46
5.5.340.0110.00713.56
5.5.330.0070.01213.46
5.5.320.0090.01113.38
5.5.310.0140.00313.48
5.5.300.0100.00613.33
5.5.290.0130.00413.47
5.5.280.0070.01313.64
5.5.270.0100.00713.59
5.5.260.0090.00913.50
5.5.250.0060.01013.55
5.5.240.0130.00413.35
5.5.230.0060.01013.33
5.5.220.0070.01113.36
5.5.210.0070.01013.54
5.5.200.0090.00913.46
5.5.190.0100.00613.34
5.5.180.0120.00613.73
5.5.170.0080.00914.82
5.5.160.0120.00713.41
5.5.150.0100.00813.52
5.5.140.0080.01013.35
5.5.130.0110.01013.47
5.5.120.0080.01113.51
5.5.110.0080.01113.36
5.5.100.0070.01213.55
5.5.90.0060.01213.55
5.5.80.0120.00613.48
5.5.70.0120.01013.48
5.5.60.0120.00713.41
5.5.50.0110.00913.45
5.5.40.0070.01313.39
5.5.30.0120.00713.51
5.5.20.0080.00813.45
5.5.10.0100.00913.51
5.5.00.0070.01113.42
5.4.450.0100.00411.91
5.4.440.0070.00711.85
5.4.430.0060.00711.87
5.4.420.0080.00511.87
5.4.410.0070.00811.74
5.4.400.0030.01211.94
5.4.390.0070.00611.71
5.4.380.0080.00511.92
5.4.370.0130.00311.66
5.4.360.0080.00811.88
5.4.350.0070.00711.72
5.4.340.0090.00511.96
5.4.330.0060.00811.65
5.4.320.0060.00911.64
5.4.310.0060.00911.84
5.4.300.0040.01111.93
5.4.290.0060.00911.79
5.4.280.0130.00411.83
5.4.270.0120.00311.63
5.4.260.0060.00811.78
5.4.250.0090.00711.77
5.4.240.0060.01111.74
5.4.230.0070.00911.72
5.4.220.0060.00911.75
5.4.210.0040.01211.78
5.4.200.0070.01011.74
5.4.190.0050.01311.85
5.4.180.0090.00711.83
5.4.170.0070.00711.73
5.4.160.0070.00711.69
5.4.150.0090.00611.79
5.4.140.0090.00611.78
5.4.130.0060.00811.83
5.4.120.0050.00911.83
5.4.110.0060.00811.71
5.4.100.0130.00311.86
5.4.90.0110.00511.63
5.4.80.0150.00311.65
5.4.70.0110.00811.85
5.4.60.0060.01011.85
5.4.50.0060.00911.84
5.4.40.0070.00511.88
5.4.30.0020.01311.86
5.4.20.0080.00812.02
5.4.10.0090.00811.79
5.4.00.0110.00911.73
5.3.290.0090.00611.89
5.3.280.0070.00911.77
5.3.270.0110.00511.76
5.3.260.0070.00711.81
5.3.250.0050.01211.89
5.3.240.0080.00711.75
5.3.230.0060.00711.78
5.3.220.0080.00911.73
5.3.210.0110.00411.62
5.3.200.0100.00611.64
5.3.190.0090.01011.70
5.3.180.0110.00911.86
5.3.170.0140.00811.68
5.3.160.0060.00811.97
5.3.150.0030.01011.89
5.3.140.0110.00311.85
5.3.130.0160.00311.69
5.3.120.0110.00311.74
5.3.110.0120.00511.74
5.3.100.0080.00711.81
5.3.90.0090.00811.78
5.3.80.0090.01211.64
5.3.70.0070.00911.61
5.3.60.0090.00711.70
5.3.50.0130.00411.58
5.3.40.0140.00811.56
5.3.30.0060.01011.56
5.3.20.0070.00711.66
5.3.10.0160.00011.56
5.3.00.0050.00911.51
5.2.170.0140.00110.59
5.2.160.0060.01010.51
5.2.150.0060.00810.58
5.2.140.0060.00510.54
5.2.130.0090.00910.40
5.2.120.0040.01210.49
5.2.110.0140.00410.49
5.2.100.0080.00510.59
5.2.90.0060.00910.49
5.2.80.0110.00810.46
5.2.70.0050.00710.50
5.2.60.0000.01110.42
5.2.50.0080.00310.48
5.2.40.0070.00610.51
5.2.30.0120.00110.55
5.2.20.0070.00510.41
5.2.10.0100.00510.38
5.2.00.0100.00510.39
5.1.60.0070.00810.17
5.1.50.0130.00110.02
5.1.40.0040.00610.20
5.1.30.0040.00810.14
5.1.20.0080.00510.04
5.1.10.0060.00610.03
5.1.00.0080.0049.99
5.0.50.0070.0029.79
5.0.40.0030.0069.74
5.0.30.0110.0039.74
5.0.20.0080.0049.74
5.0.10.0090.0039.74
5.0.00.0060.0069.74
4.4.90.0080.0029.74
4.4.80.0010.0049.74
4.4.70.0020.0059.74
4.4.60.0030.0059.74
4.4.50.0070.0029.74
4.4.40.0040.0039.74
4.4.30.0050.0049.74
4.4.20.0070.0009.74
4.4.10.0040.0049.74
4.4.00.0050.0029.74
4.3.110.0040.0039.74
4.3.100.0060.0019.74
4.3.90.0060.0039.74
4.3.80.0030.0049.74
4.3.70.0030.0049.74
4.3.60.0040.0059.74
4.3.50.0060.0039.74
4.3.40.0030.0059.74
4.3.30.0060.0019.74
4.3.20.0040.0039.74
4.3.10.0040.0039.74
4.3.00.0040.0049.74

preferences:
31.03 ms | 403 KiB | 5 Q