3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); ini_set('display_errors', true); ini_set('html_errors', false); $cats = array( (object) array("term_id"=>"","name"=>"Film : FIILMTOFTWFUT : post-COLON2","slug" => "alphabetical-k-l-m-n-o ","term_group"=>5,"term_taxonomy_id"=>9,"taxonomy"=>"Myanmar","description"=>"69509","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=> "Country: Cambodia ","slug"=>"Media Relations","term_group"=>5,"term_taxonomy_id"=>7,"taxonomy"=>"Belgium","description"=>"14234","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Advertising","slug"=>"Quality Assurance","term_group"=>5,"term_taxonomy_id"=>1,"taxonomy"=>"Norfolk Island","description"=>"93236","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Finances","slug"=>"Legal Department","term_group"=>5,"term_taxonomy_id"=>5,"taxonomy"=>"Honduras","description"=>"74759","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Legal Department","slug"=>"Media Relations","term_group"=>1,"term_taxonomy_id"=>9,"taxonomy"=>"Namibia","description"=>"69625","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Sales and Marketing","slug"=>"Advertising","term_group"=>2,"term_taxonomy_id"=>4,"taxonomy"=>"Syria","description"=>"56469","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Finances","slug"=>"Media Relations","term_group"=>5,"term_taxonomy_id"=>8,"taxonomy"=>"Ethiopia","description"=>"74909","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Media Relations","slug"=>"Asset Management","term_group"=>5,"term_taxonomy_id"=>9,"taxonomy"=>"Indonesia","description"=>"17623","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Finances","slug"=>"Customer Relations","term_group"=>2,"term_taxonomy_id"=>3,"taxonomy"=>"Zimbabwe","description"=>"83249","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Sales and Marketing","slug" => "alphabetical-k-l-m-n-o ","term_group"=>1,"term_taxonomy_id"=>10,"taxonomy"=>"Faroe Islands","description"=>"03778","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Sales and Marketing","slug"=>"Sales and Marketing","term_group"=>7,"term_taxonomy_id"=>3,"taxonomy"=>"Latvia","description"=>"68525","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Accounting","slug"=>"Research and Development","term_group"=>9,"term_taxonomy_id"=>7,"taxonomy"=>"Bouvet Island","description"=>"18959","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Asset Management","slug"=>"Advertising","term_group"=>1,"term_taxonomy_id"=>9,"taxonomy"=>"Tajikistan","description"=>"94796","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Tech Support : arstatf","slug"=>"Accounting","term_group"=>5,"term_taxonomy_id"=>7,"taxonomy"=>"Côte D'Ivoire (Ivory Coast)","description"=>"24209","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Film : FIILMTOFTWFUT : post-COLON2","slug"=>"Human Resources","term_group"=>9,"term_taxonomy_id"=>3,"taxonomy"=>"Ukraine","description"=>"77647","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Media Relations","slug"=>"Customer Service","term_group"=>6,"term_taxonomy_id"=>7,"taxonomy"=>"Maldives","description"=>"97264","parent"=>"","count"=>"1") ); //list($k, $v) = //print_r(explode(' ',$cat->name,2)); //$result[$k]=$v; // $result[] = array_map(function($v){ // return explode(" ", $v); // }, $cat); function getStuff($o) { //$z= get_object_vars($o); //print $o->name; $o = (array)$o; list($o['name']) = explode(' ',$o['name'],2); // print "{$o['name']} \n"; return $o=(object)$o; // print "{$o->name} \n"; //print $o=>name; //return $z; // explode(' ',$o->name,2)[0]//]= explode('',$o->name,2)[1]; // $o = (object) array_merge( (array)$o, array( explode(' ',$o->name,2)[0] => '1234' ) ); ; } $a=array_map('getStuff', $cats); print_r($a) /* $newArr = array(); foreach($cats as $cat){ $newArr[$cat->name][] = (array)$cat; } var_dump($newArr);*/ ?>

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.00318.35
8.3.50.0120.00722.00
8.3.40.0110.00418.93
8.3.30.0140.00719.04
8.3.20.0000.00820.71
8.3.10.0040.00421.90
8.3.00.0080.00019.05
8.2.180.0110.01118.43
8.2.170.0130.00322.96
8.2.160.0070.01420.57
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0050.00222.26
8.2.110.0030.00620.39
8.2.100.0080.00418.22
8.2.90.0000.00819.22
8.2.80.0000.00817.97
8.2.70.0080.00017.63
8.2.60.0000.01118.05
8.2.50.0080.00018.07
8.2.40.0070.00418.22
8.2.30.0000.00818.06
8.2.20.0040.00417.89
8.2.10.0000.00818.12
8.2.00.0040.00418.11
8.1.280.0090.01225.92
8.1.270.0040.00420.24
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00622.05
8.1.230.0100.00019.01
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0100.00317.23
8.1.190.0050.00317.25
8.1.180.0050.00318.10
8.1.170.0050.00318.57
8.1.160.0000.00822.05
8.1.150.0040.00418.84
8.1.140.0000.00717.48
8.1.130.0000.00717.78
8.1.120.0070.00317.48
8.1.110.0000.00717.53
8.1.100.0000.00717.47
8.1.90.0080.00017.50
8.1.80.0030.00517.48
8.1.70.0030.00617.51
8.1.60.0030.00617.61
8.1.50.0000.00817.61
8.1.40.0040.00417.46
8.1.30.0000.00917.73
8.1.20.0030.00617.63
8.1.10.0040.00417.54
8.1.00.0000.00917.44
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0000.00718.46
8.0.270.0000.00717.29
8.0.260.0060.00017.31
8.0.250.0070.00017.09
8.0.240.0070.00016.95
8.0.230.0000.00717.05
8.0.220.0000.00716.93
8.0.210.0070.00016.93
8.0.200.0040.00417.07
8.0.190.0040.00417.02
8.0.180.0020.00517.02
8.0.170.0040.00417.02
8.0.160.0000.00716.88
8.0.150.0030.00616.84
8.0.140.0080.00016.83
8.0.130.0050.00313.39
8.0.120.0000.00816.93
8.0.110.0000.00716.95
8.0.100.0030.00516.77
8.0.90.0050.00217.03
8.0.80.0090.00916.93
8.0.70.0000.00716.94
8.0.60.0000.00717.05
8.0.50.0050.00217.04
8.0.30.0120.00617.05
8.0.20.0090.00917.40
8.0.10.0050.00316.98
8.0.00.0080.01116.90
7.4.330.0000.00615.20
7.4.320.0000.00616.54
7.4.300.0030.00616.64
7.4.290.0060.00616.45
7.4.280.0000.00816.66
7.4.270.0070.00016.53
7.4.260.0070.00016.48
7.4.250.0030.00516.51
7.4.240.0070.00016.55
7.4.230.0080.00016.74
7.4.220.0060.01216.60
7.4.210.0050.01316.73
7.4.200.0070.00016.56
7.4.160.0090.00616.53
7.4.150.0090.01517.40
7.4.140.0170.00617.86
7.4.130.0140.00816.40
7.4.120.0100.00716.62
7.4.110.0000.01716.50
7.4.100.0100.01016.58
7.4.90.0080.00816.48
7.4.80.0060.01619.39
7.4.70.0060.01316.53
7.4.60.0120.00916.69
7.4.50.0000.00516.48
7.4.40.0000.01716.39
7.4.30.0100.02116.39
7.4.00.0080.00715.07
7.3.330.0050.00013.25
7.3.320.0030.00313.46
7.3.310.0070.00016.46
7.3.300.0030.00316.33
7.3.290.0000.00716.32
7.3.280.0070.01116.49
7.3.270.0100.00717.40
7.3.260.0140.00316.76
7.3.250.0120.00716.40
7.3.240.0130.00316.43
7.3.230.0030.01416.40
7.3.210.0130.00316.42
7.3.200.0090.00919.39
7.3.190.0090.00916.48
7.3.180.0070.01116.41
7.3.170.0100.01016.57
7.3.160.0090.00616.45
7.3.120.0130.00614.95
7.3.110.0120.00514.89
7.3.100.0070.00714.77
7.3.90.0030.01414.63
7.3.80.0080.00614.83
7.3.70.0070.00715.02
7.3.60.0030.01014.79
7.3.50.0030.01014.80
7.3.40.0070.01114.82
7.3.30.0030.00614.80
7.3.20.0060.00916.82
7.3.10.0050.00516.79
7.3.00.0030.00916.74
7.2.330.0040.01216.59
7.2.320.0070.01016.91
7.2.310.0030.01316.87
7.2.300.0060.01116.41
7.2.290.0120.00916.84
7.2.250.0160.00315.36
7.2.240.0110.01015.03
7.2.230.0000.01914.74
7.2.220.0030.01015.11
7.2.210.0040.01015.38
7.2.200.0000.00915.14
7.2.190.0070.00715.09
7.2.180.0110.00315.20
7.2.170.0050.00514.78
7.2.60.0100.00516.75
7.2.50.0100.00317.13
7.2.00.0030.00919.49
7.1.330.0030.01015.81
7.1.320.0030.01315.95
7.1.310.0120.00315.83
7.1.300.0040.00715.88
7.1.290.0030.01015.67
7.1.280.0000.01615.75
7.1.270.0030.00916.02
7.1.260.0000.01115.91
7.1.200.0030.01015.88
7.1.100.0100.00018.29
7.1.70.0000.00717.29
7.1.60.0100.02019.48
7.1.50.0040.00717.14
7.1.00.0100.07022.29
7.0.200.0030.00716.89
7.0.60.0170.07319.99
7.0.50.0100.03717.89
7.0.40.0170.08020.24
7.0.30.0500.07320.08
7.0.20.0170.04320.30
7.0.10.0030.04320.34
7.0.00.0070.08320.10
5.6.280.0070.07020.95
5.6.210.0230.06320.73
5.6.200.0030.08018.32
5.6.190.0130.08320.68
5.6.180.0200.04720.64
5.6.170.0300.07320.55
5.6.160.0070.09020.44
5.6.150.0070.08718.23
5.6.140.0000.04718.18
5.6.130.0100.04318.20
5.6.120.0130.07021.05
5.6.110.0130.08721.02
5.6.100.0170.04320.93
5.6.90.0230.07320.99
5.6.80.0200.06020.58
5.5.350.0100.07720.45
5.5.340.0030.06018.08
5.5.330.0100.06320.30
5.5.320.0270.04020.34
5.5.310.0230.04320.24
5.5.300.0170.03717.98
5.5.290.0030.07017.93
5.5.280.0130.06020.84
5.5.270.0100.03720.89
5.5.260.0130.08020.88
5.5.250.0130.08320.63
5.5.240.0130.07020.11
5.4.450.0100.04019.17
5.4.440.0730.05019.61
5.4.430.0230.05019.55
5.4.420.0300.05019.38
5.4.410.0230.04719.40
5.4.400.0130.05719.14
5.4.390.0200.04719.02
5.4.380.0070.06719.22
5.4.370.0100.06019.15
5.4.360.0070.06019.13
5.4.350.0170.05319.18
5.4.340.0200.05018.98
5.4.320.0200.05319.03
5.4.310.0270.04719.17
5.4.300.0300.04719.18
5.4.290.0270.04319.04
5.4.280.0200.05019.07
5.4.270.0170.05319.09
5.4.260.0170.05319.07
5.4.250.0230.05019.03
5.4.240.0300.04319.02
5.4.230.0230.04719.14
5.4.220.0270.04719.07
5.4.210.0170.05319.07
5.4.200.0170.05016.96
5.4.190.0230.04719.14
5.4.180.0100.06019.16
5.4.170.0230.05019.00
5.4.160.0170.05019.04
5.4.150.0130.05719.09
5.4.140.0270.06716.41
5.4.130.0170.05016.71
5.4.120.0170.05716.68
5.4.110.0130.05316.52
5.4.100.0230.04316.36
5.4.90.0130.05316.48
5.4.80.0130.05316.68
5.4.70.0030.06716.39
5.4.60.0200.04716.61
5.4.50.0130.04716.49
5.4.40.0270.04016.49
5.4.30.0200.06716.36
5.4.20.0000.06716.33
5.4.10.0170.05016.60
5.4.00.0200.04315.93
5.3.290.0130.05714.90
5.3.280.0170.05314.81
5.3.270.0200.04714.66
5.3.260.0170.05314.71
5.3.250.0170.05314.80
5.3.240.0230.04714.59
5.3.230.0130.06014.82
5.3.220.0270.04314.81
5.3.210.0130.05714.65
5.3.200.0170.07014.56
5.3.190.0200.04314.61
5.3.180.0130.05314.57
5.3.170.0130.05314.80
5.3.160.0130.07014.70
5.3.150.0200.05014.49
5.3.140.0270.05314.59
5.3.130.0270.06014.55
5.3.120.0230.04714.61
5.3.110.0170.05314.54
5.3.100.0230.04714.08
5.3.90.0170.04714.25
5.3.80.0100.05013.95
5.3.70.0170.05014.01
5.3.60.0200.04314.04
5.3.50.0200.04713.94
5.3.40.0070.06013.98
5.3.30.0200.04713.99
5.3.20.0200.05013.84
5.3.10.0130.05013.88
5.3.00.0230.04713.74
5.2.170.0130.03711.29
5.2.160.0130.04711.39
5.2.150.0130.05311.09
5.2.140.0170.03311.14
5.2.130.0170.03711.09
5.2.120.0170.03711.05
5.2.110.0130.04011.09
5.2.100.0070.04711.17
5.2.90.0070.05311.26
5.2.80.0100.04711.25
5.2.70.0170.04011.09
5.2.60.0130.04311.03
5.2.50.0030.07011.05
5.2.40.0170.03711.04
5.2.30.0200.03311.23
5.2.20.0130.04011.04
5.2.10.0100.04310.93
5.2.00.0070.04010.70
5.1.60.0030.03710.01
5.1.50.0130.04010.08
5.1.40.0170.03010.20
5.1.30.0170.03010.32
5.1.20.0130.03310.41
5.1.10.0130.03310.21
5.1.00.0070.04010.05
5.0.50.0070.0308.57
5.0.40.0100.0308.42
5.0.30.0170.0608.31
5.0.20.0130.0278.28
5.0.10.0030.0378.28
5.0.00.0100.0508.16
4.4.90.0070.0236.00
4.4.80.0200.0135.93
4.4.70.0100.0235.86
4.4.60.0100.0235.96
4.4.50.0030.0275.85
4.4.40.0070.0405.98
4.4.30.0170.0135.95
4.4.20.0130.0275.89
4.4.10.0130.0175.91
4.4.00.0130.0405.86
4.3.110.0070.0275.95
4.3.100.0070.0235.94
4.3.90.0070.0205.90
4.3.80.0000.0375.82
4.3.70.0100.0205.90
4.3.60.0130.0175.82
4.3.50.0170.0175.87
4.3.40.0030.0435.83
4.3.30.0070.0234.71
4.3.20.0100.0234.53
4.3.10.0030.0274.54
4.3.00.0100.02715.73

preferences:
59.65 ms | 401 KiB | 5 Q