3v4l.org

run code in 300+ PHP versions simultaneously
<?php ////////////////////////////////////////////////////////////////// // // This is not a difficult test, but it will test your ability to // read and write code as it might exist within our application. // // This should take less than 30 minutes. // // Good luck! // ////////////////////////////////////////////////////////////////// // Part One: Reading ////////////////////////////// // Your challenge here is to figure out what this code does. // Please change the variable names to something more appropriate, // and also comment it to the best of your ability. $s = 'typewriter'; $t = array( ); $a = str_split( $s ); $o = array( ); $o['a'] = array( 'q', 'w', 'z', 'x' ); $o['b'] = array( 'v', 'f', 'g', 'h', 'n' ); $o['c'] = array( 'x', 's', 'd', 'f', 'v' ); $o['d'] = array( 'x', 's', 'w', 'e', 'r', 'f', 'v', 'c' ); $o['e'] = array( 'w', 's', 'd', 'f', 'r' ); $o['f'] = array( 'c', 'd', 'e', 'r', 't', 'g', 'b', 'v' ); $o['g'] = array( 'r', 'f', 'v', 't', 'b', 'y', 'h', 'n' ); $o['h'] = array( 'b', 'g', 't', 'y', 'u', 'j', 'm', 'n' ); $o['i'] = array( 'u', 'j', 'k', 'l', 'o' ); $o['j'] = array( 'n', 'h', 'y', 'u', 'i', 'k', 'm' ); $o['k'] = array( 'u', 'j', 'm', 'l', 'o' ); $o['l'] = array( 'p', 'o', 'i', 'k', 'm' ); $o['m'] = array( 'n', 'h', 'j', 'k', 'l' ); $o['n'] = array( 'b', 'g', 'h', 'j', 'm' ); $o['o'] = array( 'i', 'k', 'l', 'p' ); $o['p'] = array( 'o', 'l' ); $o['r'] = array( 'e', 'd', 'f', 'g', 't' ); $o['s'] = array( 'q', 'w', 'e', 'z', 'x', 'c' ); $o['t'] = array( 'r', 'f', 'g', 'h', 'y' ); $o['u'] = array( 'y', 'h', 'j', 'k', 'i' ); $o['v'] = array( '', 'c', 'd', 'f', 'g', 'b' ); $o['w'] = array( 'q', 'a', 's', 'd', 'e' ); $o['x'] = array( 'z', 'a', 's', 'd', 'c' ); $o['y'] = array( 't', 'g', 'h', 'j', 'u' ); $o['z'] = array( 'x', 's', 'a' ); $o['1'] = array( 'q', 'w' ); $o['2'] = array( 'q', 'w', 'e' ); $o['3'] = array( 'w', 'e', 'r' ); $o['4'] = array( 'e', 'r', 't' ); $o['5'] = array( 'r', 't', 'y' ); $o['6'] = array( 't', 'y', 'u' ); $o['7'] = array( 'y', 'u', 'i' ); $o['8'] = array( 'u', 'i', 'o' ); $o['9'] = array( 'i', 'o', 'p' ); $o['0'] = array( 'o', 'p' ); foreach( $a as $key => $value ) { $u = $a; foreach( $o[$value] as $p ) { $u[$key] = $p; $t[] = join( "", $u ); } } print_r( $t ); ?>

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.0130.00718.43
8.3.50.0170.00521.99
8.3.40.0120.00318.97
8.3.30.0070.00719.09
8.3.20.0000.00820.38
8.3.10.0100.00020.23
8.3.00.0030.00519.38
8.2.180.0030.01318.41
8.2.170.0130.00722.96
8.2.160.0120.00320.38
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0040.00419.66
8.2.110.0070.00320.81
8.2.100.0040.00717.72
8.2.90.0030.00618.03
8.2.80.0040.00517.50
8.2.70.0080.00017.50
8.2.60.0080.00018.16
8.2.50.0000.00918.07
8.2.40.0050.00320.07
8.2.30.0000.00718.17
8.2.20.0040.00417.66
8.2.10.0040.00418.09
8.2.00.0050.00217.74
8.1.280.0100.01025.92
8.1.270.0080.00020.60
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0030.00622.58
8.1.230.0090.00322.75
8.1.220.0000.00817.74
8.1.210.0000.00819.02
8.1.200.0030.00617.61
8.1.190.0040.00417.36
8.1.180.0080.00022.03
8.1.170.0030.00519.14
8.1.160.0000.00718.95
8.1.150.0040.00418.88
8.1.140.0040.00417.51
8.1.130.0030.00317.79
8.1.120.0050.00217.42
8.1.110.0040.00417.53
8.1.100.0040.00417.54
8.1.90.0000.00717.52
8.1.80.0000.00917.55
8.1.70.0000.00717.40
8.1.60.0050.00517.71
8.1.50.0040.00417.46
8.1.40.0080.00017.60
8.1.30.0040.00417.71
8.1.20.0040.00417.61
8.1.10.0040.00417.57
8.1.00.0040.00417.34
8.0.300.0040.00420.01
8.0.290.0000.00716.88
8.0.280.0040.00418.51
8.0.270.0080.00017.22
8.0.260.0030.00317.32
8.0.250.0000.00716.95
8.0.240.0030.00316.97
8.0.230.0050.00317.05
8.0.220.0050.00316.93
8.0.210.0000.00716.85
8.0.200.0000.00716.89
8.0.190.0000.00716.88
8.0.180.0040.00416.93
8.0.170.0070.00016.98
8.0.160.0050.00317.03
8.0.150.0000.00716.80
8.0.140.0040.00416.83
8.0.130.0000.00613.40
8.0.120.0000.00816.82
8.0.110.0030.00516.99
8.0.100.0050.00216.98
8.0.90.0030.00516.74
8.0.80.0060.01216.93
8.0.70.0040.00416.80
8.0.60.0040.00416.97
8.0.50.0070.00016.95
8.0.30.0060.01317.16
8.0.20.0150.00417.40
8.0.10.0040.00417.04
8.0.00.0090.00816.69
7.4.330.0050.00015.02
7.4.320.0030.00316.51
7.4.300.0070.00016.66
7.4.290.0040.00416.53
7.4.280.0070.00016.71
7.4.270.0030.00316.59
7.4.260.0000.00716.68
7.4.250.0000.00716.66
7.4.240.0050.00216.63
7.4.230.0000.00716.45
7.4.220.0060.00916.66
7.4.210.0110.00416.59
7.4.200.0030.00316.46
7.4.160.0080.00816.41
7.4.150.0100.00717.40
7.4.140.0110.01117.86
7.4.130.0030.01316.51
7.4.120.0130.01216.58
7.4.110.0110.00716.61
7.4.100.0140.00516.57
7.4.90.0060.00916.63
7.4.80.0070.01119.39
7.4.70.0060.01116.52
7.4.60.0030.01416.59
7.4.50.0070.00016.67
7.4.40.0110.01116.56
7.4.30.0140.00516.46
7.4.00.0060.01114.70
7.3.330.0000.00513.11
7.3.320.0060.00013.25
7.3.310.0000.00716.53
7.3.300.0000.00716.28
7.3.290.0100.00316.35
7.3.280.0060.01216.42
7.3.270.0120.00617.40
7.3.260.0030.01316.45
7.3.240.0080.00816.47
7.3.230.0130.00316.61
7.3.210.0130.00316.71
7.3.200.0170.01419.39
7.3.190.0070.01016.54
7.3.180.0120.00316.64
7.3.170.0070.01016.42
7.3.160.0100.00716.51
7.3.10.0190.00316.62
7.3.00.0180.00516.12
7.2.330.0100.00716.84
7.2.320.0030.01316.38
7.2.310.0120.00816.82
7.2.300.0070.01016.48
7.2.290.0060.01216.78
7.2.130.0050.00516.73
7.2.120.0110.00816.91
7.2.110.0100.00716.91
7.2.100.0140.00716.47
7.2.90.0080.01116.51
7.2.80.0060.01116.58
7.2.70.0090.00617.02
7.2.60.0130.00516.68
7.2.50.0070.00717.07
7.2.40.0080.00816.74
7.2.30.0060.00916.68
7.2.20.0080.00816.86
7.2.10.0140.00716.94
7.2.00.0120.00518.07
7.1.250.0120.00615.76
7.1.200.0050.00515.84
7.1.100.0030.01018.37
7.1.70.0070.00017.19
7.1.60.0060.01919.32
7.1.50.0130.01616.86
7.1.00.0030.07722.54
7.0.200.0040.00716.93
7.0.140.0000.07722.04
7.0.60.0130.04719.93
7.0.50.0100.07717.95
7.0.40.0130.08720.11
7.0.30.0170.04720.34
7.0.20.0230.07020.24
7.0.10.0100.08720.19
7.0.00.0100.08020.18
5.6.280.0100.07020.91
5.6.210.0000.04320.66
5.6.200.0070.06718.21
5.6.190.0030.05320.45
5.6.180.0230.07020.61
5.6.170.0370.07020.55
5.6.160.0100.08020.39
5.6.150.0000.04718.20
5.6.140.0030.05318.18
5.6.130.0100.06318.26
5.6.120.0100.08021.05
5.6.110.0070.05721.03
5.6.100.0130.08020.99
5.6.90.0030.05721.04
5.6.80.0030.08020.57
5.6.70.3330.02720.43
5.5.350.0100.08320.45
5.5.340.0070.04717.96
5.5.330.0100.08720.27
5.5.320.0230.03720.25
5.5.310.0230.05320.23
5.5.300.0070.07318.00
5.5.290.0170.06017.96
5.5.280.0270.03320.70
5.5.270.0130.07720.77
5.5.260.0200.05720.69
5.5.250.0070.08720.84
5.5.240.0070.08020.33
5.4.450.0100.06019.44
5.4.440.0900.04319.61
5.4.430.0030.06019.54
5.4.420.0100.05719.39
5.4.410.0030.06019.52
5.4.400.0400.08018.93
5.4.390.0470.06718.82
5.4.380.0130.05718.54
5.4.370.0370.07018.82
5.4.360.0370.07318.80
5.4.350.0030.03812.07
5.4.340.0060.03712.07
5.4.320.0070.03812.56
5.4.310.0080.04012.56
5.4.300.0040.03912.56
5.4.290.0040.04212.56
5.4.280.0060.03812.46
5.4.270.0060.03712.46
5.4.260.0100.03612.46
5.4.250.0080.03612.45
5.4.240.0050.03812.46
5.4.230.0050.04012.45
5.4.220.0090.03412.45
5.4.210.0090.03612.45
5.4.200.0050.04512.45
5.4.190.0120.03212.45
5.4.180.0070.03612.45
5.4.170.0060.04112.45
5.4.160.0070.04112.45
5.4.150.0130.05212.45
5.4.140.0100.03812.13
5.4.130.0060.03712.12
5.4.120.0100.05112.07
5.4.110.0080.03612.07
5.4.100.0070.04712.07
5.4.90.0120.03312.07
5.4.80.0090.03712.07
5.4.70.0040.03912.07
5.4.60.0050.03712.07
5.4.50.0060.03612.07
5.4.40.0060.03612.06
5.4.30.0050.03712.05
5.4.20.0080.04312.05
5.4.10.0070.03612.06
5.4.00.0090.04011.54
5.3.290.0060.04112.82
5.3.280.0070.04012.75
5.3.270.0070.03912.76
5.3.260.0070.03812.76
5.3.250.0070.03712.76
5.3.240.0110.03312.76
5.3.230.0040.04112.75
5.3.220.0090.03612.72
5.3.210.0080.04212.72
5.3.200.0100.03812.71
5.3.190.0080.03812.72
5.3.180.0080.03712.71
5.3.170.0070.03812.71
5.3.160.0060.03912.71
5.3.150.0070.04112.72
5.3.140.0100.04212.71
5.3.130.0120.04012.70
5.3.120.0050.04512.70
5.3.110.0130.04912.70
5.3.100.0130.03412.19
5.3.90.0070.03712.18
5.3.80.0070.04212.16
5.3.70.0050.04012.16
5.3.60.0060.04212.15
5.3.50.0100.03812.10
5.3.40.0050.04312.10
5.3.30.0070.03612.05
5.3.20.0080.03411.84
5.3.10.0050.03811.80
5.3.00.0040.04211.79
5.2.170.0060.0309.29
5.2.160.0090.0269.29
5.2.150.0060.0309.29
5.2.140.0050.0319.29
5.2.130.0110.0399.25
5.2.120.0070.0409.25
5.2.110.0100.0289.26
5.2.100.0070.0279.25
5.2.90.0070.0289.26
5.2.80.0020.0349.24
5.2.70.0060.0309.25
5.2.60.0030.0329.20
5.2.50.0070.0299.17
5.2.40.0080.0269.15
5.2.30.0050.0309.12
5.2.20.0060.0289.11
5.2.10.0040.0309.02
5.2.00.0060.0338.88
5.1.60.0060.0278.16
5.1.50.0080.0268.16
5.1.40.0050.0298.14
5.1.30.0050.0268.49
5.1.20.0060.0268.51
5.1.10.0040.0288.23
5.1.00.0080.0278.23
5.0.50.0070.0186.73
5.0.40.0050.0186.59
5.0.30.0050.0326.39
5.0.20.0100.0226.37
5.0.10.0070.0266.35
5.0.00.0040.0346.34
4.4.90.0030.0224.78
4.4.80.0010.0174.75
4.4.70.0030.0164.76
4.4.60.0050.0154.75
4.4.50.0030.0174.77
4.4.40.0030.0254.71
4.4.30.0030.0184.76
4.4.20.0030.0174.84
4.4.10.0050.0164.85
4.4.00.0050.0234.75
4.3.110.0020.0164.67
4.3.100.0010.0174.67
4.3.90.0020.0154.64
4.3.80.0030.0244.60
4.3.70.0020.0164.63
4.3.60.0040.0134.62
4.3.50.0010.0174.63
4.3.40.0030.0244.55
4.3.30.0020.0183.36
4.3.20.0030.0193.34
4.3.10.0040.0143.29
4.3.00.0070.0176.76

preferences:
63.37 ms | 401 KiB | 5 Q