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; $squidgy = 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.2.00.0070.01019.47
7.1.70.0000.00817.29
7.1.60.0140.01019.61
7.1.50.0080.01116.90
7.1.00.0000.08022.40
7.0.200.0080.00016.73
7.0.140.0030.07322.09
7.0.60.0070.04019.94
7.0.50.0100.08017.88
7.0.40.0100.07019.96
7.0.30.0270.07320.02
7.0.20.0300.06320.08
7.0.10.0130.05320.20
7.0.00.0070.05320.16
5.6.280.0000.07721.09
5.6.210.0270.06720.68
5.6.200.0030.04018.19
5.6.190.0100.03720.39
5.6.180.0430.04320.61
5.6.170.0130.06020.76
5.6.160.0100.08020.52
5.6.150.0030.06318.18
5.6.140.0070.03718.12
5.6.130.0430.06718.23
5.6.120.0030.04721.11
5.6.110.0000.04721.02
5.6.100.0100.05720.99
5.6.90.0070.07320.96
5.6.80.0070.06020.53
5.5.350.0130.07020.45
5.5.340.0000.04318.09
5.5.330.0070.04020.37
5.5.320.0430.04320.27
5.5.310.0300.07020.34
5.5.300.0100.07717.94
5.5.290.0100.04317.96
5.5.280.0100.08020.90
5.5.270.0000.04720.67
5.5.260.0000.07320.62
5.5.250.0030.04720.67
5.5.240.0370.06020.17
5.4.450.0300.03719.57
5.4.440.0200.04719.39
5.4.430.0230.05019.55
5.4.420.0170.04719.53
5.4.410.0600.03719.36
5.4.400.0270.04019.24
5.4.390.0200.05019.31
5.4.380.0230.06318.78
5.4.370.0170.06018.73
5.4.360.0270.05018.73
5.4.350.0200.05718.80
5.4.340.0270.06018.73
5.4.320.0060.03912.52
5.4.310.0060.03912.52
5.4.300.0060.03612.52
5.4.290.0090.03612.52
5.4.280.0050.03812.41
5.4.270.0130.03112.41
5.4.260.0060.04012.41
5.4.250.0040.04112.41
5.4.240.0050.03912.41
5.4.230.0050.04012.41
5.4.220.0060.03612.41
5.4.210.0080.03412.41
5.4.200.0080.03512.40
5.4.190.0060.03612.40
5.4.180.0100.03712.40
5.4.170.0070.03512.41
5.4.160.0050.03712.40
5.4.150.0070.03512.40
5.4.140.0100.04012.08
5.4.130.0030.04012.07
5.4.120.0030.03812.04
5.4.110.0040.03812.03
5.4.100.0100.03212.03
5.4.90.0090.03412.03
5.4.80.0070.03612.03
5.4.70.0070.03412.03
5.4.60.0060.03512.02
5.4.50.0070.04012.02
5.4.40.0040.03912.01
5.4.30.0080.03512.01
5.4.20.0060.03612.01
5.4.10.0100.03212.01
5.4.00.0100.03711.49
5.3.290.0110.05212.80
5.3.280.0060.04512.71
5.3.270.0090.04412.72
5.3.260.0070.04312.72
5.3.250.0100.03512.71
5.3.240.0090.04612.72
5.3.230.0120.04712.71
5.3.220.0090.04712.68
5.3.210.0090.04812.68
5.3.200.0060.03612.68
5.3.190.0070.03612.68
5.3.180.0050.03712.67
5.3.170.0060.03712.67
5.3.160.0070.03512.68
5.3.150.0070.03912.67
5.3.140.0070.03612.66
5.3.130.0010.04412.65
5.3.120.0080.03712.66
5.3.110.0070.03912.66
5.3.100.0040.03912.14
5.3.90.0090.03412.13
5.3.80.0050.03812.11
5.3.70.0060.04012.11
5.3.60.0090.04112.09
5.3.50.0070.03812.05
5.3.40.0080.03612.05
5.3.30.0120.03012.01
5.3.20.0090.03611.79
5.3.10.0070.03311.75
5.3.00.0050.03811.73
5.2.170.0080.0289.24
5.2.160.0050.0329.23
5.2.150.0060.0309.24
5.2.140.0050.0309.23
5.2.130.0080.0259.20
5.2.120.0070.0279.20
5.2.110.0040.0309.21
5.2.100.0020.0319.20
5.2.90.0070.0279.20
5.2.80.0040.0309.20
5.2.70.0060.0299.20
5.2.60.0040.0359.14
5.2.50.0070.0279.12
5.2.40.0040.0299.09
5.2.30.0060.0369.07
5.2.20.0040.0299.06
5.2.10.0070.0318.97
5.2.00.0080.0278.83
5.1.60.0040.0258.10
5.1.50.0050.0278.10
5.1.40.0020.0268.08
5.1.30.0020.0288.43
5.1.20.0040.0278.46
5.1.10.0050.0318.18
5.1.00.0070.0218.18
5.0.50.0050.0186.67
5.0.40.0020.0206.52
5.0.30.0020.0336.34
5.0.20.0040.0246.30
5.0.10.0030.0216.28
5.0.00.0040.0306.27
4.4.90.0030.0154.78
4.4.80.0040.0144.76
4.4.70.0040.0144.75
4.4.60.0030.0154.76
4.4.50.0030.0144.77
4.4.40.0030.0244.71
4.4.30.0070.0174.76
4.4.20.0050.0194.84
4.4.10.0060.0184.85
4.4.00.0060.0254.76
4.3.110.0020.0164.67
4.3.100.0030.0154.66
4.3.90.0050.0124.64
4.3.80.0060.0264.58
4.3.70.0010.0164.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0030.0234.54
4.3.30.0010.0173.30
4.3.20.0030.0153.28
4.3.10.0030.0183.24
4.3.00.0100.01718.16

preferences:
38.12 ms | 400 KiB | 5 Q