3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['str1'] = ["a"]; $_GET['str2'] = ["b"]; $hash1 = hash("sha256", $_GET['str1']); echo $hash1;
Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
Fatal error: Uncaught TypeError: hash(): Argument #2 ($data) must be of type string, array given in /in/je04o:4 Stack trace: #0 /in/je04o(4): hash('sha256', Array) #1 {main} thrown in /in/je04o on line 4
Process exited with code 255.

preferences:
43.13 ms | 406 KiB | 5 Q