3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function getFingeprint($publickey) { $hash = hash('sha256', $publickey); return implode(' ', [ substr($hash, 0, 8), substr($hash, 8, 8), substr($hash, 16, 8), substr($hash, 24, 8), '', // Extra space substr($hash, 32, 8), substr($hash, 40, 8), substr($hash, 48, 8), substr($hash, 56, 8), ]); } echo getFingerprint('-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq/fYc4fDkgMdv7qdM7Fc yjS7IVvPWoV8z6V277jmKL735UoGsZunY0RJdxOW9Ucep/XMc0hIcNogmyYpCkna WB/20xI4sWuFgLXVHZhpU8k+sT16GzPY4/2RnvNs0cFCEA4CeI2nHOp+RnpzOXAO jv6K2LrH7fbChkXl8WHiC1+xC7a4zxvm1XbsUE6Jf/m+xljhwQWFpDLPIOvE8uzG Oo/MYxCCgxCzy/ze8V9hnyQyI4FHbKTYf44NiJP99svppEfbUkVsMlMwhtbWEUAh pZSwmsRV7aH+H8lCaVe5fxs4Sm6UcU6yImFiqvTpB92ElrwiHDZOanidimKynf0x YQIDAQAB -----END PUBLIC KEY-----');
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught Error: Call to undefined function getFingerprint() in /in/q6CLn:18 Stack trace: #0 {main} thrown in /in/q6CLn on line 18
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Call to undefined function getFingerprint() in /in/q6CLn on line 18
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/q6CLn on line 5
Process exited with code 255.