Decompiler: fixes #318 (support for const in static array index/value)
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1374 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
parent
0158af3733
commit
638209cbf9
|
@ -89,13 +89,14 @@ function foldToCode($src, $indent = '') // {{{ wrap or rewrap anything to Decomp
|
|||
// }}}
|
||||
function value($value, &$EX) // {{{
|
||||
{
|
||||
$spec = xcache_get_special_value($value);
|
||||
if (isset($spec)) {
|
||||
$value = $spec;
|
||||
if (!is_array($value)) {
|
||||
$originalValue = xcache_get_special_value($value);
|
||||
if (isset($originalValue)) {
|
||||
if ((xcache_get_type($value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
|
||||
// constant
|
||||
return $GLOBALS['__xcache_decompiler']->stripNamespace($value);
|
||||
return $GLOBALS['__xcache_decompiler']->stripNamespace($originalValue);
|
||||
}
|
||||
|
||||
$value = $originalValue;
|
||||
}
|
||||
|
||||
if (is_a($value, 'Decompiler_Object')) {
|
||||
|
|
|
@ -30,7 +30,18 @@ abstract class ClassName
|
|||
1 => 'str',
|
||||
CONST_VALUE => CONST_VALUE
|
||||
);
|
||||
static public $static2 = array(self::CONST_VALUE => self::CONST_VALUE);
|
||||
static public $static_const1 = CONST_VALUE;
|
||||
static public $static_const2 = self::CONST_VALUE;
|
||||
static public $static_const3 = ClassName::CONST_VALUE;
|
||||
static public $static_const4 = array(CONST_VALUE => 'test');
|
||||
static public $static_const5 = array(self::CONST_VALUE => 'test');
|
||||
static public $static_const6 = array(ClassName::CONST_VALUE => 'test');
|
||||
static public $static_const7 = array('test' => CONST_VALUE);
|
||||
static public $static_const8 = array('test' => self::CONST_VALUE);
|
||||
static public $static_const9 = array('test' => ClassName::CONST_VALUE);
|
||||
static public $static_const10 = array(CONST_VALUE => CONST_VALUE);
|
||||
static public $static_const11 = array(self::CONST_VALUE => self::CONST_VALUE);
|
||||
static public $static_const12 = array(ClassName::CONST_VALUE => ClassName::CONST_VALUE);
|
||||
/** doc */
|
||||
static public $public_static = array(2, 'str');
|
||||
/** doc */
|
||||
|
|
Loading…
Reference in New Issue