3v4l.org

run code in 300+ PHP versions simultaneously
<?php $variables = [ "own" => [ "type" => "bool", "value" => 0 ], "contr_name" => [ "type" => "bool", "value" => 0 ], "all_votes" => [ "type" => "int", "value" => 0 ], "contract_start" => [ "type" => "bool", "value" => 0 ], "contract_end" => [ "type" => "bool", "value" => 0 ], "T" => [ "type" => "clock", "value" => '' ], "a" => [ "type" => "int", "value" => 1 ], "candi_ID" => [ "type" => "int", "value" => 1 ], "voter_ID" => [ "type" => "int", "value" => 1 ], /* [] => [ "type" => '', "value" => '' ] */ ]; $variable = "own=1, contract_start=1"; function updateTheValue(&$variables,$variable) { // Split variable looking for into name and value $vars = explode(",", $variable); $match = false; foreach ($vars as $var){ $expbyequal = explode("=", $var); // If this key exists in main keys if ( in_array(trim($expbyequal[0]), array_keys($variables)) ) { // Compare value with stored value if ( $variables [trim($expbyequal[0])]['value'] == trim($expbyequal[1]) ) { $match = true; }else{ $variables[trim($expbyequal[0])]["value"] = trim($expbyequal[1]); $match = false; } } } return $match; } updateTheValue($variables,$variable); print_r($variables);

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.4.120.0130.00724.02
8.4.110.0130.00717.79
8.4.100.0110.01019.08
8.4.90.0110.00920.46
8.4.80.0120.00720.32
8.4.70.0130.00718.13
8.4.60.0060.00419.02
8.4.50.0100.01019.55
8.4.40.0120.00320.62
8.4.30.0070.01420.46
8.4.20.0100.01019.69
8.4.10.0060.00319.77
8.3.250.0100.00718.83
8.3.240.0110.00917.38
8.3.230.0130.00716.87
8.3.220.0110.00719.09
8.3.210.0070.00918.41
8.3.200.0030.00616.73
8.3.190.0090.00817.16
8.3.180.0140.00518.45
8.3.170.0090.00918.89
8.3.160.0070.00018.50
8.3.150.0100.01020.82
8.3.140.0060.01318.93
8.3.130.0000.00818.43
8.3.120.0090.00019.04
8.3.110.0060.00320.94
8.3.100.0060.00324.06
8.3.90.0030.00526.77
8.3.80.0060.00316.75
8.3.70.0140.00016.58
8.3.60.0110.00318.31
8.3.50.0100.00324.56
8.3.40.0060.00918.71
8.3.30.0110.00418.85
8.3.20.0050.00221.90
8.3.10.0040.00420.39
8.3.00.0040.00420.55
8.2.290.0060.00820.39
8.2.280.0160.00318.42
8.2.270.0060.01218.74
8.2.260.0070.00716.73
8.2.250.0120.00318.49
8.2.240.0030.00517.30
8.2.230.0040.00822.58
8.2.220.0030.00737.54
8.2.210.0070.00726.77
8.2.200.0060.00316.50
8.2.190.0140.00716.58
8.2.180.0060.01316.75
8.2.170.0070.00722.96
8.2.160.0110.00322.12
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.76
8.2.110.0060.00320.50
8.2.100.0040.00718.03
8.2.90.0040.00419.35
8.2.80.0040.00419.09
8.2.70.0060.00317.50
8.2.60.0040.00417.50
8.2.50.0060.00317.55
8.2.40.0080.00018.05
8.2.30.0080.00017.65
8.2.20.0040.00418.21
8.2.10.0040.00420.98
8.2.00.0000.00819.31
8.1.330.0110.00721.88
8.1.320.0120.00616.32
8.1.310.0110.00716.71
8.1.300.0060.00918.37
8.1.290.0060.00330.84
8.1.280.0150.00625.92
8.1.270.0080.00020.68
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0050.00323.87
8.1.230.0060.00619.61
8.1.220.0000.00917.77
8.1.210.0090.00918.77
8.1.200.0060.00317.35
8.1.190.0000.00817.35
8.1.180.0000.00918.10
8.1.170.0050.00318.75
8.1.160.0000.00718.84
8.1.150.0000.00718.93
8.1.140.0040.00422.22
8.1.130.0000.00720.16
8.1.120.0040.00417.47
8.1.110.0000.00717.47
8.1.100.0030.00517.56
8.1.90.0000.00717.48
8.1.80.0000.00817.35
8.1.70.0000.00717.39
8.1.60.0000.00817.49
8.1.50.0050.00317.50
8.1.40.0030.00517.39
8.1.30.0040.00417.70
8.1.20.0030.00617.73
8.1.10.0040.00417.61
8.1.00.0040.00417.60
8.0.300.0000.00918.77
8.0.290.0040.00416.60
8.0.280.0030.00318.52
8.0.270.0050.00318.04
8.0.260.0030.00320.11
8.0.250.0050.00517.01
8.0.240.0030.00316.88
8.0.230.0070.00016.89
8.0.220.0070.00016.91
8.0.210.0070.00016.81
8.0.200.0060.00016.97
8.0.190.0000.00716.98
8.0.180.0060.00316.82
8.0.170.0000.00916.85
8.0.160.0000.00716.81
8.0.150.0040.00416.94
8.0.140.0040.00416.84
8.0.130.0050.00313.32
8.0.120.0000.00716.76
8.0.110.0070.00016.86
8.0.100.0000.00716.82
8.0.90.0030.00616.91
8.0.80.0100.01016.83
8.0.70.0040.00417.01
8.0.60.0040.00416.75
8.0.50.0030.00316.73
8.0.30.0120.00617.32
8.0.20.0120.01217.23
8.0.10.0070.00016.93
8.0.00.0070.01416.71
7.4.330.0000.00515.55
7.4.320.0030.00316.52
7.4.300.0070.00016.58
7.4.290.0070.00016.62
7.4.280.0030.00516.52
7.4.270.0080.00016.64
7.4.260.0000.00613.41
7.4.250.0040.00416.61
7.4.240.0030.00316.67
7.4.230.0030.00316.55
7.4.220.0030.00316.44
7.4.210.0120.00316.56
7.4.200.0030.00316.43
7.4.130.0160.00016.54
7.4.120.0230.00016.57
7.4.110.0080.00916.61
7.4.100.0140.00316.53
7.4.90.0060.01116.30
7.4.80.0100.01619.39
7.4.70.0120.00616.61
7.4.60.0130.00616.40
7.4.50.0070.01116.41
7.4.40.0130.00316.74
7.4.00.0090.00714.91
7.3.330.0000.00816.32
7.3.320.0050.00013.32
7.3.310.0060.00316.33
7.3.300.0040.00416.24
7.3.290.0080.00616.39
7.3.280.0070.00716.39
7.3.260.0140.00416.35
7.3.240.0090.00816.55
7.3.230.0030.01416.35
7.3.210.0040.01216.64
7.3.200.0150.00616.61
7.3.190.0060.01216.54
7.3.180.0090.00916.37
7.3.170.0130.00316.50
7.3.160.0160.00016.54
7.3.120.0090.00514.86
7.3.110.0100.00314.79
7.3.100.0100.00314.54
7.3.90.0080.01214.90
7.3.80.0090.00614.80
7.3.70.0060.01014.88
7.3.60.0060.01314.84
7.3.50.0130.00514.52
7.3.40.0070.00714.86
7.3.30.0130.00714.81
7.3.20.0060.01014.61
7.3.10.0030.01014.67
7.3.00.0070.00714.63
7.2.330.0170.00316.62
7.2.320.0120.01216.53
7.2.310.0140.00316.73
7.2.300.0140.00716.50
7.2.290.0080.00916.65
7.2.250.0000.01715.18
7.2.240.0090.00614.86
7.2.230.0060.00915.00
7.2.220.0080.01015.12
7.2.210.0040.01214.64
7.2.200.0120.00615.02
7.2.190.0100.01015.07
7.2.180.0100.00515.16
7.2.170.0100.00615.09
7.1.330.0000.01514.06
7.1.320.0090.00613.95
7.1.310.0000.01314.22
7.1.300.0060.01213.75
7.1.290.0090.00613.87
7.1.280.0070.01113.78
7.1.270.0100.01213.88
7.1.260.0100.00314.15

preferences:
27.17 ms | 403 KiB | 5 Q