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; $charlimong = $mingmong->mate($charles); var_dump($charlimong);

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.0070.01315.03
7.4.00.0040.01515.13
7.3.130.0120.00614.93
7.3.120.0040.01514.47
7.3.110.0030.01314.80
7.3.100.0060.00614.87
7.3.90.0040.01214.96
7.3.80.0070.01014.94
7.3.70.0060.00314.95
7.3.60.0000.01214.67
7.3.50.0040.01514.83
7.3.40.0130.00014.84
7.3.30.0110.00315.00
7.3.20.0040.01116.70
7.3.10.0060.00616.53
7.3.00.0080.00416.41
7.2.260.0100.01014.91
7.2.250.0140.00414.52
7.2.240.0090.00614.54
7.2.230.0100.00714.83
7.2.220.0070.00714.95
7.2.210.0060.00914.89
7.2.200.0130.00314.67
7.2.190.0000.01514.95
7.2.180.0090.00014.68
7.2.170.0060.00614.86
7.2.160.0120.00315.00
7.2.150.0000.01416.88
7.2.140.0070.01016.85
7.2.130.0040.00716.84
7.2.120.0000.01516.92
7.2.110.0120.00416.80
7.2.100.0060.00316.83
7.2.90.0070.01016.96
7.2.80.0040.01116.80
7.2.70.0060.00917.07
7.2.60.0060.00616.89
7.2.50.0030.01216.77
7.2.40.0060.00616.55
7.2.30.0030.01316.73
7.2.20.0090.00616.52
7.2.10.0060.00916.72
7.2.00.0080.00817.98
7.1.330.0070.00715.82
7.1.320.0030.00815.90
7.1.310.0000.01215.77
7.1.300.0070.00715.74
7.1.290.0100.00315.80
7.1.280.0110.00415.70
7.1.270.0070.00715.99
7.1.260.0030.01015.62
7.1.250.0030.00815.94
7.1.240.0060.00815.77
7.1.230.0040.01115.93
7.1.220.0090.00315.58
7.1.210.0000.01815.82
7.1.200.0000.01415.76
7.1.190.0100.00315.58
7.1.180.0070.00415.51
7.1.170.0080.00315.71
7.1.160.0040.01115.65
7.1.150.0030.01015.44
7.1.140.0000.01415.82
7.1.130.0030.01015.97
7.1.120.0060.00615.79
7.1.110.0090.00315.91
7.1.100.0030.00615.96
7.1.90.0090.00315.94
7.1.80.0120.00315.89
7.1.70.0030.00716.51
7.1.60.0060.01417.72
7.1.50.0110.01016.33
7.1.40.0000.01015.96
7.1.30.0040.01115.71
7.1.20.0040.01115.64
7.1.10.0080.00315.79
7.1.00.0030.05019.03
7.0.330.0070.00315.06
7.0.320.0070.00315.13
7.0.310.0100.00615.41
7.0.300.0040.00715.35
7.0.290.0040.00715.19
7.0.280.0090.00015.43
7.0.270.0060.00615.11
7.0.260.0060.00615.43
7.0.250.0030.01015.37
7.0.240.0070.00715.46
7.0.230.0030.01315.47
7.0.220.0030.00615.42
7.0.210.0060.00615.16
7.0.200.0050.00315.88
7.0.190.0080.00715.21
7.0.180.0040.00715.55
7.0.170.0070.00715.44
7.0.160.0040.00815.13
7.0.150.0040.00815.31
7.0.140.0050.03818.76
7.0.130.0110.00415.36
7.0.120.0060.00615.43
7.0.110.0030.00715.55
7.0.100.0070.00715.36
7.0.90.0070.00715.42
7.0.80.0100.00715.58
7.0.70.0030.01415.55
7.0.60.0070.03517.66
7.0.50.0030.04716.71
7.0.40.0080.03817.00
7.0.30.0180.02516.89
7.0.20.0150.02816.84
7.0.10.0040.04216.80
7.0.00.0050.02416.88
5.6.400.0030.01414.48
5.6.390.0030.00914.35
5.6.380.0100.00714.11
5.6.370.0070.00714.27
5.6.360.0070.00314.54
5.6.350.0030.01014.66
5.6.340.0070.00714.59
5.6.330.0000.00914.44
5.6.320.0000.01414.52
5.6.310.0060.00614.34
5.6.300.0060.00613.97
5.6.290.0040.00714.29
5.6.280.0030.04017.69
5.6.270.0110.00314.20
5.6.260.0030.01014.35
5.6.250.0030.01014.13
5.6.240.0000.01214.65
5.6.230.0110.00714.42
5.6.220.0070.01014.26
5.6.210.0050.04517.46
5.6.200.0050.04516.32
5.6.190.0030.02817.33
5.6.180.0230.04217.40
5.6.170.0070.03017.35
5.6.160.0050.02817.32
5.6.150.0070.02916.17
5.6.140.0000.03316.29
5.6.130.0130.03816.11
5.6.120.0050.03717.80
5.6.110.0120.04317.78
5.6.100.0030.04017.55
5.6.90.0000.03517.67
5.6.80.0090.04217.37
5.6.70.0040.00814.28
5.6.60.0070.00414.02
5.6.50.0060.00914.32
5.6.40.0030.00614.03
5.6.30.0100.00314.12
5.6.20.0000.00914.22
5.6.10.0030.01014.17
5.6.00.0070.00714.02
5.5.380.0000.01414.07
5.5.370.0030.01314.13
5.5.360.0060.01114.50
5.5.350.0080.04317.26
5.5.340.0070.04416.20
5.5.330.0070.02317.20
5.5.320.0250.03717.38
5.5.310.0100.02217.22
5.5.300.0050.02716.28
5.5.290.0060.02416.12
5.5.280.0110.03517.51
5.5.270.0030.02617.48
5.5.260.0080.03817.69
5.5.250.0050.04217.40
5.5.240.0080.02017.35
5.5.230.0040.01114.09
5.5.220.0110.00014.32
5.5.210.0030.00714.28
5.5.200.0050.00514.44
5.5.190.0090.00314.37
5.5.180.0000.00814.35
5.5.170.0000.00814.13
5.5.160.0030.00914.33
5.5.150.0070.00713.92
5.5.140.0070.01014.10
5.5.130.0030.01014.15
5.5.120.0040.01114.35
5.5.110.0110.00014.47
5.5.100.0000.01314.22
5.5.90.0060.00614.40
5.5.80.0100.00314.41
5.5.70.0050.00314.04
5.5.60.0070.00714.10
5.5.50.0060.00914.05
5.5.40.0040.00814.28
5.5.30.0060.01014.38
5.5.20.0100.00314.13
5.5.10.0090.00614.27
5.5.00.0100.00614.42
5.4.450.0180.02616.40
5.4.440.0270.02016.31
5.4.430.0080.02516.49
5.4.420.0200.02016.45
5.4.410.0170.03716.35
5.4.400.0150.02416.33
5.4.390.0150.03016.22
5.4.380.0150.03215.93
5.4.370.0140.03116.03
5.4.360.0220.02615.99
5.4.350.0170.04015.96
5.4.340.0220.04316.04
5.4.330.0000.01113.35
5.4.320.0080.01912.93
5.4.310.0060.02212.93
5.4.300.0020.02712.93
5.4.290.0070.02212.93
5.4.280.0020.02512.88
5.4.270.0090.01812.88
5.4.260.0060.02112.88
5.4.250.0060.02112.88
5.4.240.0040.02312.88
5.4.230.0060.02212.87
5.4.220.0040.02312.87
5.4.210.0040.02312.87
5.4.200.0090.02012.87
5.4.190.0080.02212.87
5.4.180.0070.01912.87
5.4.170.0050.02312.88
5.4.160.0060.02312.88
5.4.150.0050.02312.87
5.4.140.0060.03012.71
5.4.130.0080.02512.71
5.4.120.0110.04812.68
5.4.110.0060.03412.68
5.4.100.0080.02912.68
5.4.90.0070.02312.69
5.4.80.0030.02612.68
5.4.70.0040.02812.69
5.4.60.0050.02812.69
5.4.50.0040.02812.68
5.4.40.0060.02812.68
5.4.30.0020.02212.68
5.4.20.0050.02112.68
5.4.10.0040.02112.68
5.4.00.0040.02312.42
5.3.290.0070.03912.80
5.3.280.0090.04912.71
5.3.270.0090.05112.73
5.3.260.0080.03912.72
5.3.250.0100.03712.72
5.3.240.0110.05012.71
5.3.230.0050.04312.71
5.3.220.0080.03712.68
5.3.210.0050.04112.68
5.3.200.0090.03612.68
5.3.190.0060.04012.68
5.3.180.0120.04712.67
5.3.170.0060.04712.67
5.3.160.0080.04312.68
5.3.150.0070.05212.67
5.3.140.0070.03612.66
5.3.130.0050.04512.66
5.3.120.0080.03712.66
5.3.110.0100.03612.66
5.3.100.0130.04612.13
5.3.90.0150.03412.11
5.3.80.0070.03812.11
5.3.70.0050.03812.10
5.3.60.0060.03712.09
5.3.50.0110.03712.04
5.3.40.0080.03812.04
5.3.30.0070.03611.99
5.3.20.0030.03911.78
5.3.10.0060.03611.74
5.3.00.0100.03311.73
5.2.170.0060.0319.23
5.2.160.0090.0299.23
5.2.150.0090.0459.23
5.2.140.0080.0419.23
5.2.130.0090.0299.19
5.2.120.0040.0299.19
5.2.110.0030.0319.20
5.2.100.0070.0319.20
5.2.90.0050.0299.19
5.2.80.0100.0289.19
5.2.70.0150.0349.19
5.2.60.0040.0369.14
5.2.50.0080.0329.11
5.2.40.0060.0319.09
5.2.30.0040.0329.06
5.2.20.0050.0339.05
5.2.10.0070.0328.96
5.2.00.0060.0318.82
5.1.60.0100.0258.10
5.1.50.0070.0328.10
5.1.40.0030.0268.08
5.1.30.0050.0278.43
5.1.20.0060.0288.45
5.1.10.0030.0288.17
5.1.00.0060.0258.17
5.0.50.0040.0216.66
5.0.40.0060.0226.52
5.0.30.0080.0366.33
5.0.20.0080.0236.30
5.0.10.0040.0256.27
5.0.00.0030.0336.27
4.4.90.0050.0184.78
4.4.80.0040.0194.75
4.4.70.0050.0144.76
4.4.60.0030.0164.76
4.4.50.0040.0164.77
4.4.40.0040.0264.70
4.4.30.0050.0144.76
4.4.20.0060.0134.84
4.4.10.0010.0184.85
4.4.00.0040.0234.76
4.3.110.0040.0144.67
4.3.100.0010.0174.66
4.3.90.0020.0154.63
4.3.80.0050.0224.59
4.3.70.0040.0134.63
4.3.60.0030.0144.63
4.3.50.0030.0164.63
4.3.40.0040.0244.54
4.3.30.0000.0183.30
4.3.20.0030.0183.28
4.3.10.0020.0193.24
4.3.00.0000.02018.16

preferences:
40.09 ms | 401 KiB | 5 Q