3v4l.org

run code in 500+ PHP versions simultaneously
<?php // key which will sign the data $key = hash('sha256', 'Unique user data or Some secret'); // the data $array = [ 'foobar' => 'baz' ]; // encode the payload $json = json_encode($array); // sign it with key $token = hash_hmac('sha256', $json, $key); // set response header //header('X-Checksum: '.$token); //echo $json; ## This is how the receiver would verify the received data. // faked: this would be populated by the request/response $_POST['json'] = $json; $_SERVER['X-Checksum'] = $token; // verify the data matches token by signing the data with the key $check = hash_hmac('sha256', $_POST['json'], $key); if (hash_equals($token, $check)) { echo 'Verified'; } else { echo 'Tampered'; } // example tampered data $_POST['json'] = 'tampered'.$json; $check = hash_hmac('sha256', $_POST['json'], $key); if (hash_equals($token, $check)) { echo 'Verified'; } else { echo 'Tampered'; }

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.5.30.0120.00520.84
8.5.20.0120.00519.24
8.5.10.0130.00716.98
8.5.00.0120.01020.03
8.4.180.0130.00921.95
8.4.170.0110.01024.00
8.4.160.0130.01023.91
8.4.150.0090.00316.94
8.4.140.0110.01117.62
8.4.130.0100.01018.83
8.4.120.0130.00724.11
8.4.110.0110.01020.62
8.4.100.0080.00717.94
8.4.90.0100.01120.43
8.4.80.0120.00718.85
8.4.70.0100.01017.92
8.4.60.0110.00518.77
8.4.50.0090.01122.23
8.4.40.0060.00319.70
8.4.30.0140.00717.84
8.4.20.0090.00019.48
8.4.10.0040.01819.47
8.3.300.0120.00820.63
8.3.290.0130.00920.60
8.3.280.0130.01118.32
8.3.270.0140.00916.57
8.3.260.0080.00816.67
8.3.250.0030.00518.91
8.3.240.0100.00717.35
8.3.230.0110.00816.62
8.3.220.0060.00220.83
8.3.210.0040.00416.84
8.3.200.0040.00416.97
8.3.190.0110.00816.91
8.3.180.0050.00416.72
8.3.170.0050.00317.16
8.3.160.0120.00620.41
8.3.150.0110.00718.36
8.3.140.0080.00017.18
8.3.130.0000.00817.25
8.3.120.0030.01520.92
8.3.110.0100.00520.94
8.3.100.0030.00724.06
8.3.90.0240.00526.77
8.3.80.0220.00722.37
8.3.70.0220.01121.63
8.3.60.0170.00322.66
8.3.50.0170.00819.95
8.3.40.0210.00522.87
8.3.30.0230.00222.72
8.3.20.0150.00825.21
8.3.10.0210.00425.21
8.3.00.0170.00625.11
8.2.300.0100.01220.25
8.2.290.0090.00117.16
8.2.280.0100.01018.23
8.2.270.0070.01317.27
8.2.260.0090.00916.82
8.2.250.0080.00018.26
8.2.240.0060.00317.05
8.2.230.0060.00322.58
8.2.220.0000.00937.54
8.2.210.0160.00626.77
8.2.200.0180.00721.63
8.2.190.0230.00821.67
8.2.180.0270.00922.46
8.2.170.0150.00724.87
8.2.160.0160.00322.90
8.2.150.0080.00725.47
8.2.140.0120.00325.71
8.2.130.0080.00926.46
8.2.120.0160.00523.79
8.2.110.0160.00423.90
8.2.100.0140.00222.30
8.2.90.0180.00722.95
8.2.80.0190.00422.37
8.2.70.0240.00722.20
8.2.60.0200.00522.35
8.2.50.0200.00722.42
8.2.40.0230.00122.43
8.2.30.0190.00522.38
8.2.20.0160.00822.48
8.2.10.0170.00722.41
8.2.00.0200.00422.48
8.1.340.0130.00721.73
8.1.330.0070.01121.93
8.1.320.0070.00615.96
8.1.310.0120.00618.20
8.1.300.0090.00620.33
8.1.290.0220.00528.80
8.1.280.0190.00926.34
8.1.270.0200.00624.45
8.1.260.0210.00526.56
8.1.250.0230.00427.43
8.1.240.0140.01124.78
8.1.230.0200.00722.30
8.1.220.0200.01022.27
8.1.210.0180.01322.77
8.1.200.0200.00822.06
8.1.190.0150.00722.06
8.1.180.0150.00622.43
8.1.170.0160.00922.66
8.1.160.0200.00422.83
8.1.150.0210.00322.78
8.1.140.0180.00922.88
8.1.130.0100.00522.19
8.1.120.0150.00522.06
8.1.110.0130.00422.11
8.1.100.0130.00222.11
8.1.90.0130.00122.13
8.1.80.0090.00522.09
8.1.70.0090.00522.09
8.1.60.0090.00619.84
8.1.50.0180.00619.75
8.1.40.0180.00619.80
8.1.30.0200.00419.90
8.1.20.0150.00719.93
8.1.10.0180.00419.80
8.1.00.0160.00519.78
8.0.300.0110.00322.77
8.0.290.0120.00421.76
8.0.280.0110.00322.61
8.0.270.0100.00422.01
8.0.260.0090.00422.01
8.0.250.0120.00221.82
8.0.240.0080.00521.80
8.0.230.0100.00321.79
8.0.220.0100.00321.81
8.0.210.0110.00221.77
8.0.200.0070.00721.86
8.0.190.0090.00419.40
8.0.180.0170.00219.33
8.0.170.0150.00319.30
8.0.160.0150.00419.29
8.0.150.0120.00619.30
8.0.140.0150.00419.29
8.0.130.0150.00418.41
8.0.120.0120.00619.34
8.0.110.0110.00719.32
8.0.100.0100.00919.31
8.0.90.0140.00519.29
8.0.80.0120.00918.81
8.0.70.0190.00319.32
8.0.60.0170.00619.33
8.0.50.0150.00619.33
8.0.30.0140.00718.31
8.0.20.0140.00718.13
8.0.10.0150.00718.91
8.0.00.0090.00818.31
7.4.330.0100.00321.16
7.4.320.0130.00221.63
7.4.300.0100.00321.71
7.4.290.0170.00219.08
7.4.280.0160.00419.05
7.4.270.0130.00219.03
7.4.260.0110.00519.09
7.4.250.0130.00419.08
7.4.240.0120.00519.05
7.4.230.0130.00219.09
7.4.220.0130.00518.98
7.4.210.0130.00518.55
7.4.200.0090.00819.10
7.4.190.0110.00619.10
7.4.180.0130.00619.17
7.4.160.0120.00717.81
7.4.150.0140.00818.34
7.4.140.0120.00718.18
7.4.130.0130.00718.17
7.4.120.0150.00517.66
7.4.110.0140.00718.16
7.4.100.0120.00618.18
7.4.90.0130.00817.89
7.4.80.0150.00618.28
7.4.70.0130.00717.87
7.4.60.0110.01017.48
7.4.50.0110.00817.41
7.4.40.0130.00617.54
7.4.30.0150.00617.56
7.4.20.0150.00617.45
7.4.10.0130.01017.47
7.4.00.0120.00917.26
7.3.330.0130.00818.08
7.3.320.0180.00318.05
7.3.310.0160.00418.88
7.3.300.0150.00418.89
7.3.290.0120.00717.74
7.3.280.0150.00617.54
7.3.270.0170.00618.14
7.3.260.0150.00817.55
7.3.250.0120.00917.59
7.3.240.0120.00917.58
7.3.230.0150.00918.03
7.3.220.0200.00618.31
7.3.210.0170.00817.85
7.3.200.0170.00517.75
7.3.190.0140.00817.78
7.3.180.0150.00817.43
7.3.170.0150.00717.45
7.3.160.0160.00817.53
7.3.150.0130.01017.49
7.3.140.0170.00717.52
7.3.130.0150.00917.28
7.3.120.0120.00917.33
7.3.110.0150.00817.32
7.3.100.0180.00316.94
7.3.90.0140.00716.86
7.3.80.0150.00616.78
7.3.70.0120.00916.77
7.3.60.0140.00716.77
7.3.50.0160.00616.76
7.3.40.0150.00616.79
7.3.30.0120.00816.54
7.3.20.0180.00916.87
7.3.10.0230.00616.86
7.3.00.0220.00716.91
7.2.340.0120.00718.37
7.2.330.0160.00817.88
7.2.320.0150.01017.88
7.2.310.0180.00717.57
7.2.300.0190.00617.55
7.2.290.0150.01017.61
7.2.280.0150.00917.61
7.2.270.0190.00817.59
7.2.260.0160.00917.47
7.2.250.0180.00617.45
7.2.240.0150.00817.47
7.2.230.0140.00817.05
7.2.220.0150.00816.95
7.2.210.0140.00816.84
7.2.200.0140.00916.93
7.2.190.0130.00816.90
7.2.180.0140.00816.98
7.2.170.0180.00716.92
7.2.160.0130.00816.68
7.2.150.0230.00917.05
7.2.140.0210.00917.06
7.2.130.0210.00917.11
7.2.120.0230.00817.09
7.2.110.0240.00717.05
7.2.100.0200.00817.07
7.2.90.0220.00717.05
7.2.80.0210.00817.04
7.2.70.0220.00916.91
7.2.60.0190.00816.95
7.2.50.0190.00816.98
7.2.40.0390.00817.00
7.2.30.0350.01016.95
7.2.20.0300.00916.95
7.2.10.0340.00916.90
7.2.00.0310.00916.99
7.1.330.0210.00917.25
7.1.320.0150.00816.47
7.1.310.0150.00816.44
7.1.300.0160.00716.49
7.1.290.0260.00716.46
7.1.280.0150.01016.46
7.1.270.0170.00916.28
7.1.260.0220.00616.26
7.1.250.0200.00816.09
7.1.240.0250.00816.07
7.1.230.0220.00916.04
7.1.220.0250.00716.03
7.1.210.0220.00816.00
7.1.200.0230.00916.00
7.1.190.0200.00716.02
7.1.180.0210.00916.01
7.1.170.0230.00915.93
7.1.160.0380.00815.81
7.1.150.0370.00815.87
7.1.140.0330.00815.88
7.1.130.0330.00815.90
7.1.120.0330.01015.90
7.1.110.0320.00915.88
7.1.100.0310.00915.89
7.1.90.0390.00815.84
7.1.80.0300.01015.81
7.1.70.0310.00915.72
7.1.60.0340.00819.33
7.1.50.0380.00819.34
7.1.40.0380.00919.26
7.1.30.0350.00819.27
7.1.20.0380.00719.28
7.1.10.0290.00915.69
7.1.00.0320.00815.69
7.0.330.0230.00815.59
7.0.320.0210.00715.82
7.0.310.0260.00515.81
7.0.300.0210.00715.62
7.0.290.0180.00915.63
7.0.280.0210.00715.75
7.0.270.0190.00815.69
7.0.260.0170.01015.69
7.0.250.0190.00915.73
7.0.240.0220.00815.74
7.0.230.0210.00615.68
7.0.220.0220.00815.63
7.0.210.0200.00715.61
7.0.200.0290.00815.65
7.0.190.0200.00715.64
7.0.180.0180.00815.60
7.0.170.0160.00715.57
7.0.160.0190.00815.58
7.0.150.0190.00715.54
7.0.140.0180.00915.51
7.0.130.0190.00815.58
7.0.120.0210.00915.60
7.0.110.0180.00915.62
7.0.100.0180.00915.52
7.0.90.0180.00915.49
7.0.80.0240.00615.53
7.0.70.0200.00915.54
7.0.60.0170.00915.56
7.0.50.0200.00715.57
7.0.40.0230.00815.67
7.0.30.0170.00815.63
7.0.20.0200.00815.59
7.0.10.0180.00815.59
7.0.00.0220.00615.58
5.6.400.0160.00816.23
5.6.390.0150.01016.26
5.6.380.0150.00815.90
5.6.370.0160.00816.11
5.6.360.0140.00816.20
5.6.350.0150.00716.12
5.6.340.0170.00716.18
5.6.330.0170.00816.25
5.6.320.0120.01116.17
5.6.310.0160.00916.11
5.6.300.0160.01416.50
5.6.290.0170.01316.59
5.6.280.0160.01516.57
5.6.270.0140.01616.59
5.6.260.0140.01416.57
5.6.250.0140.01416.60
5.6.240.0140.01616.57
5.6.230.0150.01416.58
5.6.220.0140.01616.62
5.6.210.0150.01416.55
5.6.200.0160.01416.60
5.6.190.0150.01516.61
5.6.180.0140.01416.59
5.6.170.0160.01416.61
5.6.160.0150.01416.62
5.6.150.0160.01416.57
5.6.140.0170.01416.63
5.6.130.0140.01416.63
5.6.120.0150.01616.56
5.6.110.0110.01716.59
5.6.100.0130.01716.59
5.6.90.0160.01416.60
5.6.80.0140.01416.44
5.6.70.0130.01616.50
5.6.60.0150.01616.45
5.6.50.0140.01416.44
5.6.40.0140.01516.46
5.6.30.0130.01716.43
5.6.20.0150.01416.42
5.6.10.0140.01716.40
5.6.00.0130.01616.46

preferences:
59.55 ms | 1980 KiB | 5 Q