3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $length = 10; $bytes = openssl_random_pseudo_bytes(2); $longs = unpack("S*", $bytes); var_dump($bytes); var_dump($longs); foreach ($longs as $long) { var_dump($long / 0xffff); }
based on 54iKN
Output for 7.1.0
string(2) "h�" array(1) { [1]=> int(41576) } float(0.63440909437705)
Output for 7.0.14
string(2) "�" array(1) { [1]=> int(1493) } float(0.022781719691768)
Output for 7.0.6
string(2) "��" array(1) { [1]=> int(40616) } float(0.61976043335622)
Output for 7.0.5
string(2) "�" array(1) { [1]=> int(44054) } float(0.67222095063706)
Output for 7.0.4
string(2) "&" array(1) { [1]=> int(7974) } float(0.12167544060426)
Output for 7.0.3
string(2) "! " array(1) { [1]=> int(3105) } float(0.047379262989242)
Output for 7.0.2
string(2) "P" array(1) { [1]=> int(20503) } float(0.31285572594797)
Output for 7.0.1
string(2) "�'" array(1) { [1]=> int(10193) } float(0.15553521019303)
Output for 7.0.0
string(2) "�]" array(1) { [1]=> int(24013) } float(0.36641489280537)
Output for hhvm-3.12.0
string(2) "HP" array(1) { [1]=> int(20552) } float(0.3136034180209)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.28
string(2) "[X" array(1) { [1]=> int(22619) } float(0.34514381628138)
Output for 5.6.21
string(2) "\�" array(1) { [1]=> int(53852) } float(0.8217288471809)
Output for 5.6.20
string(2) "��" array(1) { [1]=> int(55494) } float(0.84678416113527)
Output for 5.6.19
string(2) "��" array(1) { [1]=> int(42399) } float(0.64696726939803)
Output for 5.6.18
string(2) "U�" array(1) { [1]=> int(37717) } float(0.5755245288777)
Output for 5.6.17
string(2) "Xs" array(1) { [1]=> int(29528) } float(0.45056839856565)
Output for 5.6.16
string(2) "k�" array(1) { [1]=> int(33387) } float(0.509452964065)
Output for 5.6.15
string(2) "�" array(1) { [1]=> int(8123) } float(0.12394903486687)
Output for 5.6.14
string(2) "�E" array(1) { [1]=> int(17794) } float(0.27151903562982)
Output for 5.6.13
string(2) "��" array(1) { [1]=> int(41876) } float(0.63898680094606)
Output for 5.6.12
string(2) "d�" array(1) { [1]=> int(40292) } float(0.61481651026169)
Output for 5.6.11
string(2) "��" array(1) { [1]=> int(32956) } float(0.50287632562753)
Output for 5.6.10
string(2) "�" array(1) { [1]=> int(48415) } float(0.73876554512856)
Output for 5.6.9
string(2) "I]" array(1) { [1]=> int(23881) } float(0.36440070191501)
Output for 5.6.8
string(2) "�b" array(1) { [1]=> int(25296) } float(0.38599221789883)
Output for 5.5.35
string(2) "�`" array(1) { [1]=> int(24827) } float(0.37883573662928)
Output for 5.5.34
string(2) "5" array(1) { [1]=> int(1333) } float(0.020340276188296)
Output for 5.5.33
string(2) "o�" array(1) { [1]=> int(34415) } float(0.52513923857481)
Output for 5.5.32
string(2) "��" array(1) { [1]=> int(38030) } float(0.58030060273136)
Output for 5.5.31
string(2) "ar" array(1) { [1]=> int(29281) } float(0.44679942015717)
Output for 5.5.30
string(2) "�:" array(1) { [1]=> int(15051) } float(0.22966353856718)
Output for 5.5.29
string(2) "J" array(1) { [1]=> int(4938) } float(0.075349050125887)
Output for 5.5.28
string(2) "�" array(1) { [1]=> int(41728) } float(0.63672846570535)
Output for 5.5.27
string(2) "�" array(1) { [1]=> int(62982) } float(0.96104371709773)
Output for 5.5.26
string(2) "^�" array(1) { [1]=> int(60254) } float(0.91941710536355)
Output for 5.5.25
string(2) "F�" array(1) { [1]=> int(54598) } float(0.83311207751583)
Output for 5.5.24
string(2) "[�" array(1) { [1]=> int(46939) } float(0.71624322880903)
Output for 5.4.45
string(2) "u)" array(1) { [1]=> int(10613) } float(0.16194399938964)
Output for 5.4.44
string(2) "" array(1) { [1]=> int(32518) } float(0.49619287403677)
Output for 5.4.43
string(2) "��" array(1) { [1]=> int(57311) } float(0.87450980392157)
Output for 5.4.42
string(2) "�N" array(1) { [1]=> int(20126) } float(0.30710307469291)
Output for 5.4.41
string(2) "�" array(1) { [1]=> int(6334) } float(0.096650644693675)
Output for 5.4.40
string(2) "z�" array(1) { [1]=> int(36730) } float(0.56046387426566)
Output for 5.4.39
string(2) "~�" array(1) { [1]=> int(44414) } float(0.67771419851987)
Output for 5.4.38
string(2) "p�" array(1) { [1]=> int(54640) } float(0.83375295643549)
Output for 5.4.37
string(2) "[" array(1) { [1]=> int(23311) } float(0.35570305943389)
Output for 5.4.36
string(2) "�N" array(1) { [1]=> int(20114) } float(0.30691996643015)
Output for 5.4.35
string(2) ";�" array(1) { [1]=> int(43067) } float(0.65716029602502)
Output for 5.4.34
string(2) "��" array(1) { [1]=> int(52722) } float(0.80448615243763)
Output for 5.0.0 - 5.4.32
Fatal error: Call to undefined function openssl_random_pseudo_bytes() in /in/Apk6t 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/Apk6t on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/Apk6t 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/Apk6t on line 4