3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Response { const POSITIVE = "Да \n"; const NEGATIVE = "Нет \n"; } interface Girl {} interface Boy {} abstract class Bride implements Girl { public function bePretty() { echo "I`m pretty \n"; } } abstract class Groom implements Boy { public function alwaysAgree() { if (static::class === Bride::class) { echo Response::POSITIVE; } } } class Nastia extends Bride { public function responseToPriest(){ if (static::class === Fender::class) { echo Response::POSITIVE; } echo Response::NEGATIVE; } } class Fender extends Groom { public function responseToPriest(){ if (static::class === Nastia::class) { echo Response::POSITIVE; } echo Response::NEGATIVE; } } class Priest { public function askIfAgree($human) { if ($human instanceof Bride) { echo "Do you take this man husband? \n"; } if ($human instanceof Groom) { echo "Do you take this woman to be your wife? \n"; } $human->responseToPriest(); } } class Wedding { public static function begin($bride, $groom) { $priest = new Priest(); $responseBride = $priest->askIfAgree($bride); $responseGroom = $priest->askIfAgree($groom); if ($responseBride === true && $responseGroom === true) { return new JustMarried; } return false; } } class JustMarried { public function liveHappyEverAfter() { echo 'And they lived happily ever after'; } } $nastia = new Nastia(); $fender = new Fender(); $nastia->bePretty(); $fender->alwaysAgree(); $NastiaAndFenderWeddingJustMarried = Wedding::begin($nastia, $fender); $NastiaAndFenderWeddingJustMarried->liveHappyEverAfter();

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)
8.3.60.0030.01218.43
8.3.50.0080.00816.37
8.3.40.0090.00918.58
8.3.30.0040.01118.70
8.3.20.0040.00420.34
8.3.10.0050.00321.77
8.3.00.0050.00320.95
8.2.180.0100.01018.42
8.2.170.0120.00322.96
8.2.160.0070.00722.12
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00420.22
8.2.120.0030.00526.35
8.2.110.0060.00320.38
8.2.100.0110.00017.78
8.2.90.0040.00419.21
8.2.80.0040.00418.05
8.2.70.0040.00417.63
8.2.60.0000.00817.93
8.2.50.0060.00318.10
8.2.40.0040.00422.15
8.2.30.0040.00420.99
8.2.20.0040.00417.95
8.2.10.0000.00818.13
8.2.00.0030.00618.15
8.1.280.0100.01025.92
8.1.270.0050.00322.11
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00620.84
8.1.230.0070.00419.05
8.1.220.0040.00417.74
8.1.210.0090.00018.77
8.1.200.0030.00617.36
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0060.00318.39
8.1.160.0040.00418.98
8.1.150.0080.00018.84
8.1.140.0090.00019.51
8.1.130.0000.00718.90
8.1.120.0050.00317.39
8.1.110.0020.00517.42
8.1.100.0070.00017.45
8.1.90.0000.00817.53
8.1.80.0040.00417.36
8.1.70.0000.00817.36
8.1.60.0030.00617.62
8.1.50.0040.00417.42
8.1.40.0000.00817.53
8.1.30.0080.00017.65
8.1.20.0000.00917.54
8.1.10.0050.00317.49
8.1.00.0040.00417.54
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0030.00318.39
8.0.270.0070.00017.18
8.0.260.0000.00817.00
8.0.250.0000.00716.98
8.0.240.0000.00816.99
8.0.230.0040.00416.92
8.0.220.0000.00617.03
8.0.210.0030.00316.86
8.0.200.0050.00216.99
8.0.190.0040.00417.05
8.0.180.0040.00416.98
8.0.170.0000.00717.01
8.0.160.0000.00716.93
8.0.150.0040.00416.90
8.0.140.0040.00416.93
8.0.130.0040.00413.43
8.0.120.0000.00716.84
8.0.110.0000.00716.95
8.0.100.0040.00416.76
8.0.90.0000.00817.03
8.0.80.0150.00916.90
8.0.70.0050.00316.97
8.0.60.0040.00416.84
8.0.50.0040.00417.00
8.0.30.0160.00517.01
8.0.20.0160.00317.40
8.0.10.0000.00717.09
8.0.00.0090.01216.80
7.4.330.0020.00215.55
7.4.320.0000.00716.53
7.4.300.0060.00016.52
7.4.290.0080.00016.37
7.4.280.0000.00816.44
7.4.270.0000.00716.53
7.4.260.0030.00313.35
7.4.250.0030.00616.34
7.4.240.0040.00416.55
7.4.230.0070.00016.71
7.4.220.0090.00616.57
7.4.210.0040.01116.51
7.4.200.0040.00416.66
7.4.160.0090.00616.54
7.4.150.0150.00617.40
7.4.140.0130.00917.86
7.4.130.0130.01016.46
7.4.120.0100.01016.63
7.4.110.0100.00716.65
7.4.100.0130.01016.61
7.4.90.0110.00716.49
7.4.80.0100.01419.39
7.4.70.0100.00716.66
7.4.60.0090.01516.53
7.4.50.0030.01016.23
7.4.40.0070.01016.50
7.4.30.0030.01516.51
7.4.00.0100.00614.88
7.3.330.0020.00213.29
7.3.320.0030.00313.53
7.3.310.0030.00316.45
7.3.300.0060.00016.46
7.3.290.0080.00016.48
7.3.280.0080.00916.45
7.3.270.0070.01017.40
7.3.260.0060.01116.52
7.3.250.0090.01016.40
7.3.240.0140.00416.52
7.3.230.0110.01016.44
7.3.210.0060.01116.48
7.3.200.0090.01216.55
7.3.190.0140.00716.37
7.3.180.0090.01316.45
7.3.170.0110.00716.52
7.3.160.0130.00316.60
7.3.120.0080.01214.92
7.3.110.0030.00915.00
7.3.100.0000.01414.69
7.3.90.0060.00614.69
7.3.80.0060.01015.00
7.3.70.0060.00914.98
7.3.60.0040.01114.87
7.3.50.0000.01414.86
7.3.40.0040.01214.86
7.3.30.0030.01014.52
7.3.20.0090.00416.80
7.3.10.0030.00916.72
7.3.00.0100.00316.52
7.2.330.0110.00816.55
7.2.320.0070.01016.83
7.2.310.0070.01016.76
7.2.300.0110.00716.46
7.2.290.0100.00616.52
7.2.250.0030.00915.34
7.2.240.0090.00914.90
7.2.230.0070.00715.13
7.2.220.0060.00615.12
7.2.210.0070.01015.20
7.2.200.0040.00715.07
7.2.190.0030.01414.95
7.2.180.0110.00414.98
7.2.170.0030.01015.05
7.2.60.0070.00716.73
7.2.00.0130.00619.27
7.1.330.0070.00715.53
7.1.320.0060.00915.73
7.1.310.0060.00315.91
7.1.300.0040.00815.95
7.1.290.0070.00715.76
7.1.280.0060.00615.76
7.1.270.0040.01115.88
7.1.260.0060.00615.68
7.1.200.0080.00415.64
7.1.100.0050.00518.08
7.1.70.0080.01017.03
7.1.60.0130.01035.24
7.1.50.0100.01334.97
7.1.40.0170.00734.48
7.1.30.1370.01332.66
7.1.20.0200.00734.50
7.1.10.0100.00716.61
7.1.00.1230.00014.84
7.0.200.0030.00716.65
7.0.190.1170.00314.85
7.0.180.0000.01016.17
7.0.170.1000.00316.26
7.0.160.1000.00714.64
7.0.150.0070.00716.31
7.0.140.0000.01316.43
7.0.130.1200.01014.78
7.0.120.1070.01316.57
7.0.110.0870.00714.67
7.0.100.0770.00714.76
7.0.90.0770.00316.55
7.0.80.0770.01014.69
7.0.70.0730.01014.50
7.0.60.0930.01714.48
7.0.50.0770.01314.64
7.0.40.0970.01316.39
7.0.30.1000.01014.80
7.0.20.0700.01014.91
7.0.10.0030.01016.51
7.0.00.0070.00716.31

preferences:
45.18 ms | 400 KiB | 5 Q