3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (!(function_exists('openssl_sign') && defined('OPENSSL_ALGO_SHA256'))) { die('Unsupported PHP version or OpenSSH extension missing'); } $privateKey = <<<EOT -----BEGIN PRIVATE KEY----- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCrYL5Zq4rvXwEn acjPDXjrl0UnAKfAchtNQIyEdf/a41tFgZkw1DXS2s+9eWNBarWYEwGhFoiOeeop ShU7qa5IKL7pwLaO8vPbTPNWZZ9sy3Vx18lB54IyRPBX5lrLU+n0XuYyFcZa1+Gd Dtgu+AQQqjDGGuSJecuABWH+rzzfumMi9K4gP9S0J8vq60mRna6R47Ati7t/jBJm b2vSoSaWjtKf0LJoRPnbc7SgYF8D4JWJ3xQnsa8LrrBudV5j+N3uRDMimUeHL6iW 1KoAb8g1Iql/b3/2C0Z0M/O/13sECytFxDBVP9W+lvHwNF7pZR+C/BvhFH6FnrFI fRismw8BAgMBAAECggEBAIsHKqS4Azf5TIhayusdtND6oMDpSS1X5EohaV00FOHP u4WBg3MXVKq/k/PT++9fz/2UvaefDhz3Tj08ukjyeE5Vr7sV+YOyGJ35qRaXzmOG ErrOIZjzZK2/O3MzjsiQRKVYL0rGW2nq5D5zgnFoBnQ2fObZfjkAs1QiCcOBCdM8 nttTO31JCwyBuTKGK3KaJdoba6dVze5Xhm1b/haCmq2EJOML5G73jK7m8aYkVDFb FJOShYATyz5Xju33QEPz+HWcMrk/TKZFRQYSjWFAzy0/ENrMptIVff3UN0KL0YSl 0hNHlJwHStDEZAiMw4A20ojtKqfUkyR1kPzxpWdi/BkCgYEA4VVFhv5RNSJUGm1I zhJT54UlfIW57c/NWx/Tqbhe0QYg//sM4c/s8lw45lvmRc7vKs6C/ZGo18p+XNT+ BaZdNFlxbtKJisM61Cegc8pIwzv4mbTyo9SjoWswxt20zVp8sIGeF4w7X94gPVZ0 f8D3OELujXqk2i34blLDbTGF3TsCgYEAwrOkxvZ1cd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dFRUtvd3hocmtpWG5MZ0FWaF9xODgzN3BqSXZTdUlEX1V0Q2ZMNnV0SmtaMnVrZU93TFl1N2Y0d1NabTlyMHFFbWxvN1NuOUN5YUVUNTIzTzBvR0JmQS1DVmlkOFVKN0d2QzY2d2JuVmVZX2pkN2tReklwbEhoeS1vbHRTcUFHX0lOU0twZjI5XzlndEdkRFB6djlkN0JBc3JSY1F3VlRfVnZwYng4RFJlNldVZmd2d2I0UlItaFo2eFNIMFlySnNQQVEifX0.eyJjb250YWN0IjpbIm1haWx0bzptbG9jYXRpQGdtYWlsLmNvbSJdLCJhZ3JlZW1lbnQiOiJodHRwOi8vMTI3LjAuMC4xOjQwMDEvdGVybXMvdjEiLCJyZXNvdXJjZSI6Im5ldy1yZWcifQ'; $signature = null; if (openssl_sign( $data, $signature, $privateKey, OPENSSL_ALGO_SHA256 ) !== true) { die('openssl_sign() failed'); } $lineLength = 24; for ($base = 0; $base < strlen($signature); $base += $lineLength) { echo substr('00000000'.strtoupper(dechex($base)), -8).' '; for ($offset = 0; $offset < $lineLength; $offset++) { echo ' '; if (($offset % 4) === 0) { echo ' '; } $absolute = $base + $offset; if ($absolute >= strlen($signature)) { echo ' '; } else { echo strtoupper(substr('00'.dechex(ord($signature[$absolute])), -2)); } } echo ' '; for ($offset = 0; $offset < $lineLength; $offset++) { $absolute = $base + $offset; if ($absolute >= strlen($signature)) { break; } $c = $signature[$absolute]; $a = ord($c); echo ($a >= 32 && $a <= 127) ? $c : '.'; } echo "\n"; } die();
based on vTsoQ
Output for 7.2.0
Warning: Use of undefined constant EOT - assumed 'EOT' (this will throw an Error in a future version of PHP) in /in/V8cra on line 39 00000000 5C 8A DC B6 36 83 B0 E1 82 2D 3E B5 23 E2 14 D4 A4 4B A9 9D DA 4B 3C EB \...6....->.#....K...K<. 00000018 AF EE 9F A2 F8 0E DA 40 68 25 DB 6D 44 A1 08 B5 92 56 9E D7 E3 5E 3D 59 .......@h%.mD....V...^=Y 00000030 1F 53 D2 21 A2 E7 5E 58 74 42 FE 5D 5B 36 1F 30 C4 DF 45 DE A4 70 2D D7 .S.!..^XtB.][6.0..E..p-. 00000048 9B 2E 61 D5 2C 29 AA C1 93 4D 42 86 F4 35 62 52 DE B1 1F 1B 0C F4 A2 53 ..a.,)...MB..5bR.......S 00000060 95 35 BC F8 65 AB 28 A1 2C DC 66 2B B1 10 34 13 CC 4D 5A F1 13 8C 47 80 .5..e.(.,.f+..4..MZ...G. 00000078 DC 11 19 35 F5 24 78 1A C8 E6 AE EE 83 21 1B 12 7F AA 35 74 7F 23 DE 54 ...5.$x......!...5t#.T 00000090 EB 76 70 FA 6B 39 79 CC 35 F4 57 D8 95 B3 07 86 30 12 AF 5C 83 7A 28 25 .vp.k9y.5.W.....0..\.z(% 000000A8 93 AE B9 A3 37 86 ED 78 AD 59 10 25 90 2F 64 53 7C DE DE 9C D6 B5 16 A3 ....7..x.Y.%./dS|....... 000000C0 DE B1 CE BC B5 5A A8 8A BC 8B 2D CE 18 A1 B4 97 BF 92 F5 0C 8B B8 38 6D .....Z....-...........8m 000000D8 E6 DC E7 20 43 B9 82 6B 41 46 83 F1 89 40 BA 28 3D 8C 3D 1F 22 C7 ED C3 ... C..kAF...@.(=.=."... 000000F0 0C 24 0A 91 ED CC 27 B7 1C B4 5C 67 1D C0 1D 8F .$....'...\g....
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant EOT - assumed 'EOT' in /in/V8cra on line 39 00000000 5C 8A DC B6 36 83 B0 E1 82 2D 3E B5 23 E2 14 D4 A4 4B A9 9D DA 4B 3C EB \...6....->.#....K...K<. 00000018 AF EE 9F A2 F8 0E DA 40 68 25 DB 6D 44 A1 08 B5 92 56 9E D7 E3 5E 3D 59 .......@h%.mD....V...^=Y 00000030 1F 53 D2 21 A2 E7 5E 58 74 42 FE 5D 5B 36 1F 30 C4 DF 45 DE A4 70 2D D7 .S.!..^XtB.][6.0..E..p-. 00000048 9B 2E 61 D5 2C 29 AA C1 93 4D 42 86 F4 35 62 52 DE B1 1F 1B 0C F4 A2 53 ..a.,)...MB..5bR.......S 00000060 95 35 BC F8 65 AB 28 A1 2C DC 66 2B B1 10 34 13 CC 4D 5A F1 13 8C 47 80 .5..e.(.,.f+..4..MZ...G. 00000078 DC 11 19 35 F5 24 78 1A C8 E6 AE EE 83 21 1B 12 7F AA 35 74 7F 23 DE 54 ...5.$x......!...5t#.T 00000090 EB 76 70 FA 6B 39 79 CC 35 F4 57 D8 95 B3 07 86 30 12 AF 5C 83 7A 28 25 .vp.k9y.5.W.....0..\.z(% 000000A8 93 AE B9 A3 37 86 ED 78 AD 59 10 25 90 2F 64 53 7C DE DE 9C D6 B5 16 A3 ....7..x.Y.%./dS|....... 000000C0 DE B1 CE BC B5 5A A8 8A BC 8B 2D CE 18 A1 B4 97 BF 92 F5 0C 8B B8 38 6D .....Z....-...........8m 000000D8 E6 DC E7 20 43 B9 82 6B 41 46 83 F1 89 40 BA 28 3D 8C 3D 1F 22 C7 ED C3 ... C..kAF...@.(=.=."... 000000F0 0C 24 0A 91 ED CC 27 B7 1C B4 5C 67 1D C0 1D 8F .$....'...\g....
Output for 5.4.15 - 5.6.21
Notice: Use of undefined constant EOT - assumed 'EOT' in /in/V8cra on line 40 00000000 5C 8A DC B6 36 83 B0 E1 82 2D 3E B5 23 E2 14 D4 A4 4B A9 9D DA 4B 3C EB \...6....->.#....K...K<. 00000018 AF EE 9F A2 F8 0E DA 40 68 25 DB 6D 44 A1 08 B5 92 56 9E D7 E3 5E 3D 59 .......@h%.mD....V...^=Y 00000030 1F 53 D2 21 A2 E7 5E 58 74 42 FE 5D 5B 36 1F 30 C4 DF 45 DE A4 70 2D D7 .S.!..^XtB.][6.0..E..p-. 00000048 9B 2E 61 D5 2C 29 AA C1 93 4D 42 86 F4 35 62 52 DE B1 1F 1B 0C F4 A2 53 ..a.,)...MB..5bR.......S 00000060 95 35 BC F8 65 AB 28 A1 2C DC 66 2B B1 10 34 13 CC 4D 5A F1 13 8C 47 80 .5..e.(.,.f+..4..MZ...G. 00000078 DC 11 19 35 F5 24 78 1A C8 E6 AE EE 83 21 1B 12 7F AA 35 74 7F 23 DE 54 ...5.$x......!...5t#.T 00000090 EB 76 70 FA 6B 39 79 CC 35 F4 57 D8 95 B3 07 86 30 12 AF 5C 83 7A 28 25 .vp.k9y.5.W.....0..\.z(% 000000A8 93 AE B9 A3 37 86 ED 78 AD 59 10 25 90 2F 64 53 7C DE DE 9C D6 B5 16 A3 ....7..x.Y.%./dS|....... 000000C0 DE B1 CE BC B5 5A A8 8A BC 8B 2D CE 18 A1 B4 97 BF 92 F5 0C 8B B8 38 6D .....Z....-...........8m 000000D8 E6 DC E7 20 43 B9 82 6B 41 46 83 F1 89 40 BA 28 3D 8C 3D 1F 22 C7 ED C3 ... C..kAF...@.(=.=."... 000000F0 0C 24 0A 91 ED CC 27 B7 1C B4 5C 67 1D C0 1D 8F .$....'...\g....
Output for 5.3.21 - 5.4.14
Unsupported PHP version or OpenSSH extension missing