3v4l.org

run code in 300+ PHP versions simultaneously
<?php $anonymous = new class { public function echoMsg(): void { echo 'Hello World' . PHP_EOL; } }; // get_class($anonymous) で無名クラスのPHP内での名前を得る // class_alias で IHaveName というクラス名のエイリアスを作る class_alias(get_class($anonymous), 'IHaveName'); // 無名クラスのエイリアスである IHaveName を継承させる class ExtendAnonymous extends IHaveName { } // 動く $instance = new ExtendAnonymous(); $instance->echoMsg(); // Hello World var_dump($instance); // object(ExtendAnonymous)#1 (0) {} var_dump(get_class($instance)); // string(15) "ExtendAnonymous" var_dump($instance instanceof $anonymous); // bool(true)

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.20.0100.01020.76
8.4.10.0070.01319.35
8.3.150.0160.00316.47
8.3.140.0040.00416.82
8.3.130.0110.00718.54
8.3.120.0030.00520.72
8.3.110.0040.01420.94
8.3.100.0090.00024.06
8.3.90.0040.01526.77
8.3.80.0000.00919.36
8.3.70.0100.01018.43
8.3.60.0100.00716.62
8.3.50.0140.00416.43
8.3.40.0140.00320.08
8.3.30.0100.00321.63
8.3.20.0050.00324.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.260.0040.01417.29
8.2.250.0060.00316.70
8.2.240.0090.00918.98
8.2.230.0100.00022.58
8.2.220.0100.01037.54
8.2.210.0090.00626.77
8.2.200.0040.00418.88
8.2.190.0170.00316.63
8.2.180.0140.00016.50
8.2.170.0100.00322.96
8.2.160.0110.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0080.00019.64
8.2.110.0060.00821.25
8.2.100.0140.00220.07
8.2.90.0150.01018.87
8.2.80.0160.00718.69
8.2.70.0200.00518.68
8.2.60.0150.00818.54
8.2.50.0080.00619.77
8.2.40.0100.00418.73
8.2.30.0130.00118.82
8.2.20.0110.00720.05
8.2.10.0100.00619.11
8.2.00.0110.00719.14
8.1.310.0040.00416.52
8.1.300.0030.00616.21
8.1.290.0060.00330.84
8.1.280.0090.00925.92
8.1.270.0040.00423.91
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00818.57
8.1.230.0110.00318.60
8.1.220.0110.00318.60
8.1.210.0120.00219.89
8.1.200.0080.00618.41
8.1.190.0060.00720.65
8.1.180.0190.00518.31
8.1.170.0110.00318.44
8.1.160.0100.00418.50
8.1.150.0090.00320.52
8.1.140.0110.00318.50
8.1.130.0120.00418.55
8.1.120.0060.00618.59
8.1.110.0070.00519.72
8.1.100.0150.00919.40
8.1.90.0150.00018.50
8.1.80.0130.00018.63
8.1.70.0070.00419.66
8.1.60.0120.00418.71
8.1.50.0120.00518.56
8.1.40.0100.00618.53
8.1.30.0090.00418.84
8.1.20.0180.00319.53
8.1.10.0110.00618.49
8.1.00.0180.00318.63
8.0.300.0160.00118.68
8.0.290.0120.00317.80
8.0.280.0120.00317.80
8.0.270.0170.00617.74
8.0.260.0080.00318.36
8.0.250.0140.00317.85
8.0.240.0100.00517.90
8.0.230.0110.00219.32
8.0.220.0130.00317.83
8.0.210.0110.00417.71
8.0.200.0160.00217.79
8.0.190.0070.00518.34
8.0.180.0080.00717.83
8.0.170.0160.00017.79
8.0.160.0130.00317.82
8.0.150.0120.00417.76
8.0.140.0090.00618.69
8.0.130.0100.00318.26
8.0.120.0080.00718.73
8.0.110.0050.00519.20
8.0.100.0100.00617.80
8.0.90.0150.00017.85
8.0.80.0150.00017.78
8.0.70.0100.00517.72
8.0.60.0060.00618.08
8.0.50.0090.00717.84
8.0.30.0110.00218.25
8.0.20.0120.00317.91
8.0.10.0070.00817.94
8.0.00.0050.00323.52
7.4.330.0060.00516.30
7.4.320.0080.00617.49
7.4.300.0040.00519.30
7.4.290.0060.00319.28
7.4.280.0120.00217.46
7.4.270.0070.00119.26
7.4.260.0120.00217.33
7.4.250.0050.00417.50
7.4.240.0080.00317.29
7.4.230.0080.00617.51
7.4.220.0090.00018.41
7.4.210.0090.00317.35
7.4.200.0080.00018.46
7.4.190.0090.00317.50
7.4.180.0110.00017.63
7.4.160.0060.00219.26
7.4.150.0060.00118.45
7.4.140.0080.00118.43
7.4.130.0110.00117.42
7.4.120.0070.00417.39
7.4.110.0110.00517.43
7.4.100.0110.00517.41
7.4.90.0130.00317.34
7.4.80.0140.00217.34
7.4.70.0160.00017.35
7.4.60.0090.00817.21
7.4.50.0140.00717.23
7.4.40.0180.00617.25
7.4.30.0220.00317.26
7.4.20.0210.00318.11
7.4.10.0220.00418.20
7.4.00.0070.00719.24
7.3.330.0130.00517.44
7.3.320.0130.00817.31
7.3.310.0160.00517.31
7.3.300.0140.00417.25
7.3.290.0200.00417.26
7.3.280.0190.00617.18
7.3.270.0220.00217.28
7.3.260.0170.00417.33
7.3.250.0170.00717.78
7.3.240.0190.00517.24
7.3.230.0260.00917.38
7.3.220.0270.00717.12
7.3.210.0310.00517.17
7.3.200.0200.01217.12
7.3.190.0330.00617.38
7.3.180.0320.00617.07
7.3.170.0240.00317.22
7.3.160.0270.00217.21
7.3.150.0180.00817.15
7.3.140.0130.01317.19
7.3.130.0200.00817.21
7.3.120.0210.00417.22
7.3.110.0230.00217.20
7.3.100.0230.00217.04
7.3.90.0160.00917.35
7.3.80.0230.00217.14
7.3.70.0200.00517.07
7.3.60.0220.00317.32
7.3.50.0150.01017.29
7.3.40.0180.00817.35
7.3.30.0210.00317.41
7.3.20.0200.00519.19
7.3.10.0210.00519.10
7.3.00.0130.00519.13
7.2.340.0090.00618.12
7.2.330.0210.00517.36
7.2.320.0140.00217.31
7.2.310.0130.00417.23
7.2.300.0170.00117.05
7.2.290.0200.00517.32
7.2.280.0130.00617.23
7.2.270.0130.00317.42
7.2.260.0090.00717.25
7.2.250.0090.00717.50
7.2.240.0160.00017.38
7.2.230.0130.00317.40
7.2.220.0120.00417.43
7.2.210.0130.00317.18
7.2.200.0110.00817.54
7.2.190.0160.00017.44
7.2.180.0140.00617.46
7.2.170.0100.00617.76
7.2.160.0120.00417.57
7.2.150.0180.00321.26
7.2.140.0250.00619.17
7.2.130.0280.00419.43
7.2.120.0250.00219.41
7.2.110.0260.00319.35
7.2.100.0220.00819.36
7.2.90.0270.00619.42
7.2.80.0310.00719.25
7.2.70.0270.00219.45
7.2.60.0220.00319.55
7.2.50.0280.00819.39
7.2.40.0220.01419.42
7.2.30.0200.00419.49
7.2.20.0270.00719.44
7.2.10.0190.00720.61
7.2.00.0180.00419.42
7.1.330.0030.00818.40
7.1.320.0180.00418.34
7.1.310.0130.00718.37
7.1.300.0200.00618.22
7.1.290.0190.00418.19
7.1.280.0200.00718.32
7.1.270.0190.00818.21
7.1.260.0210.01018.26
7.1.250.0300.00118.19
7.1.240.0250.00418.23
7.1.230.0160.01218.33
7.1.220.0260.00518.21
7.1.210.0200.01118.32
7.1.200.0240.00618.32
7.1.190.0230.00418.24
7.1.180.0260.00218.21
7.1.170.0170.00619.47
7.1.160.0290.00318.19
7.1.150.0200.00818.03
7.1.140.0230.00818.31
7.1.130.0270.00318.36
7.1.120.0280.00318.08
7.1.110.0240.00918.22
7.1.100.0280.00318.08
7.1.90.0230.00818.22
7.1.80.0280.00318.23
7.1.70.0210.00818.06
7.1.60.0220.00518.29
7.1.50.0270.00518.29
7.1.40.0180.01318.35
7.1.30.0190.00918.33
7.1.20.0240.00518.22
7.1.10.0270.00518.19
7.1.00.0240.00818.26
7.0.330.0270.00317.77
7.0.320.0250.00517.77
7.0.310.0250.00017.87
7.0.300.0150.00417.98
7.0.290.0230.00517.93
7.0.280.0140.00717.75
7.0.270.0250.00518.02
7.0.260.0200.00818.05
7.0.250.0190.01018.26
7.0.240.0280.00318.17
7.0.230.0250.00518.23
7.0.220.0240.00118.08
7.0.210.0180.00619.05
7.0.200.0220.00817.96
7.0.190.0270.00318.01
7.0.180.0230.00817.97
7.0.170.0250.00518.19
7.0.160.0240.00418.06
7.0.150.0160.00917.90
7.0.140.0190.00317.92
7.0.130.0140.00818.09
7.0.120.0240.00317.81
7.0.110.0130.00817.94
7.0.100.0230.00618.09
7.0.90.0210.00817.93
7.0.80.0190.00817.83
7.0.70.0220.00617.85
7.0.60.0200.00718.04
7.0.50.0190.00117.75
7.0.40.0200.00217.90
7.0.30.0140.00818.03
7.0.20.0160.00617.90
7.0.10.0150.00718.00
7.0.00.0180.00417.91
5.6.400.0180.00316.56
5.6.390.0150.00616.63
5.6.380.0180.00116.45
5.6.370.0150.00216.55
5.6.360.0160.00116.56
5.6.350.0100.00416.49
5.6.340.0140.00516.50
5.6.330.0060.00416.48
5.6.320.0060.00116.50
5.6.310.0070.00716.50
5.6.300.0090.00316.41
5.6.290.0030.00916.59
5.6.280.0090.00716.43
5.6.270.0060.00716.56
5.6.260.0100.00216.59
5.6.250.0060.00316.47
5.6.240.0070.00416.54
5.6.230.0040.00716.65
5.6.220.0080.00016.59
5.6.210.0100.00216.55
5.6.200.0120.00516.75
5.6.190.0040.00416.67
5.6.180.0100.00016.80
5.6.170.0070.00316.70
5.6.160.0100.00216.70
5.6.150.0060.00316.68
5.6.140.0100.00016.62
5.6.130.0080.00416.58
5.6.120.0080.00716.59
5.6.110.0080.00716.47
5.6.100.0080.00416.62
5.6.90.0110.00116.46
5.6.80.0060.00216.54
5.6.70.0110.00616.58
5.6.60.0080.00316.72
5.6.50.0020.00616.71
5.6.40.0090.00316.49
5.6.30.0040.00416.50
5.6.20.0100.00116.43
5.6.10.0060.00416.50
5.6.00.0120.00416.38
5.5.380.0180.00116.56
5.5.370.0130.00216.58
5.5.360.0130.00016.46
5.5.350.0150.00016.40
5.5.340.0190.00316.45
5.5.330.0120.00216.43
5.5.320.0190.00416.49
5.5.310.0080.00716.35
5.5.300.0130.00316.45
5.5.290.0190.00416.47
5.5.280.0170.00216.30
5.5.270.0160.00416.38
5.5.260.0110.00316.32
5.5.250.0090.00516.42
5.5.240.0160.00216.39
5.5.230.0210.00016.49
5.5.220.0100.00416.51
5.5.210.0140.00416.49
5.5.200.0140.00016.38
5.5.190.0120.00316.42
5.5.180.0210.00316.47
5.5.170.0120.00816.41
5.5.160.0110.00216.40
5.5.150.0090.00516.30
5.5.140.0190.00016.30
5.5.130.0040.00416.30
5.5.120.0040.00816.30
5.5.110.0100.00516.37
5.5.100.0150.00216.40
5.5.90.0070.00116.62
5.5.80.0110.00016.48
5.5.70.0060.00616.48
5.5.60.0060.00616.53
5.5.50.0020.00716.42
5.5.40.0090.00316.45
5.5.30.0070.00217.03
5.5.20.0050.00616.43
5.5.10.0080.00216.35
5.5.00.0050.00716.43
5.4.450.0030.00316.30
5.4.440.0080.00316.30
5.4.430.0030.00516.30
5.4.420.0060.00316.30
5.4.410.0050.00316.30
5.4.400.0070.00016.30
5.4.390.0110.00316.30
5.4.380.0040.00316.30
5.4.370.0060.00316.30
5.4.360.0050.00416.30
5.4.350.0040.00216.30
5.4.340.0080.00016.30
5.4.330.0030.00316.30
5.4.320.0020.00416.30
5.4.310.0070.00216.30
5.4.300.0030.00516.30
5.4.290.0100.00416.30
5.4.280.0090.00016.30
5.4.270.0030.00616.30
5.4.260.0030.00516.30
5.4.250.0040.00416.30
5.4.240.0020.00816.30
5.4.230.0110.00316.30
5.4.220.0060.00416.30
5.4.210.0080.00216.30
5.4.200.0120.00216.30
5.4.190.0060.00216.30
5.4.180.0060.00216.30
5.4.170.0050.00316.30
5.4.160.0080.00416.30
5.4.150.0110.00416.30
5.4.140.0080.00316.30
5.4.130.0040.00716.30
5.4.120.0070.00316.30
5.4.110.0050.00316.30
5.4.100.0030.00416.30
5.4.90.0050.00316.30
5.4.80.0050.00216.30
5.4.70.0050.00516.30
5.4.60.0070.00216.30
5.4.50.0110.00316.30
5.4.40.0030.00516.30
5.4.30.0060.00216.30
5.4.20.0050.00316.30
5.4.10.0030.00616.30
5.4.00.0130.00216.30
5.3.290.0050.00316.30
5.3.280.0030.00316.30
5.3.270.0070.00216.30
5.3.260.0040.00116.30
5.3.250.0050.00116.30
5.3.240.0030.00316.30
5.3.230.0030.00316.30
5.3.220.0060.00016.30
5.3.210.0030.00316.30
5.3.200.0050.00516.30
5.3.190.0010.00416.30
5.3.180.0040.00116.30
5.3.170.0040.00116.30
5.3.160.0030.00316.30
5.3.150.0060.00016.30
5.3.140.0030.00316.30
5.3.130.0040.00316.30
5.3.120.0030.00316.30
5.3.110.0060.00016.30
5.3.100.0060.00016.30
5.3.90.0050.00016.30
5.3.80.0040.00116.30
5.3.70.0060.00016.30
5.3.60.0050.00116.30
5.3.50.0030.00316.30
5.3.40.0040.00116.30
5.3.30.0050.00116.30
5.3.20.0030.00316.30
5.3.10.0010.00516.30
5.3.00.0060.00316.30
5.2.170.0030.00316.30
5.2.160.0010.00416.30
5.2.150.0060.00016.30
5.2.140.0020.00316.30
5.2.130.0060.00016.30
5.2.120.0030.00216.30
5.2.110.0050.00016.30
5.2.100.0040.00116.30
5.2.90.0030.00616.30
5.2.80.0040.00116.30
5.2.70.0060.00216.30
5.2.60.0030.00516.30
5.2.50.0060.00216.30
5.2.40.0040.00316.30
5.2.30.0060.00216.30
5.2.20.0060.00116.30
5.2.10.0070.00016.30
5.2.00.0000.00516.30
5.1.60.0040.00116.30
5.1.50.0030.00216.30
5.1.40.0050.00016.30
5.1.30.0030.00116.30
5.1.20.0040.00116.30
5.1.10.0050.00016.30
5.1.00.0030.00416.30
5.0.50.0020.00216.30
5.0.40.0010.00316.30
5.0.30.0020.00216.30
5.0.20.0000.00416.30
5.0.10.0050.00016.30
5.0.00.0010.00316.30
4.4.90.0000.00216.30
4.4.80.0010.00216.30
4.4.70.0010.00116.30
4.4.60.0010.00116.30
4.4.50.0010.00116.30
4.4.40.0010.00116.30
4.4.30.0010.00116.30
4.4.20.0020.00016.30
4.4.10.0010.00116.30
4.4.00.0010.00116.30
4.3.110.0020.00016.30
4.3.100.0010.00116.30
4.3.90.0010.00116.30
4.3.80.0030.00016.30
4.3.70.0020.00016.30
4.3.60.0020.00016.30
4.3.50.0010.00116.30
4.3.40.0010.00116.30
4.3.30.0010.00116.30
4.3.20.0020.00016.30
4.3.10.0010.00116.30
4.3.00.0000.00216.30

preferences:
61.96 ms | 403 KiB | 5 Q