3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(random_bytes('4')); var_dump(random_bytes('4d')); var_dump(random_bytes('d3')); var_dump(random_bytes(new stdClass()));
Output for 7.2.0
string(4) "͹w" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "Z��" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.1.10
string(4) "IO��" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "Z�Tt" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.1.7
string(4) "�*" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "�1" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.1.6
string(4) "���" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) ",?_|" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.1.5
string(4) "F^7�" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "Y�a�" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.1.0
string(4) "�Ľ�" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "}Íi" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.0.20
string(4) "�l�P" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "c+�?" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.0.6
string(4) "Aߠ" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "��a�" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.0.5
string(4) "j�o�" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "ֽ<\" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.0.4
string(4) "���T" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "�l�p" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.0.3
string(4) "���R" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "4��" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.0.2
string(4) "×F�" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "�S�T" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.0.1
string(4) "����" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "oZ:�" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 7.0.0
string(4) "�P<�" Notice: A non well formed numeric value encountered in /in/q33lo on line 4 string(4) "4" Fatal error: Uncaught TypeError: random_bytes() expects parameter 1 to be integer, string given in /in/q33lo:5 Stack trace: #0 /in/q33lo(5): random_bytes('d3') #1 {main} thrown in /in/q33lo on line 5
Process exited with code 255.
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Call to undefined function random_bytes() in /in/q33lo on line 3
Process exited with code 255.

preferences:
91.15 ms | 402 KiB | 89 Q