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 Kangeroo; $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.0100.00614.80
7.4.00.0090.00914.86
7.3.130.0060.01214.98
7.3.120.0110.00714.43
7.3.110.0130.00614.59
7.3.100.0060.00614.63
7.3.90.0070.00714.93
7.3.80.0060.00614.71
7.3.70.0090.00614.86
7.3.60.0020.01214.66
7.3.50.0040.01414.68
7.3.40.0000.01014.66
7.3.30.0100.00614.57
7.3.20.0100.00316.55
7.3.10.0080.00416.67
7.3.00.0080.00616.48
7.2.260.0070.01014.87
7.2.250.0040.01415.10
7.2.240.0080.00814.91
7.2.230.0070.01015.20
7.2.220.0130.00314.60
7.2.210.0060.00914.62
7.2.200.0070.00714.94
7.2.190.0080.00314.80
7.2.180.0070.01115.04
7.2.170.0050.01014.97
7.2.160.0130.00314.76
7.2.150.0030.00716.75
7.2.140.0000.01416.87
7.2.130.0100.00716.89
7.2.120.0030.01016.63
7.2.110.0040.01116.93
7.2.100.0090.00316.75
7.2.90.0130.00316.86
7.2.80.0030.01216.74
7.2.70.0080.00316.72
7.2.60.0100.00316.90
7.2.50.0030.01316.83
7.2.40.0080.00616.74
7.2.30.0040.01116.86
7.2.20.0000.01616.77
7.2.10.0080.00416.69
7.2.00.0030.01118.17
7.1.330.0030.01015.60
7.1.320.0040.00815.86
7.1.310.0000.00915.81
7.1.300.0030.01215.75
7.1.290.0070.00715.63
7.1.280.0000.01115.67
7.1.270.0040.00415.42
7.1.260.0070.00315.57
7.1.250.0100.00615.68
7.1.240.0040.00815.68
7.1.230.0000.01015.76
7.1.220.0030.01015.48
7.1.210.0060.00915.36
7.1.200.0060.00315.48
7.1.190.0030.00815.37
7.1.180.0030.01015.36
7.1.170.0100.00315.71
7.1.160.0070.00315.47
7.1.150.0060.01015.28
7.1.140.0000.01015.60
7.1.130.0030.01015.35
7.1.120.0030.00915.51
7.1.110.0120.00015.47
7.1.100.0030.00615.71
7.1.90.0040.00815.56
7.1.80.0070.00715.49
7.1.70.0020.00816.28
7.1.60.0050.01317.62
7.1.50.0090.01116.15
7.1.40.0040.01115.64
7.1.30.0090.00315.44
7.1.20.0000.00815.64
7.1.10.0110.00415.62
7.1.00.0060.03519.04
7.0.330.0070.01015.29
7.0.320.0070.01015.18
7.0.310.0060.00615.32
7.0.300.0070.00315.03
7.0.290.0040.00414.96
7.0.280.0030.01215.37
7.0.270.0000.01415.37
7.0.260.0070.00715.41
7.0.250.0070.01015.38
7.0.240.0040.00415.32
7.0.230.0060.00615.14
7.0.220.0160.00015.21
7.0.210.0030.00915.16
7.0.200.0040.00515.95
7.0.190.0040.01115.38
7.0.180.0070.00315.23
7.0.170.0000.01215.31
7.0.160.0120.00015.28
7.0.150.0070.00715.14
7.0.140.0050.04118.69
7.0.130.0100.00315.38
7.0.120.0040.01115.27
7.0.110.0070.00615.29
7.0.100.0040.00815.30
7.0.90.0100.00315.41
7.0.80.0040.01115.30
7.0.70.0030.00715.05
7.0.60.0090.03017.64
7.0.50.0040.02316.75
7.0.40.0030.04516.74
7.0.30.0290.03016.71
7.0.20.0140.02716.91
7.0.10.0260.02316.80
7.0.00.0170.03516.68
5.6.400.0060.00914.63
5.6.390.0040.01414.33
5.6.380.0030.01014.47
5.6.370.0000.01114.21
5.6.360.0000.00814.59
5.6.350.0060.00613.99
5.6.340.0120.00314.14
5.6.330.0000.01214.34
5.6.320.0120.00614.52
5.6.310.0000.01614.35
5.6.300.0080.00014.35
5.6.290.0090.00014.43
5.6.280.0080.03717.45
5.6.270.0000.01414.31
5.6.260.0000.01314.07
5.6.250.0080.00414.22
5.6.240.0040.00814.58
5.6.230.0060.00914.59
5.6.220.0070.00314.10
5.6.210.0110.04317.44
5.6.200.0070.03816.19
5.6.190.0030.03017.42
5.6.180.0110.04517.31
5.6.170.0200.04117.43
5.6.160.0050.02517.26
5.6.150.0120.04016.26
5.6.140.0000.02916.21
5.6.130.0120.03816.11
5.6.120.0030.04617.77
5.6.110.0050.02317.62
5.6.100.0030.02617.72
5.6.90.0050.03517.59
5.6.80.0050.03917.23
5.6.70.0070.00713.96
5.6.60.0030.00914.28
5.6.50.0000.01414.25
5.6.40.0100.00314.08
5.6.30.0070.00714.05
5.6.20.0090.00614.31
5.6.10.0000.01214.47
5.6.00.0030.00614.29
5.5.380.0000.01314.05
5.5.370.0030.00913.93
5.5.360.0090.00614.27
5.5.350.0070.02617.26
5.5.340.0080.04016.11
5.5.330.0080.04217.33
5.5.320.0120.02517.36
5.5.310.0170.04317.27
5.5.300.0020.02816.00
5.5.290.0030.03716.27
5.5.280.0050.04917.45
5.5.270.0050.04017.54
5.5.260.0070.04717.56
5.5.250.0100.03517.43
5.5.240.2070.02317.07
5.5.230.0040.00814.06
5.5.220.0060.00914.27
5.5.210.0030.00913.90
5.5.200.0060.00914.11
5.5.190.0030.01414.20
5.5.180.0030.00913.86
5.5.170.0000.01213.70
5.5.160.0030.00614.35
5.5.150.0060.00614.14
5.5.140.0030.01014.23
5.5.130.0040.01114.21
5.5.120.0110.00414.20
5.5.110.0070.00714.16
5.5.100.0120.00014.39
5.5.90.0000.01013.86
5.5.80.0030.01014.38
5.5.70.0000.01413.91
5.5.60.0060.00714.16
5.5.50.0030.01313.88
5.5.40.0070.00414.14
5.5.30.0030.01214.28
5.5.20.0060.00314.13
5.5.10.0000.01013.95
5.5.00.0090.00614.32
5.4.450.0330.02515.12
5.4.440.0150.02215.27
5.4.430.0200.02515.06
5.4.420.0170.02815.36
5.4.410.0150.02715.18
5.4.400.0160.02115.11
5.4.390.0080.02914.81
5.4.380.0130.03214.79
5.4.370.0190.02214.80
5.4.360.0160.03114.76
5.4.350.0080.03214.82
5.4.340.0130.02514.65
5.4.330.0030.01010.77
5.4.320.0060.02411.77
5.4.310.0050.02511.70
5.4.300.0040.03011.71
5.4.290.0090.02911.69
5.4.280.0050.02211.50
5.4.270.0040.02511.59
5.4.260.0080.02411.65
5.4.250.0090.01811.50
5.4.240.0040.02411.66
5.4.230.0090.02511.54
5.4.220.0080.02511.67
5.4.210.0100.01911.51
5.4.200.0030.02311.60
5.4.190.0050.02211.69
5.4.180.0050.02411.54
5.4.170.0050.02211.70
5.4.160.0080.01911.60
5.4.150.0060.02511.42
5.4.140.0080.02411.47
5.4.130.0080.02111.36
5.4.120.0080.02611.48
5.4.110.0070.02411.39
5.4.100.0080.02411.53
5.4.90.0040.03011.31
5.4.80.0040.03011.39
5.4.70.0040.02811.49
5.4.60.0070.02611.28
5.4.50.0070.02511.47
5.4.40.0100.02511.44
5.4.30.0050.02611.52
5.4.20.0060.02411.35
5.4.10.0050.03011.31
5.4.00.0070.02511.11
5.3.290.0050.05012.80
5.3.280.0100.04112.71
5.3.270.0080.05012.72
5.3.260.0110.04112.72
5.3.250.0090.04012.71
5.3.240.0040.04112.72
5.3.230.0070.03712.70
5.3.220.0080.03512.68
5.3.210.0060.03912.68
5.3.200.0050.03812.68
5.3.190.0080.03812.68
5.3.180.0080.04312.67
5.3.170.0080.04212.67
5.3.160.0080.04412.68
5.3.150.0130.03812.68
5.3.140.0080.03712.66
5.3.130.0090.03812.65
5.3.120.0060.04012.66
5.3.110.0090.03812.66
5.3.100.0060.04012.13
5.3.90.0100.03512.11
5.3.80.0100.03712.11
5.3.70.0070.03912.10
5.3.60.0070.03812.08
5.3.50.0060.04012.04
5.3.40.0070.03712.04
5.3.30.0080.03411.99
5.3.20.0040.03811.78
5.3.10.0110.03211.73
5.3.00.0030.03911.73
5.2.170.0050.0339.23
5.2.160.0020.0329.23
5.2.150.0030.0329.23
5.2.140.0050.0309.23
5.2.130.0070.0269.18
5.2.120.0020.0309.18
5.2.110.0030.0309.19
5.2.100.0030.0309.19
5.2.90.0050.0309.18
5.2.80.0030.0319.18
5.2.70.0030.0319.18
5.2.60.0040.0319.14
5.2.50.0030.0379.11
5.2.40.0060.0319.08
5.2.30.0050.0299.05
5.2.20.0030.0389.05
5.2.10.0040.0288.95
5.2.00.0060.0278.82
5.1.60.0070.0228.10
5.1.50.0060.0318.09
5.1.40.0060.0238.07
5.1.30.0030.0288.43
5.1.20.0040.0278.45
5.1.10.0080.0258.18
5.1.00.0080.0248.17
5.0.50.0020.0226.65
5.0.40.0030.0206.52
5.0.30.0020.0346.32
5.0.20.0030.0196.29
5.0.10.0050.0186.27
5.0.00.0030.0316.26
4.4.90.0030.0154.78
4.4.80.0040.0144.75
4.4.70.0040.0144.75
4.4.60.0020.0164.76
4.4.50.0040.0174.77
4.4.40.0020.0264.71
4.4.30.0020.0164.76
4.4.20.0020.0164.85
4.4.10.0020.0184.85
4.4.00.0030.0244.76
4.3.110.0030.0164.67
4.3.100.0060.0124.67
4.3.90.0040.0134.63
4.3.80.0040.0304.58
4.3.70.0040.0204.63
4.3.60.0030.0214.63
4.3.50.0050.0214.63
4.3.40.0030.0244.54
4.3.30.0040.0153.30
4.3.20.0040.0163.28
4.3.10.0040.0183.24
4.3.00.0070.01018.16

preferences:
32.9 ms | 401 KiB | 5 Q