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-- GH-12655 (proc_open(): Argument #2 ($descriptor_spec) must only contain arrays an..

Decoded Output download

--TEST--
GH-12655 (proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams [Descriptor item must be either an array or a File-Handle])
--FILE--
<?php

$descriptor_spec = [
    0 => [ "pipe", "r" ],  // stdin is a pipe that the child will read from
    1 => [ "pipe", "w" ],  // stdout is a pipe that the child will write to
    2 => [ "pipe", "w" ],  // stderr is a file to write to
];

foreach ( $descriptor_spec as $fd => &$d )
{
    // don't do anything, just the fact that we used "&$d" will sink the ship!
}

$proc = proc_open(PHP_BINARY, $descriptor_spec, $pipes);
echo $proc === false ? "FAILED
" : "SUCCEEDED
";

?>
--EXPECT--
SUCCEEDED

Did this file decode correctly?

Original Code

--TEST--
GH-12655 (proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams [Descriptor item must be either an array or a File-Handle])
--FILE--
<?php

$descriptor_spec = [
    0 => [ "pipe", "r" ],  // stdin is a pipe that the child will read from
    1 => [ "pipe", "w" ],  // stdout is a pipe that the child will write to
    2 => [ "pipe", "w" ],  // stderr is a file to write to
];

foreach ( $descriptor_spec as $fd => &$d )
{
    // don't do anything, just the fact that we used "&$d" will sink the ship!
}

$proc = proc_open(PHP_BINARY, $descriptor_spec, $pipes);
echo $proc === false ? "FAILED\n" : "SUCCEEDED\n";

?>
--EXPECT--
SUCCEEDED

Function Calls

None

Variables

None

Stats

MD5 270605c6170b6fc6d97eb8301b8569d0
Eval Count 0
Decode Time 80 ms