3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo gmdate('Y-m-d\TH:i:s\Z'); $created = "2015-08-25T10:45:55Z"; $randomString = array(219,237,93,18,84,210,254,168,120,82,56,138,97,64,219,199,173,111,217,208,167,150,79,50,114,227,40,191,210,188,233,34); $private_key = 'aDknWCcwJEsuNjRpJS52ZnN4Ti1MRDk1M2cyNU5N'; $nonce = hash('sha512', $randomString); $key = base64_decode($private_key); $digest = base64_encode(sha1(base64_decode($nonce) . $created . $key, true)); sprintf('UsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"', 'wkstore', $digest, $nonce, $created);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
2015-08-31T12:18:54Z Fatal error: Uncaught TypeError: hash(): Argument #2 ($data) must be of type string, array given in /in/j9Wmi:8 Stack trace: #0 /in/j9Wmi(8): hash('sha512', Array) #1 {main} thrown in /in/j9Wmi on line 8
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
2015-08-31T12:18:54Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.3.27 - 5.3.29
2015-08-31T12:19:14Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.3.21 - 5.3.26
2015-08-31T12:19:15Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.3.16 - 5.3.20
2015-08-31T12:19:16Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.3.11 - 5.3.15
2015-08-31T12:19:17Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.3.7 - 5.3.10
2015-08-31T12:19:18Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.3.0 - 5.3.6
2015-08-31T12:19:19Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.2.13 - 5.2.17
2015-08-31T12:19:20Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.2.7 - 5.2.12
2015-08-31T12:19:21Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.2.1 - 5.2.6
2015-08-31T12:19:22Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.1.2 - 5.1.6, 5.2.0
2015-08-31T12:19:23Z Warning: hash() expects parameter 2 to be string, array given in /in/j9Wmi on line 8
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
2015-08-31T12:19:24Z Fatal error: Call to undefined function hash() in /in/j9Wmi on line 8
Process exited with code 255.
Output for 4.4.9
2015-08-31T12:19:24Z Fatal error: Call to undefined function: hash() in /in/j9Wmi on line 8
Process exited with code 255.
Output for 4.4.5 - 4.4.8
2015-08-31T12:19:25Z Fatal error: Call to undefined function: hash() in /in/j9Wmi on line 8
Process exited with code 255.
Output for 4.3.10 - 4.3.11, 4.4.0 - 4.4.4
2015-08-31T12:19:25Z Fatal error: Call to undefined function: hash() in /in/j9Wmi on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.9
2015-08-31T12:19:26Z Fatal error: Call to undefined function: hash() in /in/j9Wmi on line 8
Process exited with code 255.
Output for 4.3.1
2015-08-31T12:19:26Z Fatal error: Call to undefined function: hash() in /in/j9Wmi on line 8
Output for 4.3.0
2015-09-06T14:55:59Z Fatal error: Call to undefined function: hash() in /in/j9Wmi on line 8

preferences:
361.83 ms | 401 KiB | 456 Q