summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2013-07-15 09:32:39 +0000
committerXuefer <xuefer@gmail.com>2013-07-15 09:32:39 +0000
commit66bda120973e6d5b46305fd76b4498e151cd7cbe (patch)
treea362955f7164bf9e3778d74ebafa77b353678f52
parentc9913ec0ac4000545627a436b81e1a9516c378d9 (diff)
downloadxcache-66bda120973e6d5b46305fd76b4498e151cd7cbe.tar.gz
xcache-66bda120973e6d5b46305fd76b4498e151cd7cbe.zip
Decompiler: update static member support for PHP 5.0
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1318 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
-rw-r--r--lib/Decompiler.class.php38
1 files changed, 14 insertions, 24 deletions
diff --git a/lib/Decompiler.class.php b/lib/Decompiler.class.php
index 0e03f94..e50ac55 100644
--- a/lib/Decompiler.class.php
+++ b/lib/Decompiler.class.php
@@ -2525,36 +2525,27 @@ class Decompiler
}
// }}}
// {{{ properties
- $default_static_members = $class[ZEND_ENGINE_2_1 ? 'default_static_members' : 'static_members'];
+ if (!ZEND_ENGINE_2_4) {
+ $default_static_members = $class[ZEND_ENGINE_2_1 ? 'default_static_members' : 'static_members'];
+ }
$member_variables = $class['properties_info'];
if ($member_variables) {
echo "\n";
- foreach ($member_variables as $name => $dummy) {
- $info = isset($class['properties_info'][$name]) ? $class['properties_info'][$name] : null;
- if (isset($info)) {
- if (!empty($info['doc_comment'])) {
- echo $newindent;
- echo $info['doc_comment'];
- echo "\n";
- }
+ foreach ($member_variables as $name => $info) {
+ if (!empty($info['doc_comment'])) {
+ echo $newindent;
+ echo $info['doc_comment'];
+ echo "\n";
}
echo $newindent;
- $static = false;
- if (isset($info)) {
- if ($info['flags'] & ZEND_ACC_STATIC) {
- $static = true;
- }
- }
- else if (isset($default_static_members[$name])) {
- $static = true;
- }
+ $static = ($info['flags'] & ZEND_ACC_STATIC);
if ($static) {
echo "static ";
}
- $mangled = false;
+ $mangleSuffix = '';
if (!isset($info)) {
echo 'public ';
}
@@ -2568,23 +2559,22 @@ class Decompiler
break;
case ZEND_ACC_PRIVATE:
echo "private ";
- $mangled = true;
+ $mangleSuffix = "\000";
break;
case ZEND_ACC_PROTECTED:
echo "protected ";
- $mangled = true;
+ $mangleSuffix = "\000";
break;
}
}
echo '$', $name;
- if (isset($info['offset'])) {
+ if (ZEND_ENGINE_2_4) {
$value = $class[$static ? 'default_static_members_table' : 'default_properties_table'][$info['offset']];
}
else {
- $key = isset($info) ? $info['name'] . ($mangled ? "\000" : "") : $name;
-
+ $key = $info['name'] . $mangleSuffix;
if ($static) {
$value = $default_static_members[$key];
}