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-- Bug #25745 (ctype functions fail with non-ascii characters) --EXTENSIONS-- ctype ..

Decoded Output download

--TEST--
Bug #25745 (ctype functions fail with non-ascii characters)
--EXTENSIONS--
ctype
--INI--
error_reporting=E_ALL&~E_DEPRECATED
--FILE--
<?php
$funcs = array(
    "ctype_alnum", "ctype_alpha", "ctype_cntrl", "ctype_digit",
    "ctype_graph", "ctype_lower", "ctype_print", "ctype_punct",
    "ctype_space", "ctype_upper", "ctype_xdigit"
);

foreach ($funcs as $ctype_func) {
    for ($i = 0; $i < 256; $i++) {
        $a = $ctype_func($i);
        $b = $ctype_func(chr($i));
        if ($a != $b) {
            echo "broken... $ctype_func($i) = $a, $ctype_func(chr($i)) = $b
";
            exit;
        }
    }
}
echo "ok
";
?>
--EXPECT--
ok

Did this file decode correctly?

Original Code

--TEST--
Bug #25745 (ctype functions fail with non-ascii characters)
--EXTENSIONS--
ctype
--INI--
error_reporting=E_ALL&~E_DEPRECATED
--FILE--
<?php
$funcs = array(
    "ctype_alnum", "ctype_alpha", "ctype_cntrl", "ctype_digit",
    "ctype_graph", "ctype_lower", "ctype_print", "ctype_punct",
    "ctype_space", "ctype_upper", "ctype_xdigit"
);

foreach ($funcs as $ctype_func) {
    for ($i = 0; $i < 256; $i++) {
        $a = $ctype_func($i);
        $b = $ctype_func(chr($i));
        if ($a != $b) {
            echo "broken... $ctype_func($i) = $a, $ctype_func(chr($i)) = $b\n";
            exit;
        }
    }
}
echo "ok\n";
?>
--EXPECT--
ok

Function Calls

ctype_alnum 1

Variables

$i 0
$funcs [{'key': 0, 'value': 'ctype_alnum'}, {'key': 1, 'value': 'ctype_alpha'}, {'key': 2, 'value': 'ctype_cntrl'}, {'key': 3, 'value': 'ctype_digit'}, {'key': 4, 'value': 'ctype_graph'}, {'key': 5, 'value': 'ctype_lower'}, {'key': 6, 'value': 'ctype_print'}, {'key': 7, 'value': 'ctype_punct'}, {'key': 8, 'value': 'ctype_space'}, {'key': 9, 'value': 'ctype_upper'}, {'key': 10, 'value': 'ctype_xdigit'}]
$ctype_func ctype_alnum

Stats

MD5 41617662c9190be286167847df9f27c5
Eval Count 0
Decode Time 108 ms