3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $config = array( "digest_alg" => "sha1", "private_key_bits" => 1024, "private_key_type" => OPENSSL_KEYTYPE_RSA, ); // Create the private and public key $res = openssl_pkey_new($config); $output = ''; // Create the keypair //$res=openssl_pkey_new(); // Get private key openssl_pkey_export($res, $privatekey); $privatekey_string=base64_encode($privatekey); // Get public key $publickey=openssl_pkey_get_details($res); $publickey_string=base64_encode($publickey["key"]); echo "Private Key:\n$privatekey_string<br><br>Public Key:<BR>$publickey_string\n\n"; $chunk="HelloWorld!"; //if(openssl_private_encrypt($chunk, $encrypted, $privatekey,$padding = OPENSSL_NO_PADDING)) openssl_private_encrypt($chunk, $encryptedviaprivatekey, $privatekey); echo $chunk . "->" . $encryptedviaprivatekey; echo "\n\n";
based on IubjM

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0100.00316.35
7.3.00.0070.00916.80
7.2.130.0060.01216.68
7.2.120.0100.00516.83
7.2.110.0070.00716.65
7.2.100.0120.00716.56
7.2.90.0110.00716.74
7.2.80.0030.01016.74
7.2.70.0070.01016.80
7.2.60.0080.00716.84
7.2.50.0110.00516.81
7.2.40.0070.00916.80
7.2.30.0070.00916.96
7.2.20.0060.00816.64
7.2.10.0080.00716.64
7.2.00.0040.00717.63
7.1.250.0050.00715.71
7.1.240.0000.01315.53
7.1.230.0040.00415.45
7.1.220.0030.00615.71
7.1.210.0060.01215.50
7.1.200.0020.01115.63
7.1.190.0080.00815.66
7.1.180.0000.01115.63
7.1.170.0070.00715.76
7.1.160.0090.00615.79
7.1.150.0100.00315.73
7.1.140.0100.00415.70
7.1.130.0000.00815.59
7.1.120.0040.00715.57
7.1.110.0060.00315.33
7.1.100.0020.01216.84
7.1.90.0060.00715.59
7.1.80.0070.00715.71
7.1.70.0050.00716.33
7.1.60.0110.00617.93
7.1.50.0180.00825.36
7.1.40.0030.01015.56
7.1.30.0030.01015.66
7.1.20.0060.00315.79
7.1.10.0000.01515.70
7.1.00.0070.08119.10
7.0.330.0060.00615.36
7.0.320.0060.00915.49
7.0.310.0090.00315.27
7.0.300.0150.00415.44
7.0.290.0040.01115.56
7.0.280.0040.01115.07
7.0.270.0000.01314.99
7.0.260.0170.00015.24
7.0.250.0050.00315.16
7.0.240.0090.00015.14
7.0.230.0040.00415.00
7.0.220.0000.01615.14
7.0.210.0040.00715.35
7.0.200.0110.00715.01
7.0.190.0030.00615.20
7.0.180.0140.00015.28
7.0.170.0060.01015.31
7.0.160.0040.00915.44
7.0.150.0100.00715.45
7.0.140.0000.00815.39
7.0.130.0030.01015.55
7.0.120.0070.01015.17
7.0.110.0080.00415.21
7.0.100.0070.00415.19
7.0.90.0030.01315.39
7.0.80.0060.00615.45
7.0.70.0090.00015.34
7.0.60.0060.03518.57
7.0.50.0060.03916.72
7.0.40.0220.03416.83
7.0.30.0230.04316.98
7.0.20.0130.02516.82
7.0.10.0080.06316.75
7.0.00.0030.02616.78
5.6.380.0050.00514.16
5.6.370.0170.00714.24
5.6.360.0070.00414.21
5.6.350.0130.00014.20
5.6.340.0040.00714.16
5.6.330.0000.01214.22
5.6.320.0030.00914.36
5.6.310.0050.00514.07
5.6.300.0070.00714.02
5.6.290.0050.00513.56
5.6.280.0030.06117.74
5.6.270.0040.00814.22
5.6.260.0040.00814.11
5.6.250.0090.00614.05
5.6.240.0000.00914.32
5.6.230.0030.00614.23
5.6.220.0100.00314.07
5.6.210.0060.03617.46
5.6.200.0050.03516.21
5.6.190.0080.06117.59
5.6.180.0160.04817.49
5.6.170.0190.05117.31
5.6.160.0160.05217.29
5.6.150.0030.03916.21
5.6.140.0080.04216.25
5.6.130.0080.03416.39
5.6.120.0050.03017.83
5.6.110.0120.02917.73
5.6.100.0100.07217.66
5.6.90.0100.05217.60
5.6.80.0110.05217.26
5.6.70.0080.00413.91
5.6.60.0060.00614.22
5.6.50.0100.00714.42
5.6.40.0170.00313.93
5.6.30.0140.00014.04
5.6.20.0030.01014.01
5.6.10.0100.01413.99
5.6.00.0000.01214.31
5.5.380.0000.00910.79
5.5.370.0030.00711.13
5.5.360.0090.00311.13
5.5.350.0030.02815.83
5.5.340.0110.05014.62
5.5.330.0070.04315.60
5.5.320.0230.04315.77
5.5.310.0110.02515.90
5.5.300.0080.03514.47
5.5.290.0030.06314.68
5.5.280.0040.04215.96
5.5.270.0070.04016.03
5.5.260.0100.06315.98
5.5.250.0110.05415.76
5.5.240.0060.02515.56
5.5.230.0180.00010.90
5.5.220.0140.00310.66
5.5.210.0050.00810.88
5.5.200.0060.00610.71
5.5.190.0070.00310.67
5.5.180.0100.00710.85
5.5.170.0040.00410.57
5.5.160.0110.00010.98
5.5.150.0030.00911.14
5.5.140.0040.00710.91
5.5.130.0170.00010.89
5.5.120.0080.00810.75
5.5.110.0160.00311.02
5.5.100.0070.01110.77
5.5.90.0110.00310.76
5.5.80.0160.00411.09
5.5.70.0120.00410.84
5.5.60.0160.00310.80
5.5.50.0170.00610.73
5.5.40.0080.00810.90
5.5.30.0120.00911.05
5.5.20.0150.00310.98
5.5.10.0200.00010.93
5.5.00.0240.00010.78
5.4.450.0420.04515.24
5.4.440.0370.03615.02
5.4.430.0350.04615.23
5.4.420.0310.04615.37
5.4.410.0430.04015.10
5.4.400.0340.04615.01
5.4.390.0330.03914.84
5.4.380.0380.04815.18
5.4.370.0330.07215.04
5.4.360.0280.03215.05
5.4.350.0280.04814.80
5.4.340.0290.04414.99
5.4.330.0070.00410.61
5.4.320.0510.03315.16
5.4.310.0280.04015.19
5.4.300.0360.04315.01
5.4.290.0420.07714.85
5.4.280.0360.05514.94
5.4.270.0310.03815.16
5.4.260.0330.04515.11
5.4.250.0450.03815.08
5.4.240.0300.06015.15
5.4.230.0260.04614.93
5.4.220.0160.05314.99
5.4.210.0090.05214.99
5.4.200.0060.03815.13
5.4.190.0390.07914.96
5.4.180.0290.04114.94
5.4.170.0410.05014.92
5.4.160.0470.04415.15
5.4.150.0390.06214.90
5.4.140.0350.03213.67
5.4.130.0370.03313.57
5.4.120.0480.02813.49
5.4.110.0370.03413.63
5.4.100.0380.03113.56
5.4.90.0280.02613.51
5.4.80.0400.03213.40
5.4.70.0210.03613.63
5.4.60.0260.03413.63
5.4.50.0090.02713.42
5.4.40.0160.02513.51
5.4.30.0180.02013.61
5.4.20.0280.02513.51
5.4.10.0190.00310.67
5.4.00.0250.00310.98
5.3.290.0300.03715.16
5.3.280.0070.04315.16
5.3.270.1170.04015.16
5.3.260.1130.03715.16
5.3.250.0770.03315.16
5.3.240.1800.04015.16
5.3.230.1600.05315.16
5.3.220.1730.04315.16
5.3.210.1670.04015.16
5.3.200.1530.03315.16
5.3.190.1500.04015.16
5.3.180.0070.07715.16