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.0130.00918.55
8.3.50.0100.00921.10
8.3.40.0080.00818.78
8.3.30.0070.00719.22
8.3.20.0050.00220.35
8.3.10.0000.00823.51
8.3.00.0040.00423.66
8.2.180.0070.01417.00
8.2.170.0130.00722.96
8.2.160.0110.01122.12
8.2.150.0050.00224.18
8.2.140.0050.00324.66
8.2.130.0000.00826.16
8.2.120.0040.00417.63
8.2.110.0070.00322.25
8.2.100.0090.00317.91
8.2.90.0000.00818.02
8.2.80.0060.00319.23
8.2.70.0000.00817.90
8.2.60.0030.00517.93
8.2.50.0060.00618.10
8.2.40.0060.00320.58
8.2.30.0000.00819.78
8.2.20.0050.00317.81
8.2.10.0040.00418.13
8.2.00.0080.00018.00
8.1.280.0070.00725.92
8.1.270.0040.00420.32
8.1.260.0000.00826.35
8.1.250.0000.00728.09
8.1.240.0090.00022.64
8.1.230.0110.00020.95
8.1.220.0080.00017.80
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0000.00817.54
8.1.180.0040.00418.10
8.1.170.0000.00918.50
8.1.160.0000.00722.06
8.1.150.0050.00318.81
8.1.140.0020.00517.47
8.1.130.0030.00317.72
8.1.120.0000.00817.39
8.1.110.0040.00417.47
8.1.100.0070.00017.49
8.1.90.0000.00717.38
8.1.80.0000.00717.50
8.1.70.0000.00717.35
8.1.60.0080.00017.48
8.1.50.0040.00417.52
8.1.40.0030.00617.51
8.1.30.0080.00017.52
8.1.20.0030.00517.57
8.1.10.0020.00517.63
8.1.00.0000.00817.47
8.0.300.0000.00720.08
8.0.290.0070.00016.63
8.0.280.0030.00318.50
8.0.270.0070.00017.25
8.0.260.0000.00617.18
8.0.250.0030.00517.06
8.0.240.0030.00317.00
8.0.230.0000.00717.07
8.0.220.0070.00016.92
8.0.210.0050.00317.01
8.0.200.0070.00017.02
8.0.190.0000.00817.02
8.0.180.0020.00516.97
8.0.170.0050.00216.88
8.0.160.0060.00317.05
8.0.150.0040.00417.00
8.0.140.0000.00716.83
8.0.130.0000.00813.38
8.0.120.0050.00316.82
8.0.110.0000.00816.89
8.0.100.0070.00016.95
8.0.90.0070.00017.01
8.0.80.0070.01116.89
8.0.70.0000.00716.87
8.0.60.0070.00016.93
8.0.50.0040.00416.84
8.0.30.0100.00717.16
8.0.20.0140.00417.40
8.0.10.0000.00817.02
8.0.00.0090.01116.76
7.4.330.0020.00215.12
7.4.320.0000.00616.66
7.4.300.0000.00616.51
7.4.290.0070.00016.54
7.4.280.0040.00416.46
7.4.270.0030.00316.54
7.4.260.0000.00716.54
7.4.250.0000.00716.48
7.4.240.0020.00616.61
7.4.230.0000.00716.64
7.4.220.0060.01216.59
7.4.210.0070.00916.56
7.4.200.0040.00416.64
7.4.160.0130.00316.50
7.4.150.0170.00317.40
7.4.140.0160.00917.86
7.4.130.0100.00716.59
7.4.120.0110.00816.46
7.4.110.0070.01116.56
7.4.100.0190.00316.52
7.4.90.0070.01016.50
7.4.80.0070.01019.39
7.4.70.0100.00916.45
7.4.60.0100.00616.41
7.4.50.0030.00516.53
7.4.40.0070.01016.48
7.4.30.0120.00916.83
7.4.00.0030.01415.18
7.3.330.0050.00013.31
7.3.320.0060.00013.41
7.3.310.0040.00316.25
7.3.300.0030.00316.36
7.3.290.0020.00516.25
7.3.280.0110.00816.45
7.3.270.0130.00317.40
7.3.260.0180.00616.45
7.3.250.0080.01016.52
7.3.240.0030.01316.51
7.3.230.0110.00516.55
7.3.210.0030.02016.56
7.3.200.0060.01216.62
7.3.190.0040.01216.38
7.3.180.0000.01616.39
7.3.170.0180.00016.54
7.3.160.0180.00316.55
7.3.120.0090.00914.84
7.3.110.0110.00714.94
7.3.100.0060.00914.85
7.3.90.0080.00614.86
7.3.80.0100.00715.01
7.3.70.0000.01415.05
7.3.60.0070.00714.92
7.3.50.0030.01314.97
7.3.40.0030.01414.96
7.3.30.0060.00914.76
7.3.20.0060.01216.75
7.3.10.0100.00316.47
7.3.00.0000.00916.71
7.2.330.0070.01016.70
7.2.320.0100.00716.55
7.2.310.0060.01216.81
7.2.300.0000.01916.38
7.2.290.0140.00716.74
7.2.240.0030.01515.04
7.2.230.0040.01115.03
7.2.220.0030.01415.10
7.2.210.0090.00315.29
7.2.200.0040.01115.07
7.2.190.0060.00615.15
7.2.180.0000.01315.20
7.2.170.0060.00315.04
7.2.160.0040.01115.23
7.2.150.0110.00716.76
7.2.140.0060.00917.11
7.2.130.0040.01117.13
7.2.120.0140.00416.99
7.2.110.0040.00816.88
7.2.100.0060.00917.04
7.2.90.0040.01116.98
7.2.80.0030.01317.19
7.2.70.0090.00916.97
7.2.60.0040.00816.92
7.2.50.0060.01016.97
7.2.40.0070.01016.90
7.2.30.0100.00717.05
7.2.20.0030.01216.78
7.2.10.0090.00916.94
7.2.00.0090.00318.15
7.1.330.0030.01415.53
7.1.320.0100.00315.61
7.1.310.0060.00315.86
7.1.300.0100.00616.02
7.1.290.0160.00015.77
7.1.280.0000.01715.51
7.1.270.0070.00715.72
7.1.260.0030.01015.53
7.1.250.0000.01415.53
7.1.200.0060.00615.77
7.1.100.0090.00918.00
7.1.70.0040.00717.34
7.1.60.0100.01419.42
7.1.50.0070.01716.93
7.1.00.0030.07722.45
7.0.200.0090.00316.88
7.0.60.0100.06719.95
7.0.50.0130.07317.90
7.0.40.0070.04720.08
7.0.30.0300.04320.32
7.0.20.0300.06320.09
7.0.10.0070.08320.22
7.0.00.0030.08720.33
5.6.280.0000.04720.92
5.6.210.0130.07020.71
5.6.200.0100.08318.20
5.6.190.0130.05320.39
5.6.180.0270.04320.34
5.6.170.0200.03720.71
5.6.160.0000.05720.39
5.6.150.0030.04018.23
5.6.140.0070.03718.12
5.6.130.0070.08318.24
5.6.120.0100.03720.88
5.6.110.0130.08020.99
5.6.100.0200.07321.00
5.6.90.0070.05020.89
5.6.80.0130.06320.42
5.5.350.0270.07720.34
5.5.340.0100.05317.96
5.5.330.0100.07320.39
5.5.320.0230.05020.24
5.5.310.0170.03720.42
5.5.300.0070.04317.98
5.5.290.0200.06717.95
5.5.280.0070.08021.00
5.5.270.0070.08720.68
5.5.260.0100.08020.69
5.5.250.0030.04020.70
5.5.240.0000.08320.20
5.4.450.0730.06319.46
5.4.440.0070.06719.62
5.4.430.0400.07019.52
5.4.420.0630.06019.32
5.4.410.0470.05019.48
5.4.400.0200.05019.29
5.4.390.0830.06019.26
5.4.380.0870.07318.98
5.4.370.0500.07718.87
5.4.360.0170.07019.15
5.4.350.0630.05719.25
5.4.340.0600.06019.38
5.4.320.0330.05318.98
5.4.310.0200.06718.84
5.4.300.0900.07019.00
5.4.290.0170.07319.38
5.4.280.0100.07718.84
5.4.270.0570.06319.01
5.4.260.0970.06019.13
5.4.250.1130.07019.15
5.4.240.0970.05718.85
5.4.230.0770.07719.37
5.4.220.0800.06719.30
5.4.210.0700.05719.08
5.4.200.0900.04716.70
5.4.190.1230.06019.13
5.4.180.1000.05718.93
5.4.170.0800.06019.02
5.4.160.0930.04719.18
5.4.150.0770.06018.88
5.4.140.0670.05716.42
5.4.130.0870.05316.52
5.4.120.0930.05316.47
5.4.110.0630.05716.52
5.4.100.0730.06016.57
5.4.90.0830.05316.55
5.4.80.0730.04716.55
5.4.70.0930.04016.49
5.4.60.1130.05716.42
5.4.50.0930.04716.36
5.4.40.0830.05316.53
5.4.30.0730.05716.53
5.4.20.0900.04716.69
5.4.10.0570.05716.50
5.4.00.0770.05016.00
5.3.290.0870.05714.53
5.3.280.0730.06014.52
5.3.270.0670.05314.62
5.3.260.0670.05714.61
5.3.250.0570.05714.62
5.3.240.0730.04714.60
5.3.230.0870.04014.63
5.3.220.0800.05714.43
5.3.210.1100.04314.62
5.3.200.0600.05714.71
5.3.190.0200.05014.47
5.3.180.0130.04714.58
5.3.170.0830.05314.57
5.3.160.0730.05714.46
5.3.150.0700.06714.79
5.3.140.0730.06314.48
5.3.130.1000.06714.51
5.3.120.0770.06714.52
5.3.110.0770.07014.70
5.3.100.0730.05014.01
5.3.90.0970.04714.07
5.3.80.0630.05714.03
5.3.70.0570.05714.07
5.3.60.0630.05313.89
5.3.50.0700.05714.01
5.3.40.1000.04713.85
5.3.30.0870.06013.93
5.3.20.0670.05313.61
5.3.10.0800.04013.80
5.3.00.0970.06713.69
5.2.170.0770.05711.02
5.2.160.0600.04311.02
5.2.150.0530.05311.05
5.2.140.0570.05311.16
5.2.130.0770.04311.17
5.2.120.0800.04311.17
5.2.110.0800.04011.12
5.2.100.0530.04711.01
5.2.90.0870.04311.16
5.2.80.0530.04710.96
5.2.70.0700.05011.11
5.2.60.0600.05311.11
5.2.50.0730.03710.93
5.2.40.0670.05011.22
5.2.30.0530.05010.89
5.2.20.0500.05710.97
5.2.10.0570.05010.79
5.2.00.0400.04010.77
5.1.60.0430.04310.03
5.1.50.0400.0409.99
5.1.40.0570.03710.07
5.1.30.0530.03710.33
5.1.20.0630.04010.27
5.1.10.0600.04310.13
5.1.00.0500.0409.98
5.0.50.0470.0278.49
5.0.40.0200.0338.33
5.0.30.0330.0438.29
5.0.20.0270.0278.20
5.0.10.0200.0278.12
5.0.00.0300.0538.41
4.4.90.0300.0275.83
4.4.80.0430.0205.95
4.4.70.0370.0335.86
4.4.60.0270.0275.86
4.4.50.0370.0275.87
4.4.40.0330.0405.79
4.4.30.0330.0275.95
4.4.20.0300.0305.91
4.4.10.0400.0335.93
4.4.00.0230.0375.93
4.3.110.0270.0205.73
4.3.100.0230.0275.80
4.3.90.0170.0305.77
4.3.80.0370.0435.81
4.3.70.0330.0275.70
4.3.60.0330.0305.78
4.3.50.0200.0205.70
4.3.40.0230.0405.73
4.3.30.0130.0234.50
4.3.20.0130.0234.52
4.3.10.0200.0234.50
4.3.00.0070.0238.54

preferences:
59.99 ms | 401 KiB | 5 Q