diff --git a/devel/sample.cpp.php b/devel/sample.cpp.php index 6fe624d..3d16ad9 100644 --- a/devel/sample.cpp.php +++ b/devel/sample.cpp.php @@ -522,6 +522,8 @@ do { } while (0); #endif +list($a, $b) = array(1, 2); + if ('if()') { echo 'if'; @@ -544,6 +546,10 @@ else { echo 'else'; } +if (!'if(!)') { + echo 'if(!)'; +} + while (false) { echo 'while'; } @@ -695,5 +701,6 @@ $callback = function($quantity, $product) use($tax, &$total) { }; #endif exit(); +exit(1); ?> diff --git a/lib/Decompiler.class.php b/lib/Decompiler.class.php index 5c73fea..2b605a1 100644 --- a/lib/Decompiler.class.php +++ b/lib/Decompiler.class.php @@ -671,7 +671,12 @@ class Decompiler } if (strpos($name, '\\') !== false) { - $this->namespace = strtok($name, '\\'); + $namespace = strtok($name, '\\'); + if ($namespace == $this->namespace) { + return; + } + + $this->namespace = $namespace; echo 'namespace ', $this->namespace, ";\n\n"; } @@ -1794,7 +1799,8 @@ class Decompiler } if (is_a($rvalue, 'Decompiler_Fetch')) { $src = str($rvalue->src, $EX); - if ('$' . unquoteName($src) == $lvalue) { + $name = unquoteName($src); + if ('$' . $name == $lvalue) { switch ($rvalue->fetchType) { case ZEND_FETCH_STATIC: $statics = &$EX['op_array']['static_variables']; @@ -2110,7 +2116,7 @@ class Decompiler // }}} case XC_EXIT: // {{{ $op1val = $this->getOpVal($op1, $EX); - $resvar = "exit($op1val)"; + $resvar = "exit(" . str($op1val) . ")"; break; // }}} case XC_INIT_ARRAY: