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 = 475149; $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; print "$class_name\n"; print "$CF_GOD"; if ($is_god) { print "This player is god\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.0040.01116.88
8.3.50.0130.00422.05
8.3.40.0040.01819.02
8.3.30.0090.00619.09
8.3.20.0090.00020.16
8.3.10.0040.00423.66
8.3.00.0040.00419.38
8.2.180.0100.00618.29
8.2.170.0040.01122.96
8.2.160.0110.00318.68
8.2.150.0080.00024.18
8.2.140.0050.00524.66
8.2.130.0000.00726.16
8.2.120.0030.00622.11
8.2.110.0050.00521.02
8.2.100.0000.01217.77
8.2.90.0040.00419.31
8.2.80.0000.00817.97
8.2.70.0000.00817.75
8.2.60.0000.00818.05
8.2.50.0000.00918.10
8.2.40.0040.00420.59
8.2.30.0060.00319.90
8.2.20.0040.00417.81
8.2.10.0030.00518.16
8.2.00.0080.00417.70
8.1.280.0150.00325.92
8.1.270.0080.00023.82
8.1.260.0030.00526.35
8.1.250.0070.00028.09
8.1.240.0090.00020.84
8.1.230.0090.00317.70
8.1.220.0040.00417.79
8.1.210.0080.00018.77
8.1.200.0000.00917.22
8.1.190.0000.00817.22
8.1.180.0080.00018.10
8.1.170.0040.00418.71
8.1.160.0000.00822.15
8.1.150.0030.00518.62
8.1.140.0070.00017.43
8.1.130.0050.00317.84
8.1.120.0040.00317.51
8.1.110.0040.00417.45
8.1.100.0030.00317.55
8.1.90.0050.00317.38
8.1.80.0030.00617.44
8.1.70.0000.00817.46
8.1.60.0040.00417.51
8.1.50.0000.00817.52
8.1.40.0040.00417.55
8.1.30.0000.00817.63
8.1.20.0050.00317.60
8.1.10.0060.00317.65
8.1.00.0030.00517.36
8.0.300.0060.00318.77
8.0.290.0080.00016.75
8.0.280.0000.00718.34
8.0.270.0070.00017.19
8.0.260.0030.00317.12
8.0.250.0000.00717.08
8.0.240.0070.00017.01
8.0.230.0000.00717.02
8.0.220.0070.00016.95
8.0.210.0030.00316.85
8.0.200.0040.00416.92
8.0.190.0030.00616.99
8.0.180.0040.00416.98
8.0.170.0000.00816.99
8.0.160.0000.00816.89
8.0.150.0000.00816.80
8.0.140.0040.00416.81
8.0.130.0090.00013.41
8.0.120.0040.00416.84
8.0.110.0000.00716.98
8.0.100.0070.00016.87
8.0.90.0040.00416.78
8.0.80.0090.00616.86
8.0.70.0040.00416.88
8.0.60.0040.00416.96
8.0.50.0040.00416.93
8.0.30.0120.00617.21
8.0.20.0110.00717.40
8.0.10.0050.00317.03
8.0.00.0090.00816.67
7.4.330.0030.00315.03
7.4.320.0060.00016.58
7.4.300.0050.00216.64
7.4.290.0000.00716.52
7.4.280.0040.00416.63
7.4.270.0070.00016.63
7.4.260.0080.00016.44
7.4.250.0080.00016.53
7.4.240.0050.00216.51
7.4.230.0030.00316.62
7.4.220.0130.00616.43
7.4.210.0120.00416.63
7.4.200.0070.00016.73
7.4.190.0030.00316.57
7.4.160.0130.00316.39
7.4.150.0070.01017.40
7.4.140.0110.00717.86
7.4.130.0100.00716.53
7.4.120.0090.00816.55
7.4.110.0000.01816.63
7.4.100.0190.00016.59
7.4.90.0030.01716.46
7.4.80.0160.00619.39
7.4.70.0080.00816.59
7.4.60.0030.01516.71
7.4.50.0090.00016.54
7.4.40.0100.00716.54
7.4.30.0100.00716.50
7.4.00.0030.01214.94
7.3.330.0030.00313.25
7.3.320.0030.00313.27
7.3.310.0000.00716.29
7.3.300.0070.00016.34
7.3.290.0160.00416.30
7.3.280.0080.01016.38
7.3.270.0130.00317.40
7.3.260.0130.00316.55
7.3.250.0140.00516.57
7.3.240.0040.01216.39
7.3.230.0070.01316.39
7.3.210.0070.01116.67
7.3.200.0060.01219.39
7.3.190.0000.01716.41
7.3.180.0000.01516.52
7.3.170.0060.00916.46
7.3.160.0030.01416.41
7.3.120.0070.01014.84
7.2.330.0090.00916.56
7.2.320.0150.00816.45
7.2.310.0070.01116.73
7.2.300.0100.00616.47
7.2.290.0180.00616.52
7.2.60.0220.00016.72
7.2.00.0000.01219.43
7.1.200.0030.00715.74
7.1.100.0090.00317.78
7.1.70.0060.00317.18
7.1.60.0060.01319.46
7.1.50.0170.00317.02
7.1.00.0030.07722.27
7.0.200.0210.00914.95
7.0.140.0000.07322.00
7.0.60.0070.07020.03
7.0.50.0100.06717.84
7.0.40.0030.04720.07
7.0.30.0300.08020.18
7.0.20.0300.08020.28
7.0.10.0030.09320.12
7.0.00.0030.06320.20
5.6.280.0030.07320.79
5.6.210.0070.07320.65
5.6.200.0030.08018.13
5.6.190.0100.05320.43
5.6.180.0470.07020.33
5.6.170.0170.04320.41
5.6.160.0030.06720.40
5.6.150.0070.05718.19
5.6.140.0200.06718.11
5.6.130.0070.07018.16
5.6.120.0100.04321.05
5.6.110.0030.08021.01
5.6.100.0030.04020.98
5.6.90.0130.06321.00
5.6.80.0030.05020.45
5.5.350.0100.07320.48
5.5.340.0070.03717.98
5.5.330.0030.07320.40
5.5.320.0070.08020.29
5.5.310.0230.07020.18
5.5.300.0100.03318.02
5.5.290.0030.04018.02
5.5.280.0200.07320.97
5.5.270.0130.07720.79
5.5.260.0100.07720.80
5.5.250.0100.05320.69
5.5.240.0030.05020.29
5.4.450.0670.06719.13
5.4.440.0970.04719.54
5.4.430.0970.06019.21
5.4.420.0830.05019.59
5.4.410.0730.06018.97
5.4.400.0800.05019.13
5.4.390.0900.05319.27
5.4.380.0330.06318.59
5.4.370.0270.04718.70
5.4.360.0330.05018.64
5.4.350.0430.06018.74
5.4.340.0400.06718.53
5.4.320.0060.03712.46
5.4.310.0100.04112.46
5.4.300.0130.08112.47
5.4.290.0190.06712.45
5.4.280.0200.06712.35
5.4.270.0170.04412.34
5.4.260.0070.04412.34
5.4.250.0050.04512.35
5.4.240.0170.05312.34
5.4.230.0120.04112.34
5.4.220.0090.04112.34
5.4.210.0120.05112.34
5.4.200.0090.05912.34
5.4.190.0300.08212.34
5.4.180.0330.07812.33
5.4.170.0110.07212.35
5.4.160.0080.04212.34
5.4.150.0080.04012.34
5.4.140.0090.05812.02
5.4.130.0080.04612.01
5.4.120.0070.04111.96
5.4.110.0090.04211.96
5.4.100.0130.05511.96
5.4.90.0100.05311.96
5.4.80.0090.07811.96
5.4.70.0120.04811.96
5.4.60.0130.07511.96
5.4.50.0070.04111.96
5.4.40.0150.04611.95
5.4.30.0160.10711.94
5.4.20.0070.04311.95
5.4.10.0060.05611.95
5.4.00.0050.04511.43
5.3.290.0090.04512.80
5.3.280.0090.05112.71
5.3.270.0100.05312.72
5.3.260.0100.04212.72
5.3.250.0120.06112.72
5.3.240.0110.03912.72
5.3.230.0090.05312.71
5.3.220.0090.06212.68
5.3.210.0050.04812.68
5.3.200.0090.03912.68
5.3.190.0060.04712.68
5.3.180.0160.03712.68
5.3.170.0080.03712.67
5.3.160.0070.04112.67
5.3.150.0080.05012.68
5.3.140.0090.05612.66
5.3.130.0140.06712.66
5.3.120.0090.06612.66
5.3.110.0060.04112.66
5.3.100.0120.04612.12
5.3.90.0080.03812.08
5.3.80.0080.04012.07
5.3.70.0060.06012.08
5.3.60.0150.04112.06
5.3.50.0030.05412.00
5.3.40.0090.04912.00
5.3.30.0080.03811.95
5.3.20.0080.04911.73
5.3.10.0140.05411.70
5.3.00.0100.05511.68
5.2.170.0110.0489.19
5.2.160.0140.0249.18
5.2.150.0060.0359.19
5.2.140.0060.0369.18
5.2.130.0080.0319.14
5.2.120.0050.0379.14
5.2.110.0050.0349.15
5.2.100.0080.0329.15
5.2.90.0060.0339.14
5.2.80.0100.0379.14
5.2.70.0080.0329.14
5.2.60.0060.0449.10
5.2.50.0060.0349.07
5.2.40.0080.0359.04
5.2.30.0130.0379.02
5.2.20.0120.0469.01
5.2.10.0190.0568.93
5.2.00.0170.0548.79
5.1.60.0130.0518.07
5.1.50.0140.0568.07
5.1.40.0090.0368.05
5.1.30.0090.0408.41
5.1.20.0100.0458.42
5.1.10.0050.0388.15
5.1.00.0120.0418.15
5.0.50.0050.0346.63
5.0.40.0090.0516.49
5.0.30.0040.0456.29
5.0.20.0090.0346.27
5.0.10.0040.0306.25
5.0.00.0080.0316.24
4.4.90.0030.0184.78
4.4.80.0050.0164.76
4.4.70.0060.0274.75
4.4.60.0090.0314.76
4.4.50.0030.0254.77
4.4.40.0050.0294.71
4.4.30.0050.0154.76
4.4.20.0020.0174.84
4.4.10.0030.0174.85
4.4.00.0060.0434.76
4.3.110.0050.0234.67
4.3.100.0070.0254.66
4.3.90.0040.0154.63
4.3.80.0050.0294.58
4.3.70.0050.0184.63
4.3.60.0040.0184.63
4.3.50.0040.0224.63
4.3.40.0050.0304.54
4.3.30.0000.0193.29
4.3.20.0000.0193.27
4.3.10.0050.0133.23
4.3.00.0030.01710.55

preferences:
68.91 ms | 401 KiB | 5 Q