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 = 81920; $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"; 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.40.0100.01018.88
8.3.30.0000.01418.98
8.3.20.0030.00520.13
8.3.10.0080.00023.60
8.3.00.0040.00419.34
8.2.170.0110.00422.96
8.2.160.0030.01020.34
8.2.150.0000.00924.18
8.2.140.0030.00624.66
8.2.130.0060.00926.16
8.2.120.0080.00418.03
8.2.110.0030.00621.92
8.2.100.0030.01017.91
8.2.90.0110.00019.21
8.2.80.0040.00417.97
8.2.70.0090.00517.75
8.2.60.0000.00917.93
8.2.50.0050.00318.07
8.2.40.0060.00319.89
8.2.30.0060.00318.21
8.2.20.0080.00017.76
8.2.10.0040.00418.06
8.2.00.0000.01117.79
8.1.270.0050.00323.83
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0090.00024.00
8.1.230.0070.00318.97
8.1.220.0000.00817.80
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0000.00917.23
8.1.180.0090.00019.13
8.1.170.0020.00518.59
8.1.160.0030.00522.02
8.1.150.0000.00718.64
8.1.140.0000.00717.43
8.1.130.0030.00317.80
8.1.120.0000.00717.51
8.1.110.0030.00617.38
8.1.100.0080.00017.46
8.1.90.0030.00517.43
8.1.80.0020.00617.52
8.1.70.0000.00717.44
8.1.60.0040.00417.58
8.1.50.0040.00417.56
8.1.40.0040.00417.58
8.1.30.0040.00417.62
8.1.20.0040.00417.70
8.1.10.0050.00217.47
8.1.00.0040.00417.60
8.0.300.0000.00718.77
8.0.290.0070.00017.05
8.0.280.0030.00318.47
8.0.270.0030.00317.19
8.0.260.0030.00317.29
8.0.250.0040.00416.93
8.0.240.0000.00716.91
8.0.230.0000.00817.03
8.0.220.0040.00416.96
8.0.210.0030.00316.89
8.0.200.0060.00316.98
8.0.190.0030.00617.00
8.0.180.0040.00416.82
8.0.170.0000.00816.94
8.0.160.0040.00316.79
8.0.150.0080.00016.69
8.0.140.0070.00016.89
8.0.130.0060.00013.27
8.0.120.0070.00016.83
8.0.110.0000.00716.83
8.0.100.0040.00416.80
8.0.90.0000.00716.81
8.0.80.0060.00916.82
8.0.70.0000.00916.78
8.0.60.0040.00416.90
8.0.50.0000.00716.97
8.0.30.0070.01217.11
8.0.20.0110.00817.45
8.0.10.0040.00417.03
8.0.00.0110.00616.82
7.4.330.0030.00315.01
7.4.320.0000.00716.63
7.4.300.0000.00716.52
7.4.290.0050.00216.54
7.4.280.0070.00016.59
7.4.270.0020.00516.63
7.4.260.0000.00716.50
7.4.250.0040.00416.48
7.4.240.0040.00416.60
7.4.230.0000.00716.71
7.4.220.0110.00716.70
7.4.210.0100.00816.54
7.4.200.0070.00016.69
7.4.190.0000.00716.57
7.4.160.0040.01216.36
7.4.150.0150.00317.40
7.4.140.0090.01117.86
7.4.130.0110.00816.48
7.4.120.0120.00516.43
7.4.110.0090.00916.63
7.4.100.0090.00916.54
7.4.90.0090.00916.39
7.4.80.0030.01519.39
7.4.70.0070.01016.53
7.4.60.0130.00416.46
7.4.50.0040.00016.56
7.4.40.0130.00716.64
7.4.30.0120.00916.57
7.4.00.0120.00315.01
7.3.330.0050.00013.04
7.3.320.0000.00513.13
7.3.310.0030.00316.14
7.3.300.0030.00316.34
7.3.290.0090.00616.28
7.3.280.0090.00716.34
7.3.270.0070.01017.40
7.3.260.0090.01316.58
7.3.250.0060.01116.32
7.3.240.0060.01016.33
7.3.230.0040.01316.63
7.3.210.0030.01316.50
7.3.200.0180.00619.39
7.3.190.0100.01016.55
7.3.180.0100.00616.35
7.3.170.0120.00316.32
7.3.160.0060.00916.38
7.3.120.0030.01015.07
7.2.330.0170.00316.60
7.2.320.0070.01016.53
7.2.310.0060.01616.83
7.2.300.0090.00616.40
7.2.290.0060.01116.74
7.2.60.0090.00915.97
7.2.00.0070.01019.32
7.1.200.0130.00015.64
7.1.100.0030.00918.21
7.1.70.0040.00417.09
7.1.60.0080.00319.46
7.1.50.0040.01817.13
7.1.00.0000.07722.32
7.0.200.0120.00414.51
7.0.140.0070.07022.00
7.0.60.0070.08320.05
7.0.50.0100.04717.91
7.0.40.0000.05020.40
7.0.30.0230.04720.12
7.0.20.0300.05720.18
7.0.10.0070.04020.02
7.0.00.0070.08720.22
5.6.210.0070.08020.65
5.6.200.0100.07718.16
5.6.190.0000.08720.77
5.6.180.0170.04320.64
5.6.170.0300.07720.71
5.6.160.0000.09320.53
5.6.150.0130.07318.09
5.6.140.0070.03718.23
5.6.130.0130.06718.08
5.6.120.0100.08020.98
5.6.110.0070.09321.09
5.6.100.0100.08320.96
5.6.90.0030.08321.00
5.6.80.0100.07720.48
5.5.350.0100.08020.39
5.5.340.0130.07717.89
5.5.330.0030.09020.23
5.5.320.3700.05020.30
5.5.310.0300.04320.41
5.5.300.0170.06717.88
5.5.290.0000.05717.91
5.5.280.0000.04320.89
5.5.270.0170.07720.88
5.5.260.0100.08320.87
5.5.250.0030.08320.62
5.5.240.0100.03020.15
5.4.450.0800.06019.13
5.4.440.0800.06019.48
5.4.430.0570.05719.47
5.4.420.0600.06019.50
5.4.410.0630.06018.98
5.4.400.0030.06018.78
5.4.390.0770.06319.14
5.4.380.0230.06718.69
5.4.370.0400.05018.68
5.4.360.0430.05018.70
5.4.350.0270.06018.74
5.4.340.0300.05018.52
5.4.320.0070.03812.47
5.4.310.0070.03812.46
5.4.300.0100.03712.47
5.4.290.0210.07612.45
5.4.280.0240.05712.34
5.4.270.0120.06912.35
5.4.260.0120.07412.34
5.4.250.0070.05312.34
5.4.240.0090.06312.35
5.4.230.0080.05512.34
5.4.220.0100.07012.34
5.4.210.0090.05012.34
5.4.200.0080.06012.34
5.4.190.0080.04012.34
5.4.180.0190.08412.33
5.4.170.0090.04712.34
5.4.160.0070.03912.34
5.4.150.0040.04012.34
5.4.140.0080.05512.02
5.4.130.0100.05012.01
5.4.120.0080.07411.97
5.4.110.0090.07211.96
5.4.100.0100.06311.96
5.4.90.0130.09811.96
5.4.80.0060.06211.96
5.4.70.0170.06811.96
5.4.60.0160.07211.96
5.4.50.0120.06711.95
5.4.40.0110.07011.95
5.4.30.0080.04811.95
5.4.20.0160.10911.94
5.4.10.0100.07211.95
5.4.00.0100.07411.43
5.3.290.0110.05112.80
5.3.280.0140.05212.71
5.3.270.0110.03812.73
5.3.260.0130.04412.72
5.3.250.0060.03912.72
5.3.240.0050.04212.72
5.3.230.0080.04212.71
5.3.220.0080.06012.68
5.3.210.0080.05412.68
5.3.200.0100.04112.68
5.3.190.0080.03912.68
5.3.180.0030.04012.67
5.3.170.0100.04112.67
5.3.160.0290.13212.67
5.3.150.0100.04212.67
5.3.140.0120.07712.66
5.3.130.0140.05012.66
5.3.120.0090.04012.66
5.3.110.0150.05112.66
5.3.100.0060.05612.11
5.3.90.0240.12812.09
5.3.80.0110.04712.07
5.3.70.0060.04012.07
5.3.60.0090.03512.07
5.3.50.0050.03812.00
5.3.40.0050.04212.00
5.3.30.0120.06111.95
5.3.20.0130.04911.73
5.3.10.0090.06011.70
5.3.00.0120.06811.69
5.2.170.0050.0329.18
5.2.160.0130.0399.18
5.2.150.0110.0739.18
5.2.140.0070.0369.18
5.2.130.0110.0369.14
5.2.120.0070.0389.14
5.2.110.0050.0329.15
5.2.100.0040.0309.14
5.2.90.0090.0299.14
5.2.80.0100.0519.14
5.2.70.0120.0459.14
5.2.60.0010.0429.10
5.2.50.0050.0379.06
5.2.40.0080.0349.04
5.2.30.0070.0369.02
5.2.20.0070.0299.01
5.2.10.0060.0578.93
5.2.00.0060.0308.79
5.1.60.0030.0278.07
5.1.50.0040.0298.07
5.1.40.0100.0318.05
5.1.30.0100.0438.41
5.1.20.0070.0328.42
5.1.10.0100.0608.15
5.1.00.0050.0288.15
5.0.50.0030.0236.63
5.0.40.0020.0216.49
5.0.30.0050.0346.29
5.0.20.0020.0296.27
5.0.10.0030.0276.25
5.0.00.0030.0336.24
4.4.90.0030.0174.78
4.4.80.0070.0694.75
4.4.70.0040.0264.76
4.4.60.0050.0214.76
4.4.50.0050.0204.77
4.4.40.0040.0404.71
4.4.30.0140.0544.76
4.4.20.0100.0314.84
4.4.10.0080.0374.85
4.4.00.0110.0454.76
4.3.110.0050.0284.67
4.3.100.0020.0184.67
4.3.90.0050.0274.63
4.3.80.0060.0434.59
4.3.70.0120.0364.63
4.3.60.0050.0314.63
4.3.50.0050.0144.63
4.3.40.0030.0244.54
4.3.30.0060.0353.29
4.3.20.0000.0193.27
4.3.10.0030.0163.23
4.3.00.0200.01310.55

preferences:
68.07 ms | 400 KiB | 5 Q