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 posix_getgrgid(). --CREDITS-- Till Klampaeckel, [email protected] TestFest Berlin..
Decoded Output download
--TEST--
Test posix_getgrgid().
--CREDITS--
Till Klampaeckel, [email protected]
TestFest Berlin 2009
--EXTENSIONS--
posix
--FILE--
<?php
$grp = posix_getgrgid(0);
if (!isset($grp['name'])) {
die('Array index "name" does not exist.');
}
if (!isset($grp['passwd'])) {
die('Array index "passwd" does not exist.');
}
if (!isset($grp['members'])) {
die('Array index "members" does not exist.');
} elseif (!is_array($grp['members'])) {
die('Array index "members" must be an array.');
} else {
if (count($grp['members']) > 0) {
foreach ($grp['members'] as $idx => $username) {
if (!is_int($idx)) {
die('Index in members Array is not an int.');
}
if (!is_string($username)) {
die('Username in members Array is not of type string.');
}
}
}
}
if (!isset($grp['gid'])) {
die('Array index "gid" does not exist.');
}
var_dump($grp['gid']);
?>
--EXPECT--
int(0)
Did this file decode correctly?
Original Code
--TEST--
Test posix_getgrgid().
--CREDITS--
Till Klampaeckel, [email protected]
TestFest Berlin 2009
--EXTENSIONS--
posix
--FILE--
<?php
$grp = posix_getgrgid(0);
if (!isset($grp['name'])) {
die('Array index "name" does not exist.');
}
if (!isset($grp['passwd'])) {
die('Array index "passwd" does not exist.');
}
if (!isset($grp['members'])) {
die('Array index "members" does not exist.');
} elseif (!is_array($grp['members'])) {
die('Array index "members" must be an array.');
} else {
if (count($grp['members']) > 0) {
foreach ($grp['members'] as $idx => $username) {
if (!is_int($idx)) {
die('Index in members Array is not an int.');
}
if (!is_string($username)) {
die('Username in members Array is not of type string.');
}
}
}
}
if (!isset($grp['gid'])) {
die('Array index "gid" does not exist.');
}
var_dump($grp['gid']);
?>
--EXPECT--
int(0)
Function Calls
posix_getgrgid | 1 |
Stats
MD5 | b28a1ee70975a964b7d0773fdb4a84ca |
Eval Count | 0 |
Decode Time | 115 ms |