3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ 'a.b.c.d = 1', 'a.b.c.e = Joey', 'a.b.c.f = Smith', 'a.b.g.d = 2', 'a.b.g.e = Chris', 'a.b.g.f = Divner' ]; public static function mapProfilePrefix($data, $prefix = ''){ // define $temp $temp = array(); foreach($data as $key => $value){ // define $nextKey $nextKey = $prefix . (empty($prefix) ? '' : '.') . $key; if(is_array($value)){ $temp = $temp + mapProfilePrefix($value, $nextKey); } else { $temp[$nextKey] = $value; } } return $temp; } echo mapProfilePrefix($input);

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)
5.4.390.0230.04718.49
5.4.380.0200.05018.84
5.4.370.0170.05718.72
5.4.360.0170.05018.78
5.4.350.0170.05718.81
5.4.340.0200.05718.71
5.4.320.0170.06018.61
5.4.310.0230.06718.62
5.4.300.0270.06718.42
5.4.290.0100.08018.78
5.4.280.0230.05718.71
5.4.270.0130.06318.55
5.4.260.0270.04318.54
5.4.250.0230.06018.68
5.4.240.0170.06318.64
5.4.230.0170.05318.71
5.4.220.0130.06018.75
5.4.210.0200.05018.61
5.4.200.0230.04316.56
5.4.190.0230.04718.54
5.4.180.0200.05718.71
5.4.170.0200.05318.80
5.4.160.0170.07318.67
5.4.150.0300.06018.64
5.4.140.0200.06716.16
5.4.130.0270.06016.42
5.4.120.0170.05716.21
5.4.110.0170.05716.34
5.4.100.0170.05316.30
5.4.90.0030.06716.27
5.4.80.0170.07016.30
5.4.70.0100.05716.39
5.4.60.0100.05316.21
5.4.50.0230.04316.29
5.4.40.0130.05716.18
5.4.30.0170.06716.14
5.4.20.0300.05716.23
5.4.10.0230.06016.38
5.4.00.0200.06315.70
5.3.290.0300.06314.62
5.3.280.0270.04314.60
5.3.270.0200.05014.68
5.3.260.0230.07014.70
5.3.250.0170.07314.57
5.3.240.0130.05714.70
5.3.230.0230.04714.70
5.3.220.0200.04714.46
5.3.210.0130.05314.57
5.3.200.0130.05314.50
5.3.190.0170.05314.67
5.3.180.0200.04714.54
5.3.170.0200.04714.47
5.3.160.0170.05314.53
5.3.150.0200.07314.48
5.3.140.0100.08014.48
5.3.130.0100.08014.49
5.3.120.0230.06714.51
5.3.110.0200.07014.54
5.3.100.0130.07313.97
5.3.90.0300.05714.00
5.3.80.0130.06314.11
5.3.70.0200.04713.98
5.3.60.0130.05313.94
5.3.50.0230.05013.92
5.3.40.0300.04313.93
5.3.30.0200.06313.94
5.3.20.0200.06313.68
5.3.10.0230.06013.64
5.3.00.0170.06713.71
5.2.170.0270.04711.11
5.2.160.0170.05311.22
5.2.150.0000.05311.15
5.2.140.0030.07011.09
5.2.130.0130.05711.10
5.2.120.0130.04311.06
5.2.110.0300.04011.07
5.2.100.0030.04711.05
5.2.90.0170.05311.14
5.2.80.0100.04711.13
5.2.70.0170.05311.13
5.2.60.0200.05311.20
5.2.50.0170.04310.98
5.2.40.0070.04711.03
5.2.30.0130.05711.02
5.2.20.0100.05311.02
5.2.10.0100.04711.01
5.2.00.0170.03310.70
5.1.60.0200.03010.10
5.1.50.0130.03310.11
5.1.40.0130.03310.01
5.1.30.0170.03710.29
5.1.20.0130.03710.41
5.1.10.0130.03310.05
5.1.00.0070.04010.04
5.0.50.0100.0308.64
5.0.40.0100.0278.39
5.0.30.0070.0478.29
5.0.20.0030.0308.23
5.0.10.0030.0338.21
5.0.00.0100.0608.19
4.4.90.0070.0235.88
4.4.80.0100.0235.90
4.4.70.0030.0335.81
4.4.60.0030.0335.86
4.4.50.0100.0205.89
4.4.40.0030.0435.86
4.4.30.0070.0275.84
4.4.20.0030.0275.91
4.4.10.0030.0275.98
4.4.00.0130.0305.92
4.3.110.0000.0275.80
4.3.100.0000.0275.79
4.3.90.0070.0305.78
4.3.80.0070.0435.81
4.3.70.0070.0275.91
4.3.60.0070.0205.78
4.3.50.0000.0275.82
4.3.40.0030.0375.75
4.3.30.0070.0204.56
4.3.20.0030.0234.52
4.3.10.0070.0234.51
4.3.00.0070.0176.66

preferences:
145.8 ms | 1394 KiB | 7 Q