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-- increment and add edge cases --EXTENSIONS-- sodium --FILE-- <?php $notStr = 123;..

Decoded Output download

--TEST--
increment and add edge cases
--EXTENSIONS--
sodium
--FILE--
<?php

$notStr = 123;
try {
    sodium_increment($notStr);
} catch (SodiumException $e) {
    echo $e->getMessage(), "
";
}

$str = "abc";
$str2 = $str;
sodium_increment($str);
var_dump($str, $str2);

$str = "ab" . ($x = "c");
$str2 = $str;
sodium_increment($str);
var_dump($str, $str2);

$addStr = "";

$notStr = 123;
try {
    sodium_add($notStr, $addStr);
} catch (SodiumException $e) {
    echo $e->getMessage(), "
";
}

$str = "abc";
$str2 = $str;
sodium_add($str, $addStr);
var_dump($str, $str2);

$str = "ab" . ($x = "c");
$str2 = $str;
sodium_add($str, $addStr);
var_dump($str, $str2);

?>
--EXPECT--
a PHP string is required
string(3) "bbc"
string(3) "abc"
string(3) "bbc"
string(3) "abc"
PHP strings are required
string(3) "cbc"
string(3) "abc"
string(3) "cbc"
string(3) "abc"

Did this file decode correctly?

Original Code

--TEST--
increment and add edge cases
--EXTENSIONS--
sodium
--FILE--
<?php

$notStr = 123;
try {
    sodium_increment($notStr);
} catch (SodiumException $e) {
    echo $e->getMessage(), "\n";
}

$str = "abc";
$str2 = $str;
sodium_increment($str);
var_dump($str, $str2);

$str = "ab" . ($x = "c");
$str2 = $str;
sodium_increment($str);
var_dump($str, $str2);

$addStr = "\2\0\0";

$notStr = 123;
try {
    sodium_add($notStr, $addStr);
} catch (SodiumException $e) {
    echo $e->getMessage(), "\n";
}

$str = "abc";
$str2 = $str;
sodium_add($str, $addStr);
var_dump($str, $str2);

$str = "ab" . ($x = "c");
$str2 = $str;
sodium_add($str, $addStr);
var_dump($str, $str2);

?>
--EXPECT--
a PHP string is required
string(3) "bbc"
string(3) "abc"
string(3) "bbc"
string(3) "abc"
PHP strings are required
string(3) "cbc"
string(3) "abc"
string(3) "cbc"
string(3) "abc"

Function Calls

None

Variables

$notStr 123

Stats

MD5 71a2d37bd9b0736f9c994e5aaf823e99
Eval Count 0
Decode Time 92 ms