Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Test error operation of random_bytes() --FILE-- <?php //-=-=-=- try { $bytes..

Decoded Output download

--TEST--
Test error operation of random_bytes()
--FILE--
<?php
//-=-=-=-

try {
    $bytes = random_bytes();
} catch (TypeError $e) {
    echo $e->getMessage().PHP_EOL;
}

try {
    $bytes = random_bytes(0);
} catch (Error $e) {
    echo $e->getMessage().PHP_EOL;
}

?>
--EXPECT--
random_bytes() expects exactly 1 argument, 0 given
random_bytes(): Argument #1 ($length) must be greater than 0

Did this file decode correctly?

Original Code

--TEST--
Test error operation of random_bytes()
--FILE--
<?php
//-=-=-=-

try {
    $bytes = random_bytes();
} catch (TypeError $e) {
    echo $e->getMessage().PHP_EOL;
}

try {
    $bytes = random_bytes(0);
} catch (Error $e) {
    echo $e->getMessage().PHP_EOL;
}

?>
--EXPECT--
random_bytes() expects exactly 1 argument, 0 given
random_bytes(): Argument #1 ($length) must be greater than 0

Function Calls

None

Variables

None

Stats

MD5 f3bda0543b9511553aea2ec25ae50cae
Eval Count 0
Decode Time 89 ms