3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Mammal { function mate(Mammal $with) { $thisClass = get_class($this); $withClass = get_class($with); $class = substr($thisClass, 0, -rand(1, strlen($thisClass) - 1)) . substr($withClass, rand(1, strlen($withClass) - 1)); eval("class $class extends Mammal {}"); return new $class; } } class Panda extends Mammal {} class Dolphin extends Mammal {} class Squirrel extends Mammal {} class Kangaroo extends Mammal {} $mingmong = new Panda; $charles = new Dolphin; $suqidgy = new Squirrel; $wanger = new Kangaroo; $charlimong = $mingmong->mate($charles); $wangy = $wanger->mate($squidgy); $wangimong = $wanger->mate($charlimong); var_dump($wangimong);

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.0060.00715.12
7.4.00.0080.00915.07
7.3.130.0050.01314.98
7.3.120.0100.00514.93
7.3.110.0050.01114.91
7.3.100.0050.00914.98
7.3.90.0050.01014.95
7.3.80.0070.00614.93
7.3.70.0040.01114.83
7.3.60.0050.00514.92
7.3.50.0090.00314.80
7.3.40.0090.00214.92
7.3.30.0070.00514.74
7.3.20.0060.00716.74
7.3.10.0030.01016.65
7.3.00.0080.00516.62
7.2.260.0050.01415.10
7.2.250.0080.01015.00
7.2.240.0060.00815.17
7.2.230.0040.01015.02
7.2.220.0030.01015.19
7.2.210.0050.00914.93
7.2.200.0050.00914.96
7.2.190.0080.00815.02
7.2.180.0030.01314.89
7.2.170.0060.00814.89
7.2.160.0070.00714.86
7.2.150.0070.00816.77
7.2.140.0050.01116.84
7.2.130.0030.01116.90
7.2.120.0070.00516.88
7.2.110.0050.00916.81
7.2.100.0090.00616.87
7.2.90.0040.00716.82
7.2.80.0070.00916.96
7.2.70.0030.01217.01
7.2.60.0060.00516.92
7.2.50.0030.00716.88
7.2.40.0100.00516.92
7.2.30.0070.01216.96
7.2.20.0080.00516.98
7.2.10.0030.00916.94
7.2.00.0060.00717.57
7.1.330.0030.00915.69
7.1.320.0040.01015.89
7.1.310.0070.00515.97
7.1.300.0070.00415.81
7.1.290.0070.00715.90
7.1.280.0080.00515.91
7.1.270.0090.00515.70
7.1.260.0100.00315.74
7.1.250.0030.00815.77
7.1.240.0060.01115.94
7.1.230.0050.00915.79
7.1.220.0040.01015.82
7.1.210.0040.00615.92
7.1.200.0040.00915.79
7.1.190.0020.01015.91
7.1.180.0070.00715.72
7.1.170.0060.00815.65
7.1.160.0070.00715.73
7.1.150.0070.00915.78
7.1.140.0050.01015.95
7.1.130.0020.01115.71
7.1.120.0070.00715.85
7.1.110.0040.00915.89
7.1.100.0030.00915.84
7.1.90.0050.00815.94
7.1.80.0070.00615.67
7.1.70.0040.00616.37
7.1.60.0080.00516.12
7.1.50.0090.00716.20
7.1.40.0070.00815.93
7.1.30.0050.00715.71
7.1.20.0040.00815.71
7.1.10.0020.01115.81
7.1.00.0050.03018.08
7.0.330.0060.00615.41
7.0.320.0050.01015.22
7.0.310.0040.00815.47
7.0.300.0090.00515.36
7.0.290.0050.01015.45
7.0.280.0030.01015.50
7.0.270.0060.01015.44
7.0.260.0050.00915.24
7.0.250.0020.00915.46
7.0.240.0070.00715.43
7.0.230.0000.01115.42
7.0.220.0020.01015.50
7.0.210.0060.00615.59
7.0.200.0050.00915.97
7.0.190.0030.01115.49
7.0.180.0070.00915.42
7.0.170.0050.00315.43
7.0.160.0060.00515.32
7.0.150.0030.00815.58
7.0.140.0010.03217.45
7.0.130.0090.00015.54
7.0.120.0030.00715.38
7.0.110.0090.00515.44
7.0.100.0070.00715.40
7.0.90.0080.00515.50
7.0.80.0040.00915.48
7.0.70.0000.01015.30
7.0.60.0070.03017.00
7.0.50.0050.01816.29
7.0.40.0160.01815.73
7.0.30.0100.01915.63
7.0.20.0130.02815.69
7.0.10.0090.03115.86
7.0.00.0050.03315.69
5.6.400.0050.00914.39
5.6.390.0060.00614.49
5.6.380.0070.00614.36
5.6.370.0030.01114.27
5.6.360.0030.01214.55
5.6.350.0060.01314.18
5.6.340.0110.00214.27
5.6.330.0050.00914.49
5.6.320.0090.00614.37
5.6.310.0060.00714.43
5.6.300.0070.00614.44
5.6.290.0060.00814.21
5.6.280.0050.02816.57
5.6.270.0000.01614.53
5.6.260.0050.00814.16
5.6.250.0090.00714.23
5.6.240.0030.01014.38
5.6.230.0050.00814.37
5.6.220.0090.00314.45
5.6.210.0090.02816.40
5.6.200.0090.02815.51
5.6.190.0060.03316.39
5.6.180.1290.01716.48
5.6.170.0150.02216.32
5.6.160.0070.03216.42
5.6.150.0080.03115.52
5.6.140.0060.03115.74
5.6.130.0070.01815.67
5.6.120.0090.02116.66
5.6.110.0050.03616.38
5.6.100.0050.03216.67
5.6.90.0090.02916.58
5.6.80.0080.01616.35
5.6.70.0040.00914.28
5.6.60.0000.01114.24
5.6.50.0060.00614.18
5.6.40.0020.01114.29
5.6.30.0030.00714.43
5.6.20.0040.00614.34
5.6.10.0070.00414.24
5.6.00.0030.01114.15
5.5.380.0050.00814.28
5.5.370.0050.00814.48
5.5.360.0120.00114.25
5.5.350.0160.02816.21
5.5.340.0050.03515.54
5.5.330.0060.01916.14
5.5.320.0120.01816.15
5.5.310.0230.02516.34
5.5.300.0080.01815.40
5.5.290.0030.02115.52
5.5.280.0060.03716.65
5.5.270.0040.02716.45
5.5.260.0060.01916.49
5.5.250.0110.02616.47
5.5.240.0060.03216.26
5.5.230.0060.00614.37
5.5.220.0050.00514.12
5.5.210.0080.00614.25
5.5.200.0020.01014.19
5.5.190.0060.00714.15
5.5.180.0030.00814.30
5.5.170.0080.00714.22
5.5.160.0060.00614.15
5.5.150.0050.00814.13
5.5.140.0020.01314.18
5.5.130.0060.00814.08
5.5.120.0090.00214.24
5.5.110.0030.00914.28
5.5.100.0040.00914.39
5.5.90.0030.00914.22
5.5.80.0100.00314.15
5.5.70.0050.00814.29
5.5.60.0090.00514.15
5.5.50.0020.01113.95
5.5.40.0080.00614.20
5.5.30.0030.00914.24
5.5.20.0030.00914.21
5.5.10.0070.00714.07
5.5.00.0070.00514.16
5.4.450.0090.01913.76
5.4.440.0150.02013.70
5.4.430.0090.02313.90
5.4.420.0130.01513.69
5.4.410.0070.02113.88
5.4.400.0060.01813.80
5.4.390.0100.01913.71
5.4.380.0070.02513.43
5.4.370.0130.02113.46
5.4.360.0140.01613.42
5.4.350.0080.02213.43
5.4.340.0080.03113.53
5.4.330.0000.01010.95
5.4.320.0070.01611.54
5.4.310.0070.02011.49
5.4.300.0050.02111.46
5.4.290.0050.02211.42
5.4.280.0080.01711.56
5.4.270.0050.01911.52
5.4.260.0060.01711.41
5.4.250.0030.01811.53
5.4.240.0050.01811.56
5.4.230.0030.02011.53
5.4.220.0050.01911.54
5.4.210.0050.01811.38
5.4.200.0040.01811.24
5.4.190.0040.02511.46
5.4.180.0060.02111.50
5.4.170.0060.02011.49
5.4.160.0070.01811.35
5.4.150.0060.02111.50
5.4.140.0040.02011.54
5.4.130.0070.02011.32
5.4.120.0060.01511.21
5.4.110.0070.02111.39
5.4.100.0050.02111.40
5.4.90.0030.01711.28
5.4.80.0050.02011.18
5.4.70.0070.01911.32
5.4.60.0080.01611.37
5.4.50.0060.01611.35
5.4.40.0050.02211.28
5.4.30.0030.02011.44
5.4.20.0070.01311.25
5.4.10.0050.01611.42
5.4.00.0040.01711.12
5.3.290.0070.04212.80
5.3.280.0070.04212.71
5.3.270.0120.03412.72
5.3.260.0070.03912.72
5.3.250.0100.03612.72
5.3.240.0050.04012.72
5.3.230.0080.04312.70
5.3.220.0060.03912.68
5.3.210.0070.04012.68
5.3.200.0100.03512.68
5.3.190.0060.04012.68
5.3.180.0050.03912.67
5.3.170.0090.03512.67
5.3.160.0040.04312.68
5.3.150.0060.04012.67
5.3.140.0060.03912.66
5.3.130.0100.03812.66
5.3.120.0070.04512.66
5.3.110.0100.03712.66
5.3.100.0120.03212.13
5.3.90.0160.03012.11
5.3.80.0100.03812.11
5.3.70.0080.05012.11
5.3.60.0130.04512.09
5.3.50.0090.04012.05
5.3.40.0070.03912.04
5.3.30.0120.04712.00
5.3.20.0160.03911.79
5.3.10.0070.04311.74
5.3.00.0080.04011.73
5.2.170.0040.0329.23
5.2.160.0040.0309.23
5.2.150.0050.0319.23
5.2.140.0080.0299.23
5.2.130.0040.0319.20
5.2.120.0070.0279.20
5.2.110.0050.0309.20
5.2.100.0050.0309.20
5.2.90.0070.0299.20
5.2.80.0020.0369.20
5.2.70.0070.0309.20
5.2.60.0050.0369.14
5.2.50.0130.0369.11
5.2.40.0070.0359.09
5.2.30.0040.0309.07
5.2.20.0020.0319.07
5.2.10.0060.0268.97
5.2.00.0030.0308.83
5.1.60.0080.0208.11
5.1.50.0030.0268.11
5.1.40.0050.0238.09
5.1.30.0030.0278.43
5.1.20.0040.0288.46
5.1.10.0070.0248.18
5.1.00.0020.0298.19
5.0.50.0010.0246.67
5.0.40.0030.0226.52
5.0.30.0000.0366.34
5.0.20.0020.0226.30
5.0.10.0040.0206.28
5.0.00.0030.0316.27
4.4.90.0040.0144.78
4.4.80.0020.0174.75
4.4.70.0020.0174.76
4.4.60.0030.0154.76
4.4.50.0040.0144.77
4.4.40.0010.0264.71
4.4.30.0020.0164.76
4.4.20.0050.0154.85
4.4.10.0030.0214.85
4.4.00.0020.0294.76
4.3.110.0050.0194.67
4.3.100.0050.0214.67
4.3.90.0030.0224.64
4.3.80.0020.0334.58
4.3.70.0020.0234.63
4.3.60.0030.0194.63
4.3.50.0060.0204.63
4.3.40.0050.0324.54
4.3.30.0010.0233.30
4.3.20.0010.0233.28
4.3.10.0030.0163.24
4.3.00.0070.01318.16

preferences:
31.39 ms | 400 KiB | 5 Q