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 = ""; if (count($localHeader) !== 0) { $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.0150.00618.43
8.3.50.0110.00821.26
8.3.40.0100.01018.83
8.3.30.0080.00619.21
8.3.20.0040.00420.16
8.3.10.0000.00723.48
8.3.00.0070.00023.70
8.2.180.0100.01017.00
8.2.170.0130.00722.96
8.2.160.0100.01022.19
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00417.75
8.2.110.0030.00721.04
8.2.100.0060.00617.75
8.2.90.0030.00519.21
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0000.00818.03
8.2.50.0000.00918.07
8.2.40.0040.00421.19
8.2.30.0090.00020.02
8.2.20.0040.00417.76
8.2.10.0000.00818.10
8.2.00.0060.00318.19
8.1.280.0140.00325.92
8.1.270.0080.00023.99
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0000.00922.18
8.1.230.0000.01217.79
8.1.220.0030.00517.74
8.1.210.0040.00418.77
8.1.200.0040.00717.35
8.1.190.0050.00317.13
8.1.180.0000.00818.10
8.1.170.0000.00818.63
8.1.160.0000.00721.93
8.1.150.0040.00418.91
8.1.140.0000.00717.46
8.1.130.0000.00717.72
8.1.120.0000.00717.37
8.1.110.0040.00417.48
8.1.100.0040.00417.50
8.1.90.0040.00417.50
8.1.80.0040.00417.46
8.1.70.0040.00417.35
8.1.60.0000.00917.59
8.1.50.0000.00817.54
8.1.40.0040.00417.44
8.1.30.0060.00317.45
8.1.20.0000.00817.63
8.1.10.0040.00417.46
8.1.00.0030.00617.53
8.0.300.0050.00218.77
8.0.290.0040.00416.75
8.0.280.0040.00418.33
8.0.270.0000.00717.19
8.0.260.0000.00617.14
8.0.250.0020.00516.92
8.0.240.0030.00317.05
8.0.230.0050.00316.93
8.0.220.0030.00316.95
8.0.210.0080.00016.99
8.0.200.0000.00716.96
8.0.190.0040.00417.07
8.0.180.0030.00316.97
8.0.170.0050.00317.01
8.0.160.0040.00416.97
8.0.150.0050.00316.82
8.0.140.0040.00416.95
8.0.130.0070.00013.48
8.0.120.0040.00416.84
8.0.110.0040.00416.87
8.0.100.0000.00817.00
8.0.90.0000.00716.86
8.0.80.0070.01317.03
8.0.70.0000.00817.03
8.0.60.0030.00517.03
8.0.50.0000.00716.80
8.0.30.0090.00917.09
8.0.20.0130.01017.40
8.0.10.0000.00817.20
8.0.00.0100.00816.66
7.4.330.0020.00215.11
7.4.320.0030.00316.61
7.4.300.0000.00616.47
7.4.290.0050.00216.57
7.4.280.0040.00416.61
7.4.270.0030.00316.66
7.4.260.0000.00816.45
7.4.250.0040.00416.63
7.4.240.0000.00716.45
7.4.230.0000.00716.31
7.4.220.0070.01316.54
7.4.210.0060.00816.57
7.4.200.0000.00716.50
7.4.160.0100.00616.54
7.4.150.0110.00817.40
7.4.140.0090.01017.86
7.4.130.0060.01116.58
7.4.120.0100.00716.54
7.4.110.0090.00916.49
7.4.100.0090.01216.54
7.4.90.0100.00716.52
7.4.80.0150.00919.39
7.4.70.0060.01016.73
7.4.60.0100.00616.55
7.4.50.0030.00316.16
7.4.40.0090.00816.64
7.4.30.0060.01816.50
7.4.00.0060.00915.14
7.3.330.0020.00213.45
7.3.320.0000.00513.47
7.3.310.0030.00316.45
7.3.300.0070.00016.30
7.3.290.0000.00616.30
7.3.280.0100.01216.45
7.3.270.0140.00317.40
7.3.260.0130.01316.55
7.3.250.0150.00416.53
7.3.240.0150.00916.42
7.3.230.0160.00716.43
7.3.210.0080.01616.41
7.3.200.0150.00716.55
7.3.190.0080.00716.52
7.3.180.0150.00416.54
7.3.170.0150.00416.41
7.3.160.0080.01216.54
7.2.330.0140.00416.84
7.2.320.0060.01316.55
7.2.310.0090.00616.79
7.2.300.0080.00816.83
7.2.290.0030.01716.79
7.2.60.0000.01116.97
7.2.00.0060.00919.61
7.1.200.0070.00715.82
7.1.100.0050.00517.97
7.1.70.0060.00617.35
7.1.60.0090.01619.42
7.1.50.0090.01217.08
7.1.00.0070.07322.46
7.0.200.0080.00416.63
7.0.110.0100.03320.06
7.0.100.0070.05020.08
7.0.90.0400.03019.92
7.0.80.0070.03719.98
7.0.70.0030.06019.91
7.0.60.0030.04319.92
7.0.50.0070.08720.00
7.0.40.0070.04019.68
7.0.30.0100.03719.73
7.0.20.0030.04319.69
7.0.10.0100.04019.81
7.0.00.0030.04319.82
5.6.280.0070.04321.16
5.6.260.0100.03320.55
5.6.250.0030.04020.63
5.6.240.0070.03720.68
5.6.230.0170.05020.66
5.6.220.0030.06020.56
5.6.210.0000.05020.57
5.6.200.0030.05720.51
5.6.190.0000.04720.65
5.6.180.0100.03720.66
5.6.170.0030.04020.61
5.6.160.0070.03720.49
5.6.150.0100.08020.57
5.6.140.0030.04720.61
5.6.130.0130.05320.47
5.6.120.0000.04720.63
5.6.110.0000.07320.57
5.6.100.0030.07020.79
5.6.90.0200.06720.54
5.6.80.0100.04319.89
5.6.70.0130.03719.91
5.6.60.0070.04319.94
5.6.50.0030.04019.96
5.6.40.0100.03320.01
5.6.30.0100.06319.96
5.6.20.0070.07319.91
5.6.10.0130.04319.79
5.6.00.0170.03719.95
5.5.380.0100.03017.48
5.5.370.0130.07717.52
5.5.360.0100.03017.68
5.5.350.0000.04317.27
5.5.340.0130.03318.10
5.5.330.0030.04018.05
5.5.320.0070.03717.92
5.5.310.0030.07317.93
5.5.300.0030.08018.09
5.5.290.0130.03718.09
5.5.280.0030.04717.83
5.5.270.0030.04018.13
5.5.260.0070.05718.22
5.5.250.0000.05317.94
5.5.240.0030.03717.51
5.5.230.0030.03717.46
5.5.220.0030.04017.61
5.5.210.0030.04017.43
5.5.200.0070.04017.24
5.5.190.0100.03317.55
5.5.180.0100.03017.48
5.5.160.0030.04017.48
5.5.150.0030.03717.61
5.5.140.0000.04017.48
5.5.130.0070.03717.18
5.5.120.0030.03717.44
5.5.110.0070.03317.43
5.5.100.0100.04717.17
5.5.90.0030.04017.20
5.5.80.0100.05017.34
5.5.70.0130.03317.37
5.5.60.0030.04317.34
5.5.50.0030.03717.16
5.5.40.0070.03017.07
5.5.30.0100.05717.07
5.5.20.0000.05017.46
5.5.10.0100.08317.33
5.5.00.0030.04017.18
5.4.450.0030.04019.43
5.4.440.0000.04019.33
5.4.430.0100.03319.32
5.4.420.0000.06719.20
5.4.410.0030.03719.12
5.4.400.0100.04719.14
5.4.390.0070.03319.10
5.4.380.0000.08019.01
5.4.370.0070.03719.00
5.4.360.0030.05319.13
5.4.350.0070.03719.28
5.4.340.0070.05318.91
5.4.320.0070.03319.12
5.4.310.0070.04019.07
5.4.300.0030.03718.95
5.4.290.0070.04719.10
5.4.280.0000.04318.87
5.4.270.0000.03718.88
5.4.260.0070.03319.05
5.4.250.0000.07018.91
5.4.240.0000.05018.92
5.4.230.0000.04018.96
5.4.220.0070.03318.93
5.4.210.0030.03718.93
5.4.200.0030.03718.95
5.4.190.0070.07019.04
5.4.180.0030.04018.87
5.4.170.0100.08019.11
5.4.160.0030.03718.90
5.4.150.0030.06019.13
5.4.140.0100.04016.45
5.4.130.0100.05016.53
5.4.120.0000.03716.41
5.4.110.0100.03016.36
5.4.100.0170.06716.32
5.4.90.0030.04016.22
5.4.80.0070.04016.21
5.4.70.0100.02716.55
5.4.60.0000.05016.44
5.4.50.0000.03716.53
5.4.40.0000.04716.55
5.4.30.0070.04316.28
5.4.20.0000.03716.50
5.4.10.0030.03716.54
5.4.00.0070.05315.77
5.3.290.0030.06314.82
5.3.280.0000.04714.61
5.3.270.0030.03714.70
5.3.260.0030.08014.74
5.3.250.0030.06014.73
5.3.240.0030.06314.84
5.3.230.0030.04014.61
5.3.220.0030.03714.71
5.3.210.0030.06314.57
5.3.200.0000.04714.53
5.3.190.0100.05014.70
5.3.180.0000.04014.58
5.3.170.0070.05714.57
5.3.160.0000.04014.66
5.3.150.0070.03314.42
5.3.140.0000.04014.58
5.3.130.0030.04014.51
5.3.120.0030.04014.57
5.3.110.0030.07714.63
5.3.100.0000.03714.05
5.3.90.0070.03714.15
5.3.80.0100.03014.04
5.3.70.0030.03714.00
5.3.60.0100.03314.09
5.3.50.0030.03714.08
5.3.40.0030.07013.97
5.3.30.0100.02713.88
5.3.20.0030.03713.92
5.3.10.0100.05713.69
5.3.00.0070.08013.62
5.2.170.0000.04011.14
5.2.160.0000.03011.16
5.2.150.0000.03011.14
5.2.140.0070.03011.21
5.2.130.0000.03311.25
5.2.120.0000.04011.11
5.2.110.0000.04011.13
5.2.100.0000.04311.25
5.2.90.0000.03011.07
5.2.80.0030.04311.07
5.2.70.0030.05011.07
5.2.60.0000.03011.07
5.2.50.0000.03311.16
5.2.40.0000.03011.00
5.2.30.0030.02711.00
5.2.20.0000.03311.04
5.2.10.0000.04710.95
5.2.00.0030.05310.95
5.1.60.0000.0279.83
5.1.50.0000.02310.16
5.1.40.0000.0279.99
5.1.30.0030.02710.46
5.1.20.0000.02710.38
5.1.10.0000.02710.07
5.1.00.0000.02710.06
5.0.50.0030.0409.50
5.0.40.0030.0179.50
5.0.30.0100.0579.50
5.0.20.0000.0309.50
5.0.10.0030.0179.50
5.0.00.0000.0379.50
4.4.90.0000.0209.50
4.4.80.0100.0079.50
4.4.70.0070.0109.50
4.4.60.0000.0179.50
4.4.50.0000.0179.50
4.4.40.0070.0239.50
4.4.30.0030.0309.50
4.4.20.0000.0179.50
4.4.10.0030.0139.50
4.4.00.0100.0479.50
4.3.110.0000.0179.50
4.3.100.0000.0139.50
4.3.90.0000.0279.50
4.3.80.0000.0509.50
4.3.70.0000.0139.50
4.3.60.0000.0209.50
4.3.50.0000.0179.50
4.3.40.0030.0309.50
4.3.30.0000.0139.50
4.3.20.0000.0179.50
4.3.10.0000.0139.51
4.3.00.0000.0309.52

preferences:
68.46 ms | 401 KiB | 5 Q