3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('WARRIOR_OFFSET', 16); define('MAGE_OFFSET', 17); define('CLASS_MASK', ( 1 << WARRIOR_OFFSET ) | ( 1 << MAGE_OFFSET )); define('CF_GOD', 1 << 2); // may issue #god commands define('CF_PLAYER', 1 << 3); // is a player define('CF_STAFF', 1 << 4); // member of the staff define('CF_INVISIBLE', 1 << 5); // character is completely invisible define('CF_GENDER', 1 << 14 | 1 << 15); // Determine Gender define('CF_ARCH', 1 << 18); // is arch-XXX define('CF_LQMASTER', 1 << 52); // may host LQs define('CF_NOWHO', 1 << 56); // invisible to /who define('CF_WON', 1 << 57); // character won the game (ie killed islena $bitmask = 8470543; $classMap = array( 0b00 => 'error', 0b01 => 'warrior', 0b10 => 'mage', 0b11 => 'seyan', ); $class = $bitmask & CLASS_MASK; $class = $class >> WARRIOR_OFFSET; $class_name = $classMap[$class]; $is_god = $bitmask & CF_GOD; $is_arch = $bitmask & CF_ARCH; if ($is_god) { print "Godly "; } if ($is_arch) { print "Arch "; } print "$class_name\n";

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.0120.00316.38
8.3.50.0100.00721.93
8.3.40.0120.00318.69
8.3.30.0030.01119.13
8.3.20.0080.00020.16
8.3.10.0030.00623.53
8.3.00.0080.00019.38
8.2.180.0110.00716.32
8.2.170.0040.01122.96
8.2.160.0070.00720.44
8.2.150.0030.00524.18
8.2.140.0100.00724.66
8.2.130.0000.01426.16
8.2.120.0040.00421.96
8.2.110.0070.00322.23
8.2.100.0090.00317.61
8.2.90.0000.00819.40
8.2.80.0050.00317.97
8.2.70.0070.00317.50
8.2.60.0030.00518.05
8.2.50.0030.00618.07
8.2.40.0060.00319.89
8.2.30.0090.00318.02
8.2.20.0030.00517.68
8.2.10.0000.00718.02
8.2.00.0030.00617.64
8.1.280.0070.00725.92
8.1.270.0040.00423.97
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00823.90
8.1.230.0070.00319.10
8.1.220.0040.00417.75
8.1.210.0050.00318.77
8.1.200.0100.00017.22
8.1.190.0050.00317.23
8.1.180.0030.00618.88
8.1.170.0040.00418.55
8.1.160.0030.00622.09
8.1.150.0070.00018.66
8.1.140.0000.00717.39
8.1.130.0030.00317.85
8.1.120.0050.00317.38
8.1.110.0080.00017.46
8.1.100.0040.00417.47
8.1.90.0000.00717.44
8.1.80.0070.00217.36
8.1.70.0030.00317.46
8.1.60.0050.00317.54
8.1.50.0030.00517.52
8.1.40.0000.00817.53
8.1.30.0000.00817.66
8.1.20.0000.00817.63
8.1.10.0040.00417.58
8.1.00.0000.00817.57
8.0.300.0040.00420.73
8.0.290.0040.00417.16
8.0.280.0030.00318.46
8.0.270.0000.00717.18
8.0.260.0030.00317.19
8.0.250.0070.00016.95
8.0.240.0040.00416.96
8.0.230.0040.00417.03
8.0.220.0070.00016.79
8.0.210.0000.00716.79
8.0.200.0000.00916.89
8.0.190.0000.00816.84
8.0.180.0070.00016.95
8.0.170.0060.00316.91
8.0.160.0040.00416.86
8.0.150.0050.00316.85
8.0.140.0030.00416.79
8.0.130.0030.00613.30
8.0.120.0040.00416.92
8.0.110.0030.00516.83
8.0.100.0030.00516.74
8.0.90.0030.00316.79
8.0.80.0120.00616.96
8.0.70.0000.00816.91
8.0.60.0000.00716.88
8.0.50.0000.00716.84
8.0.30.0070.01817.13
8.0.20.0120.00817.40
8.0.10.0030.00617.07
8.0.00.0070.01316.71
7.4.330.0050.00015.20
7.4.320.0030.00316.51
7.4.300.0000.00616.41
7.4.290.0000.00716.52
7.4.280.0070.00016.51
7.4.270.0000.00716.61
7.4.260.0000.00816.63
7.4.250.0000.00816.39
7.4.240.0050.00216.44
7.4.230.0070.00016.70
7.4.220.0130.01316.71
7.4.210.0070.00816.55
7.4.200.0040.00416.32
7.4.190.0000.00716.67
7.4.160.0000.01716.35
7.4.150.0070.01117.40
7.4.140.0070.01017.86
7.4.130.0090.01516.49
7.4.120.0060.01216.55
7.4.110.0040.01416.43
7.4.100.0150.00316.57
7.4.90.0130.00316.52
7.4.80.0130.00919.39
7.4.70.0070.01016.58
7.4.60.0070.01316.39
7.4.50.0040.00416.37
7.4.40.0130.00716.54
7.4.30.0080.00816.31
7.4.00.0080.00614.91
7.3.330.0000.00713.14
7.3.320.0000.00513.03
7.3.310.0040.00416.28
7.3.300.0040.00416.12
7.3.290.0070.01416.29
7.3.280.0110.00816.29
7.3.270.0080.00817.40
7.3.260.0130.00716.47
7.3.250.0090.00816.49
7.3.240.0070.01016.50
7.3.230.0030.01416.39
7.3.210.0100.00716.39
7.3.200.0100.01319.39
7.3.190.0150.00316.33
7.3.180.0080.00816.59
7.3.170.0060.01016.31
7.3.160.0090.00616.61
7.3.120.0070.01014.65
7.2.330.0100.00716.77
7.2.320.0130.00616.34
7.2.310.0120.01216.49
7.2.300.0100.00716.70
7.2.290.0070.01016.46
7.1.70.0000.01116.90
7.1.60.0130.00719.46
7.1.50.0090.01217.05
7.1.00.0030.07722.54
7.0.200.0100.00714.63
7.0.140.0100.06721.95
7.0.60.0100.06019.94
7.0.50.0070.08017.90
7.0.40.0100.04019.90
7.0.30.0270.06320.13
7.0.20.0300.05020.09
7.0.10.0000.04720.21
7.0.00.0070.06720.09
5.6.280.0030.07321.14
5.6.210.0100.08020.77
5.6.200.0100.05018.12
5.6.190.0030.04720.37
5.6.180.0500.04720.36
5.6.170.0270.07020.71
5.6.160.0070.04020.48
5.6.150.0070.04318.13
5.6.140.0100.08318.11
5.6.130.0030.08718.10
5.6.120.0100.07021.14
5.6.110.0070.06020.89
5.6.100.0030.08721.01
5.6.90.0130.08021.08
5.6.80.0100.05720.53
5.5.350.0230.07320.45
5.5.340.0070.06017.95
5.5.330.0100.03720.47
5.5.320.0030.08320.29
5.5.310.0300.06020.41
5.5.300.0100.03717.89
5.5.290.0030.06317.92
5.5.280.0230.07020.89
5.5.270.0030.06020.60
5.5.260.0070.04020.87
5.5.250.0100.07320.72
5.5.240.0030.06720.36
5.4.450.0130.07319.46
5.4.440.0030.05019.23
5.4.430.0030.04319.45
5.4.420.0000.04019.18
5.4.410.0030.07319.05
5.4.400.0000.04019.00
5.4.390.0030.06019.13
5.4.380.0030.06318.86
5.4.370.0070.05718.86
5.4.360.0000.04719.00
5.4.350.0070.04318.87
5.4.340.0000.08318.89
5.4.320.0100.04019.04
5.4.310.0030.07719.16
5.4.300.0030.04718.96
5.4.290.0100.05319.03
5.4.280.0070.05719.04
5.4.270.0030.07719.13
5.4.260.0000.04019.06
5.4.250.0030.04719.12
5.4.240.0070.07319.03
5.4.230.0070.05018.89
5.4.220.0030.03718.87
5.4.210.0000.05018.99
5.4.200.0070.05719.03
5.4.190.0030.03719.15
5.4.180.0030.07718.90
5.4.170.0030.05719.05
5.4.160.0000.05719.09
5.4.150.0000.07719.05
5.4.140.0070.07316.27
5.4.130.0000.07316.41
5.4.120.0000.04716.39
5.4.110.0030.07316.54
5.4.100.0000.04716.47
5.4.90.0070.05716.41
5.4.80.0030.06016.16
5.4.70.0030.05016.36
5.4.60.0070.07016.24
5.4.50.0000.06716.47
5.4.40.0030.06316.36
5.4.30.0070.06716.11
5.4.20.0070.04716.32
5.4.10.0030.07316.35
5.4.00.0070.06015.67
5.3.290.0070.05714.76
5.3.280.0000.03714.57
5.3.270.0070.06714.54
5.3.260.0000.05014.54
5.3.250.0030.05014.53
5.3.240.0000.06714.55
5.3.230.0030.08014.54
5.3.220.0000.06014.52
5.3.210.0070.07714.45
5.3.200.0000.06314.39
5.3.190.0000.08014.41
5.3.180.0000.06014.50
5.3.170.0030.04714.50
5.3.160.0000.05314.48
5.3.150.0070.07014.49
5.3.140.0070.06714.49
5.3.130.0070.05714.51
5.3.120.0030.04014.50
5.3.110.0030.06014.34
5.3.100.0030.07714.06
5.3.90.0000.04714.00
5.3.80.0000.04313.96
5.3.70.0100.04013.98
5.3.60.0030.03713.94
5.3.50.0030.03313.96
5.3.40.0000.05013.87
5.3.30.0030.03313.70
5.3.20.0000.03713.62
5.3.10.0000.03713.59
5.3.00.0000.03313.61
5.2.170.0000.03311.03
5.2.160.0030.02711.11
5.2.150.0000.03711.30
5.2.140.0000.03011.03
5.2.130.0030.02310.93
5.2.120.0000.02711.13
5.2.110.0000.03011.03
5.2.100.0000.03010.96
5.2.90.0030.02311.00
5.2.80.0100.02710.98
5.2.70.0000.03011.07
5.2.60.0000.03010.95
5.2.50.0030.03310.84
5.2.40.0000.03011.15
5.2.30.0030.02710.80
5.2.20.0000.03010.96
5.2.10.0000.03011.02
5.2.00.0000.03010.88
5.1.60.0000.02310.14
5.1.50.0000.0239.84
5.1.40.0000.02310.00
5.1.30.0000.02710.34
5.1.20.0030.03310.34
5.1.10.0000.0239.97
5.1.00.0000.0279.91
5.0.50.0000.0208.55
5.0.40.0000.0208.31
5.0.30.0030.0338.18
5.0.20.0000.0208.21
5.0.10.0000.0208.20
5.0.00.0030.0278.14
4.4.90.0000.0137.40
4.4.80.0000.0177.40
4.4.70.0000.0177.40
4.4.60.0000.0137.40
4.4.50.0000.0137.40
4.4.40.0000.0237.40
4.4.30.0000.0137.40
4.4.20.0000.0177.40
4.4.10.0030.0107.40
4.4.00.0030.0207.40
4.3.110.0000.0177.40
4.3.100.0000.0137.40
4.3.90.0000.0137.40
4.3.80.0000.0237.40
4.3.70.0000.0177.40
4.3.60.0000.0177.40
4.3.50.0030.0137.40
4.3.40.0000.0237.40
4.3.30.0000.0137.40
4.3.20.0000.0177.40
4.3.10.0000.0137.40
4.3.00.0000.0137.40

preferences:
54.83 ms | 401 KiB | 5 Q