3v4l.org

run code in 300+ PHP versions simultaneously
<?php $length = 10; $bytes = openssl_random_pseudo_bytes(1); $longs = unpack("S*", $bytes); var_dump($bytes); var_dump($longs); foreach ($longs as $long) { var_dump($long / 0xffff); }
Output for 7.1.26 - 7.1.33, 7.2.17 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Call to undefined function openssl_random_pseudo_bytes() in /in/54iKN:4 Stack trace: #0 {main} thrown in /in/54iKN on line 4
Process exited with code 255.
Output for 7.2.0
string(1) "K" array(0) { }
Output for 5.4.36, 7.1.7
string(1) "~" array(0) { }
Output for 5.5.35, 7.1.6
string(1) "n" array(0) { }
Output for 5.4.34 - 5.4.35, 5.4.45, 5.5.26 - 5.5.27, 5.5.29 - 5.5.30, 5.5.33 - 5.5.34, 5.6.9, 5.6.12, 5.6.16, 5.6.18, 5.6.28, 7.0.4 - 7.0.5, 7.0.14, 7.1.5
string(1) "�" array(0) { }
Output for 7.1.0
string(1) "]" array(0) { }
Output for 7.0.20
string(1) "3" array(0) { }
Output for 7.0.6
string(1) "W" array(0) { }
Output for 7.0.3
string(1) "=" array(0) { }
Output for 7.0.2
string(1) "" array(0) { }
Output for 7.0.1
string(1) "" array(0) { }
Output for 5.6.19, 7.0.0
string(1) "+" array(0) { }
Output for 5.6.21
string(1) "Y" array(0) { }
Output for 5.6.20
string(1) " " array(0) { }
Output for 5.6.17
string(1) "h" array(0) { }
Output for 5.6.15
string(1) "M" array(0) { }
Output for 5.6.14
string(1) "X" array(0) { }
Output for 5.6.13
string(1) "," array(0) { }
Output for 5.6.11
string(1) "" array(0) { }
Output for 5.6.10
string(1) "" array(0) { }
Output for 5.6.8
string(1) "a" array(0) { }
Output for 5.5.32
string(1) "Q" array(0) { }
Output for 5.5.31
string(1) "\" array(0) { }
Output for 5.5.28
string(1) "!" array(0) { }
Output for 5.5.25
string(1) "o" array(0) { }
Output for 5.5.24
string(1) "T" array(0) { }
Output for 5.4.44
string(1) "k" array(0) { }
Output for 5.4.43
string(1) "6" array(0) { }
Output for 5.4.42
string(1) "H" array(0) { }
Output for 5.4.41
string(1) "%" array(0) { }
Output for 5.4.40
string(1) """ array(0) { }
Output for 5.4.39
string(1) "" array(0) { }
Output for 5.4.38
string(1) "" array(0) { }
Output for 5.4.37
string(1) "V" array(0) { }
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.32
Fatal error: Call to undefined function openssl_random_pseudo_bytes() in /in/54iKN on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/54iKN on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/54iKN on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/54iKN on line 4

preferences:
276.13 ms | 401 KiB | 339 Q