3v4l.org

run code in 300+ PHP versions simultaneously
<?php function buildDynamicClass($parent, $child) { $reflection = new ReflectionClass($child); if($reflection->isAbstract()) { $abstract = 'abstract'; } else { $abstract = ''; } eval($abstract.' class '.$parent.' extends '.$child.' { }'); } function buildDynamicClass2($parent, $child) { class_alias($child, $parent); } class A { } $start = microtime(TRUE); for($i=0;$i<10000;$i++) { buildDynamicClass('B'.$i, 'A'); } echo 'buildDynamicClass: '.(microtime(TRUE)-$start); $start = microtime(TRUE); for($i=0;$i<10000;$i++) { buildDynamicClass2('B'.$i, 'A'); } echo 'buildDynamicClass2: '.(microtime(TRUE)-$start);

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)
7.4.10.0230.04521.59
7.4.00.0130.05520.93
7.3.130.0100.07822.57
7.3.120.0030.06322.42
7.3.110.0140.04122.15
7.3.100.0100.04222.24
7.3.90.0100.04222.02
7.3.80.0000.04722.33
7.3.70.0070.05022.11
7.3.60.0100.04622.34
7.3.50.0030.04122.11
7.3.40.0070.04722.14
7.3.30.0030.04422.17
7.3.20.0040.03923.24
7.3.10.0030.05723.11
7.3.00.0100.04923.06
7.2.260.0100.08323.02
7.2.250.0130.05422.56
7.2.240.0070.05522.94
7.2.230.0130.04622.93
7.2.220.0170.07222.50
7.2.210.0070.05322.96
7.2.200.0100.04522.62
7.2.190.0100.04222.78
7.2.180.0100.04323.07
7.2.170.0100.04622.80
7.2.160.0140.05422.61
7.2.150.0060.04123.52
7.2.140.0070.04623.54
7.2.130.0100.04523.30
7.2.120.0160.05523.37
7.2.110.0030.04423.42
7.2.100.0070.04023.29
7.2.90.0090.04323.52
7.2.80.0030.04723.39
7.2.70.0070.04223.17
7.2.60.0070.04323.32
7.2.50.0130.04923.52
7.2.40.0070.05023.48
7.2.30.0130.06723.23
7.2.20.0030.05023.28
7.2.10.0030.04723.56
7.2.00.0050.04424.56
7.1.330.0130.04324.79
7.1.320.0000.08224.49
7.1.310.0100.04824.57
7.1.300.0130.04324.39
7.1.290.0100.04524.87
7.1.280.0030.05324.70
7.1.270.0100.05524.64
7.1.260.0170.05124.71
7.1.250.0000.05424.71
7.1.240.0070.07024.70
7.1.230.0030.05224.42
7.1.220.0070.05024.79
7.1.210.0030.06224.85
7.1.200.0000.05024.58
7.1.190.0000.06524.66
7.1.180.0030.04524.32
7.1.170.0130.04524.44
7.1.160.0040.05124.66
7.1.150.0030.04724.51
7.1.140.0130.04024.59
7.1.130.0070.05824.72
7.1.120.0030.05424.77
7.1.110.0030.05124.89
7.1.100.0100.07124.49
7.1.90.0030.05524.76
7.1.80.0060.04524.80
7.1.70.0050.04825.62
7.1.60.0100.06123.11
7.1.50.0050.05223.13
7.1.40.0070.05724.48
7.1.30.0100.05324.53
7.1.20.0130.04524.51
7.1.10.0100.04424.65
7.1.00.0100.04224.53
7.0.330.0100.04924.40
7.0.320.0030.06124.30
7.0.310.0030.05024.35
7.0.300.0030.05224.22
7.0.290.0100.07624.44
7.0.280.0100.04724.14
7.0.270.0130.04624.36
7.0.260.0030.05024.48
7.0.250.0130.03724.42
7.0.240.0130.04224.32
7.0.230.0070.04124.43
7.0.220.0100.04424.45
7.0.210.0130.04224.45
7.0.200.0240.04624.33
7.0.190.0100.05024.21
7.0.180.0100.06024.45
7.0.170.0070.05124.41
7.0.160.0030.05224.13
7.0.150.0110.04524.09
7.0.140.0100.05824.52
7.0.130.0130.05024.36
7.0.120.0070.05024.55
7.0.110.0160.04224.40
7.0.100.0110.04624.21
7.0.90.0070.04724.34
7.0.80.0130.06324.46
7.0.70.0070.06524.37
7.0.60.0090.04724.13
7.0.50.0140.04124.56
7.0.40.0030.05316.54
7.0.30.0070.04216.57
7.0.20.0130.04216.53
7.0.10.0170.04016.55
7.0.00.0100.04716.54
5.6.400.0200.05723.05
5.6.390.0160.08522.78
5.6.380.0100.06022.29
5.6.370.0200.06122.88
5.6.360.0070.06823.06
5.6.350.0170.08122.77
5.6.340.0110.06422.84
5.6.330.0170.08822.88
5.6.320.0130.09822.84
5.6.310.0030.07522.96
5.6.300.0130.07122.58
5.6.290.0160.08922.36
5.6.280.0130.06722.77
5.6.270.0130.07122.48
5.6.260.0190.05722.72
5.6.250.0100.05922.81
5.6.240.0100.07322.71
5.6.230.0130.07522.83
5.6.220.0030.07222.82
5.6.210.0100.06822.75
5.6.200.0130.05922.69
5.6.190.0070.08722.53
5.6.180.0070.06322.77
5.6.170.0100.06722.59
5.6.160.0130.06222.68
5.6.150.0250.06822.50
5.6.140.0190.06922.48
5.6.130.0160.08222.54
5.6.120.0130.08022.80
5.6.110.0030.07722.53
5.6.100.0030.07022.52
5.6.90.0030.08422.73
5.6.80.0070.09322.57
5.6.70.0030.07722.45
5.6.60.0170.10722.73
5.6.50.0170.10322.49
5.6.40.0120.06922.57
5.6.30.0230.06222.51
5.6.20.0000.07022.55
5.6.10.0200.05922.68
5.6.00.0140.09822.74
5.5.380.0100.09422.29
5.5.370.0170.08622.57
5.5.360.0030.08622.68
5.5.350.0140.08622.71
5.5.340.0150.08822.51
5.5.330.0190.05822.38
5.5.320.0130.06322.62
5.5.310.0100.06122.62
5.5.300.0070.09922.78
5.5.290.0100.06322.56
5.5.280.0030.06822.78
5.5.270.0170.06022.29
5.5.260.0200.06022.38
5.5.250.0130.07022.59
5.5.240.0130.06722.57
5.5.230.0230.07322.42
5.5.220.0200.09022.43
5.5.210.0100.11122.48
5.5.200.0140.06622.49
5.5.190.0070.06922.14
5.5.180.0070.07122.49
5.5.170.0100.06722.29
5.5.160.0030.07122.31
5.5.150.0200.07122.40
5.5.140.0130.06822.50
5.5.130.0040.07422.54
5.5.120.0000.08122.39
5.5.110.0100.08422.55
5.5.100.0100.06622.71
5.5.90.0160.06822.59
5.5.80.0100.06322.34
5.5.70.0130.06722.41
5.5.60.0100.07422.35
5.5.50.0190.07122.58
5.5.40.0070.07222.64
5.5.30.0160.05622.11
5.5.20.0100.06822.16
5.5.10.0030.06922.80
5.5.00.0030.07322.47
5.4.450.0040.07419.58
5.4.440.0060.07019.55
5.4.430.0000.07719.46
5.4.420.0070.09519.48
5.4.410.0030.08919.43
5.4.400.0070.08719.41
5.4.390.0190.06019.41
5.4.380.0130.11119.29
5.4.370.0170.06619.46
5.4.360.0100.06719.17
5.4.350.0170.08019.14
5.4.340.0100.06119.48
5.4.330.0170.10019.52
5.4.320.0160.05919.26
5.4.310.0230.08319.32
5.4.300.0130.06319.52
5.4.290.0130.05919.36
5.4.280.0100.06319.54
5.4.270.0200.07319.46
5.4.260.0190.09419.30
5.4.250.0130.07119.59
5.4.240.0100.07719.38
5.4.230.0130.08519.33
5.4.220.0030.08719.50
5.4.210.0100.06219.63
5.4.200.0100.08919.14
5.4.190.0140.06819.01
5.4.180.0140.05919.21
5.4.170.0200.07319.09
5.4.160.0190.05919.32
5.4.150.0000.07419.21
5.4.140.0170.06319.41
5.4.130.0140.09319.29
5.4.120.0030.07319.46
5.4.110.0100.07219.35
5.4.100.0000.07919.38
5.4.90.0100.07419.44
5.4.80.0100.07019.10
5.4.70.0100.06619.19
5.4.60.0000.08019.25
5.4.50.0130.06419.19
5.4.40.0070.07119.47
5.4.30.0140.08319.45
5.4.20.0130.05819.12
5.4.10.0110.07019.45
5.4.00.0030.07419.55

preferences:
56.37 ms | 401 KiB | 5 Q