3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = array( 'gid'=>1, 'phone_number'=>1, 'weibo'=>1, 'qq'=>1, 'email'=>1, 'gender'=>1, 'age'=>1, 'area'=>1, 'computer'=>1, 'phone'=>1, 'valid_user'=>1, 'bank'=>json_encode(array(1,2,3)), 'tag_big'=>json_encode(array(1,2,3)), 'tag_medium'=>json_encode(array(1,2,3)), 'tag_small'=>json_encode(array(1,2,3)), 'family'=>json_encode(array(1,2,3)), 'friend'=>json_encode(array(1,2,3)), 'visitor'=>json_encode(array(1,2,3)) ); $field = array( 'gid', 'phone_number', 'weibo', 'qq', 'email', 'gender', 'age', 'area', 'computer', 'phone', 'valid_user', 'bank', 'tag_big', 'tag_medium', 'tag_small', 'family', 'friend', 'visitor' ); function constructPortrait($fields, $test){ $retPortraitArr = array(); $portraitArr = array($test); foreach($portraitArr as $key => $portrait){ foreach($fields as $field){ var_dump($fields, portrait);exit; $retPortraitArr[$key][$field] = isset($portrait[$key]) && !empty($portrait[$key]) ? $portrait[$key] : ''; } } return $retPortraitArr; } echo json_encode(constructPortrait($field, $test));

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.70.0110.00716.75
8.3.60.0100.00518.65
8.3.50.0160.00621.98
8.3.40.0090.00618.88
8.3.30.0140.00718.58
8.3.20.0080.00020.30
8.3.10.0000.00820.60
8.3.00.0080.00021.85
8.2.190.0060.00916.86
8.2.180.0110.00416.88
8.2.170.0090.00922.96
8.2.160.0070.00719.30
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00420.77
8.2.120.0040.00426.35
8.2.110.0040.00420.51
8.2.100.0030.00917.59
8.2.90.0050.00319.22
8.2.80.0000.00817.97
8.2.70.0030.00617.63
8.2.60.0050.00318.05
8.2.50.0060.00618.09
8.2.40.0060.00322.31
8.2.30.0040.00419.47
8.2.20.0040.00417.89
8.2.10.0020.00518.09
8.2.00.0000.00718.13
8.1.280.0070.00725.92
8.1.270.0090.00022.20
8.1.260.0030.00628.09
8.1.250.0080.00028.09
8.1.240.0000.00922.14
8.1.230.0030.00922.69
8.1.220.0040.00417.79
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0100.00019.26
8.1.180.0040.00418.10
8.1.170.0050.00318.49
8.1.160.0070.00020.75
8.1.150.0050.00318.82
8.1.140.0080.00019.60
8.1.130.0040.00417.77
8.1.120.0000.00817.47
8.1.110.0040.00417.48
8.1.100.0040.00417.46
8.1.90.0000.00717.38
8.1.80.0040.00417.38
8.1.70.0070.00017.53
8.1.60.0040.00417.49
8.1.50.0000.00817.52
8.1.40.0080.00017.43
8.1.30.0080.00017.73
8.1.20.0030.00517.50
8.1.10.0070.00017.63
8.1.00.0000.01117.38
8.0.300.0000.00718.77
8.0.290.0070.00016.75
8.0.280.0030.00318.57
8.0.270.0030.00317.15
8.0.260.0030.00317.32
8.0.250.0030.00317.07
8.0.240.0000.00716.91
8.0.230.0000.00716.90
8.0.220.0000.00716.87
8.0.210.0030.00316.95
8.0.200.0000.00716.91
8.0.190.0040.00417.10
8.0.180.0000.00717.01
8.0.170.0000.00716.88
8.0.160.0000.00717.01
8.0.150.0070.00016.84
8.0.140.0040.00416.96
8.0.130.0050.00013.39
8.0.120.0040.00416.95
8.0.110.0040.00416.95
8.0.100.0030.00516.91
8.0.90.0020.00516.85
8.0.80.0120.01217.00
8.0.70.0030.00517.06
8.0.60.0040.00416.85
8.0.50.0040.00416.99
8.0.30.0040.01417.10
8.0.20.0140.00617.40
8.0.10.0040.00416.92
8.0.00.0120.00816.86
7.4.330.0000.00516.70
7.4.320.0030.00316.63
7.4.300.0000.00616.42
7.4.290.0030.00316.63
7.4.280.0000.00716.53
7.4.270.0000.00616.66
7.4.260.0000.00816.50
7.4.250.0000.00716.38
7.4.240.0070.00016.49
7.4.230.0020.00516.71
7.4.220.0120.00916.49
7.4.210.0060.00916.49
7.4.200.0000.00816.64
7.4.160.0080.00816.38
7.4.150.0100.00917.40
7.4.140.0080.01117.86
7.4.130.0070.01116.66
7.4.120.0160.00516.66
7.4.110.0150.00316.51
7.4.100.0060.01216.59
7.4.90.0130.01216.68
7.4.80.0090.00919.39
7.4.70.0130.01216.53
7.4.60.0140.00716.59
7.4.50.0080.01116.42
7.4.40.0100.00716.53
7.4.30.0030.01516.60
7.4.00.0110.00714.66
7.3.330.0000.00513.37
7.3.320.0060.00013.34
7.3.310.0070.00016.36
7.3.300.0040.00416.33
7.3.290.0060.01216.35
7.3.280.0090.00816.34
7.3.270.0060.01517.40
7.3.260.0170.00716.41
7.3.250.0110.00816.45
7.3.240.0100.00816.63
7.3.230.0110.00716.43
7.3.210.0060.01316.52
7.3.200.0120.00616.34
7.3.190.0030.01516.48
7.3.180.0070.01016.35
7.3.170.0040.01216.63
7.3.160.0040.01416.34
7.2.330.0040.01616.88
7.2.320.0000.01716.91
7.2.310.0100.00616.81
7.2.300.0040.01316.49
7.2.290.0150.00416.77
7.2.60.0000.01417.00
7.2.00.0060.00619.53
7.1.200.0040.00415.41
7.1.100.0080.00818.02
7.1.70.0030.00716.95
7.1.60.0130.01319.19
7.1.50.0030.01017.03
7.1.00.0030.07722.54
7.0.200.0800.01314.79
7.0.90.0300.04719.94
7.0.80.0000.04319.91
7.0.70.0030.03719.96
7.0.60.0000.03720.07
7.0.50.0030.04320.40
7.0.40.0070.06320.03
7.0.30.0100.03720.08
7.0.20.0000.05020.02
7.0.10.0030.04720.14
7.0.00.0070.04020.11
5.6.280.0070.03021.12
5.6.240.0030.05320.68
5.6.230.0030.03720.60
5.6.220.0070.03720.52
5.6.210.0070.03020.75
5.6.200.0000.03721.13
5.6.190.0070.04721.11
5.6.180.0070.04020.95
5.6.170.0030.04321.06
5.6.160.0030.04321.18
5.6.150.0030.04321.07
5.6.140.0070.03721.09
5.6.130.0000.04321.08
5.6.120.0030.04021.05
5.6.110.0000.04321.11
5.6.100.0130.03321.13
5.6.90.0070.04021.01
5.6.80.0030.04020.32
5.6.70.0030.04020.52
5.6.60.0070.03720.46
5.6.50.0170.03020.41
5.6.40.0030.04020.32
5.6.30.0070.05320.45
5.6.20.0070.03720.45
5.6.10.0100.06020.25
5.6.00.0070.07720.37
5.5.380.0100.03720.55
5.5.370.0070.03720.43
5.5.360.0100.04020.36
5.5.350.0070.03020.35
5.5.340.0070.03720.95
5.5.330.0100.03720.85
5.5.320.0070.03720.88
5.5.310.0070.03720.86
5.5.300.0030.04020.88
5.5.290.0170.03020.89
5.5.280.0000.05720.84
5.5.270.0100.03720.76
5.5.260.0070.04320.78
5.5.250.0070.03720.74
5.5.240.0030.04320.08
5.5.230.0030.03320.16
5.5.220.0030.04020.22
5.5.210.0100.03020.29
5.5.200.0000.04320.28
5.5.190.0070.03020.29
5.5.180.0030.05020.13
5.5.160.0030.08320.00
5.5.150.0100.07720.27
5.5.140.0130.04020.25
5.5.130.0030.04720.12
5.5.120.0030.08720.27
5.5.110.0070.05320.12
5.5.100.0070.06720.06
5.5.90.0070.07720.06
5.5.80.0070.08320.11
5.5.70.0030.07720.10
5.5.60.0070.04720.10
5.5.50.0130.07020.17
5.5.40.0070.07720.07
5.5.30.0100.09320.06
5.5.20.0100.07720.11
5.5.10.0100.04720.01
5.5.00.0100.07720.04

preferences:
45.36 ms | 401 KiB | 5 Q