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 #53427 + emulate_read (stream_select does not preserve keys) --FILE-- <?php $..

Decoded Output download

--TEST--
Bug #53427 + emulate_read (stream_select does not preserve keys)
--FILE--
<?php
$read[1] = fopen(__FILE__, 'r');
$read['myindex'] = reset($read);
$write = NULL;
$except = NULL;

var_dump($read);
stream_select($read, $write, $except, 0);
var_dump($read);
fread(reset($read), 1);
stream_select($read, $write, $except, 0); // // emulate_read
var_dump($read);
?>
--EXPECTF--
array(2) {
  [1]=>
  resource(%d) of type (stream)
  ["myindex"]=>
  resource(%d) of type (stream)
}
array(2) {
  [1]=>
  resource(%d) of type (stream)
  ["myindex"]=>
  resource(%d) of type (stream)
}
array(2) {
  [1]=>
  resource(%d) of type (stream)
  ["myindex"]=>
  resource(%d) of type (stream)
}

Did this file decode correctly?

Original Code

--TEST--
Bug #53427 + emulate_read (stream_select does not preserve keys)
--FILE--
<?php
$read[1] = fopen(__FILE__, 'r');
$read['myindex'] = reset($read);
$write = NULL;
$except = NULL;

var_dump($read);
stream_select($read, $write, $except, 0);
var_dump($read);
fread(reset($read), 1);
stream_select($read, $write, $except, 0); // // emulate_read
var_dump($read);
?>
--EXPECTF--
array(2) {
  [1]=>
  resource(%d) of type (stream)
  ["myindex"]=>
  resource(%d) of type (stream)
}
array(2) {
  [1]=>
  resource(%d) of type (stream)
  ["myindex"]=>
  resource(%d) of type (stream)
}
array(2) {
  [1]=>
  resource(%d) of type (stream)
  ["myindex"]=>
  resource(%d) of type (stream)
}

Function Calls

fopen 1
reset 1

Variables

$read [{'key': 1, 'value': True}]

Stats

MD5 fc94a220cff02341a5059d6354a92e14
Eval Count 0
Decode Time 76 ms