3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 'q0data' => '{"question":"chicken","modal":"ought to","probability":"high","utilitygain":"low","subcondition":"Edward","rt":2975,"response":"agree","freeResponse":"wvwvwewe"}', 'q1data' => '{"question":"procrastinate","modal":"ought to","probability":"low","utilitygain":"high","subcondition":"accept","rt":2603,"response":"disagree","freeResponse":"vwevewvewvewvew"}', 'language' => 'vewoievwnpio', 'payment' => 'ceeqqecqeq' ); function parseTrialData ($trialData) { $trialData = substr($trialData, 1, -1); // get rid of leading '{' and trailing '}' $trialData = explode(',', $trialData); // 'explode' is PHP for 'split' // i.e., separate the string into an array of strings of form 'key:value' $parsedTrialData = array(); foreach ($trialData as $kv) { $exploded = explode(':', $kv); $parsedTrialData[$exploded[0]] = $exploded[1]; } return $parsedTrialData; } $headerItems = array(); $trialData = array(); foreach (array_keys($arr) as $key) { $value = $arr[$key]; $pair = array($key, $value); if (substr($value[1], 0, 1) == '{' and substr($value, -1) == '{') { // if the data starts and ends with '{', '}' then it's a complex data object representing a single trial. // so, add the key-value pair to $trialData array to await further processing $trialData[$key] = $value; } else { // otherwise, it's data shared across all trials; so add the pair to the $headerItems array $headerItems[$key] = $value; } } $header = ""; // for new files, make header showing variable names $globalHeader = ""; foreach (array_keys($headerItems) as $key) { $globalHeader .= $key . ","; } $localHeader = ""; $parsedSampleTrialData = parseTrialData(array_values($trialData)[0]); foreach (array_keys($parsedSampleTrialData) as $key) { $localHeader .= $key . ","; } $header .= $globalHeader . $localHeader; $header = substr($header, 0, -1) . "\n"; echo $header; ?>

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.0160.00618.79
8.3.50.0100.00821.15
8.3.40.0090.00918.96
8.3.30.0110.00418.88
8.3.20.0000.00720.30
8.3.10.0000.00823.61
8.3.00.0000.00823.65
8.2.180.0090.00618.41
8.2.170.0070.01118.96
8.2.160.0100.01022.96
8.2.150.0070.01125.66
8.2.140.0060.00324.66
8.2.130.0030.00626.16
8.2.120.0080.00020.53
8.2.110.0070.00419.30
8.2.100.0040.00717.75
8.2.90.0050.00319.22
8.2.80.0040.00417.97
8.2.70.0030.00617.75
8.2.60.0050.00318.04
8.2.50.0080.00018.07
8.2.40.0080.00021.04
8.2.30.0080.00019.91
8.2.20.0040.00417.88
8.2.10.0040.00418.14
8.2.00.0040.00418.14
8.1.280.0100.00725.92
8.1.270.0050.00320.29
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0000.00923.82
8.1.230.0060.00619.26
8.1.220.0060.00317.79
8.1.210.0040.00418.77
8.1.200.0040.00417.38
8.1.190.0000.00817.13
8.1.180.0030.00518.10
8.1.170.0040.00418.71
8.1.160.0040.00422.04
8.1.150.0040.00418.81
8.1.140.0040.00417.47
8.1.130.0030.00317.70
8.1.120.0040.00417.54
8.1.110.0040.00417.47
8.1.100.0000.00817.50
8.1.90.0000.00717.44
8.1.80.0000.00717.34
8.1.70.0000.00817.48
8.1.60.0030.00517.59
8.1.50.0030.00517.55
8.1.40.0030.00517.50
8.1.30.0040.00417.45
8.1.20.0070.00017.60
8.1.10.0040.00417.47
8.1.00.0050.00317.57
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0040.00418.37
8.0.270.0030.00517.28
8.0.260.0030.00317.27
8.0.250.0050.00317.08
8.0.240.0030.00316.92
8.0.230.0040.00416.92
8.0.220.0070.00016.85
8.0.210.0030.00516.91
8.0.200.0000.00716.90
8.0.190.0000.00816.92
8.0.180.0000.00716.98
8.0.170.0000.00816.87
8.0.160.0000.00816.90
8.0.150.0070.00017.00
8.0.140.0040.00416.80
8.0.130.0080.00013.30
8.0.120.0080.00016.82
8.0.110.0040.00416.93
8.0.100.0000.00716.91
8.0.90.0040.00416.84
8.0.80.0030.01416.90
8.0.70.0000.00817.08
8.0.60.0050.00317.01
8.0.50.0000.00716.95
8.0.30.0160.00317.06
8.0.20.0090.00917.40
8.0.10.0070.00017.20
8.0.00.0120.00616.86
7.4.330.0060.00015.18
7.4.320.0000.00616.42
7.4.300.0030.00316.51
7.4.290.0030.00316.54
7.4.280.0020.00516.63
7.4.270.0020.00516.61
7.4.260.0030.00316.48
7.4.250.0000.00716.48
7.4.240.0060.00216.58
7.4.230.0070.00016.42
7.4.220.0090.01316.62
7.4.210.0070.00916.68
7.4.200.0050.00316.66
7.4.160.0090.00616.55
7.4.150.0090.00917.40
7.4.140.0110.00817.86
7.4.130.0060.01116.56
7.4.120.0060.01116.60
7.4.110.0030.01516.41
7.4.100.0150.00916.44
7.4.90.0120.00616.55
7.4.80.0110.00619.39
7.4.70.0090.00916.66
7.4.60.0090.00616.58
7.4.50.0070.00016.46
7.4.40.0150.00616.67
7.4.30.0000.01816.59
7.4.00.0070.00714.79
7.3.330.0000.00613.39
7.3.320.0060.00013.28
7.3.310.0070.00016.48
7.3.300.0030.00316.30
7.3.290.0040.00416.48
7.3.280.0040.01616.46
7.3.270.0120.00617.40
7.3.260.0110.00716.46
7.3.250.0120.00716.46
7.3.240.0090.00616.46
7.3.230.0060.01216.39
7.3.210.0150.00716.46
7.3.200.0160.00616.69
7.3.190.0110.00716.54
7.3.180.0040.01216.53
7.3.170.0100.00616.60
7.3.160.0090.01316.46
7.2.330.0120.00616.65
7.2.320.0120.00416.88
7.2.310.0090.00616.77
7.2.300.0130.00316.75
7.2.290.0120.00916.83
7.2.00.0030.00919.43
7.1.100.0650.01016.41
7.1.70.0040.00416.93
7.1.60.0130.01019.42
7.1.50.0230.01334.98
7.1.00.0070.07022.44
7.0.200.0070.00516.46
7.0.60.0100.07320.08
7.0.50.0030.08717.89
7.0.40.0000.04720.17
7.0.30.0300.08020.07
7.0.20.0300.07020.23
7.0.10.0070.04020.12
7.0.00.0100.05020.23
5.6.280.0070.03021.11
5.6.210.0130.07320.68
5.6.200.0030.08318.16
5.6.190.0030.07020.77
5.6.180.0300.05320.47
5.6.170.0200.03720.47
5.6.160.0100.04020.54
5.6.150.0030.05018.13
5.6.140.0100.08018.17
5.6.130.0030.05318.23
5.6.120.0070.04021.03
5.6.110.0170.07321.14
5.6.100.0130.07721.00
5.6.90.0030.08720.97
5.6.80.0130.08020.39
5.5.350.0230.07720.39
5.5.340.0070.06317.99
5.5.330.0070.05720.28
5.5.320.0300.04020.36
5.5.310.0200.03720.20
5.5.300.0070.08017.98
5.5.290.0130.07018.07
5.5.280.0130.08020.74
5.5.270.0030.08320.80
5.5.260.0070.07720.88
5.5.250.0030.04020.69
5.5.240.0030.08020.37
5.4.450.0430.06319.62
5.4.440.1000.06719.32
5.4.430.1130.05319.70
5.4.420.0870.06019.31
5.4.410.0730.06019.48
5.4.400.0670.05719.15
5.4.390.0070.05719.14
5.4.380.0200.05319.15
5.4.370.0700.05319.38
5.4.360.0870.06318.84
5.4.350.0830.06018.98
5.4.340.0630.05719.29
5.4.320.0870.07019.13
5.4.310.1000.05719.30
5.4.300.0700.06019.25
5.4.290.1000.05319.37
5.4.280.0730.05718.84
5.4.270.0800.05319.05
5.4.260.0630.05019.14
5.4.250.0730.05018.97
5.4.240.1000.05019.23
5.4.230.0770.05019.14
5.4.220.0630.06018.85
5.4.210.0800.05719.13
5.4.200.0900.04016.95
5.4.190.0870.07019.00
5.4.180.1130.05319.34
5.4.170.0870.05318.93
5.4.160.0970.04319.02
5.4.150.0970.04719.24
5.4.140.0900.04716.55
5.4.130.0830.04316.52
5.4.120.1030.04716.31
5.4.110.1030.05016.44
5.4.100.0700.04716.55
5.4.90.0700.06316.36
5.4.80.0700.05016.50
5.4.70.0730.04716.30
5.4.60.0700.06016.40
5.4.50.0630.06716.53
5.4.40.0800.05316.55
5.4.30.0970.05316.52
5.4.20.0970.05316.53
5.4.10.0900.05316.52
5.4.00.1030.05015.88
5.3.290.0800.05314.57
5.3.280.0870.05714.82
5.3.270.1000.07314.66
5.3.260.0870.05714.52
5.3.250.0730.05314.51
5.3.240.0830.06014.52
5.3.230.0730.04714.64
5.3.220.0730.04714.62
5.3.210.0900.05714.50
5.3.200.0730.04714.62
5.3.190.0870.05314.57
5.3.180.1100.04014.54
5.3.170.0670.04714.79
5.3.160.0700.06314.71
5.3.150.1270.05714.65
5.3.140.0670.05014.63
5.3.130.0730.06314.45
5.3.120.0900.05314.57
5.3.110.0730.06014.56
5.3.100.0770.05713.95
5.3.90.0930.05714.05
5.3.80.0630.05314.11
5.3.70.0570.05713.93
5.3.60.0670.05013.91
5.3.50.0500.05313.86
5.3.40.0100.04714.04
5.3.30.0330.05313.84
5.3.20.0970.04013.70
5.3.10.0730.07013.80
5.3.00.1000.05013.55
5.2.170.0500.04011.08
5.2.160.0070.04011.02
5.2.150.0070.04011.37
5.2.140.0130.05311.05
5.2.130.0770.04711.16
5.2.120.0500.04711.33
5.2.110.0900.03311.16
5.2.100.0630.04011.02
5.2.90.0670.04011.01
5.2.80.0600.04711.24
5.2.70.0770.03311.11
5.2.60.0100.05010.97
5.2.50.0170.03711.17
5.2.40.0470.04710.91
5.2.30.0470.04011.00
5.2.20.0400.03710.88
5.2.10.0470.05010.92
5.2.00.0670.05010.64
5.1.60.0770.0379.98
5.1.50.0600.03710.06
5.1.40.0530.03310.06
5.1.30.0570.04310.49
5.1.20.0600.03710.33
5.1.10.0630.04010.10
5.1.00.0330.0509.98
5.0.50.0470.0378.55
5.0.40.0230.0338.35
5.0.30.0070.0508.17
5.0.20.0000.0338.29
5.0.10.0200.0178.16
5.0.00.0070.0408.26
4.4.90.0030.0235.83
4.4.80.0270.0235.78
4.4.70.0270.0235.76
4.4.60.0200.0275.90
4.4.50.0330.0235.95
4.4.40.0230.0375.87
4.4.30.0230.0275.90
4.4.20.0370.0105.92
4.4.10.0270.0205.83
4.4.00.0170.0405.82
4.3.110.0300.0235.80
4.3.100.0230.0235.88
4.3.90.0200.0235.77
4.3.80.0200.0375.75
4.3.70.0200.0175.78
4.3.60.0230.0275.77
4.3.50.0200.0205.73
4.3.40.0200.0375.71
4.3.30.0100.0234.49
4.3.20.0100.0234.44
4.3.10.0170.0174.43
4.3.00.0070.0238.54

preferences:
62.01 ms | 401 KiB | 5 Q