Index: /trunk/Decompiler.class.php
===================================================================
--- /trunk/Decompiler.class.php	(revision 753)
+++ /trunk/Decompiler.class.php	(revision 754)
@@ -267,7 +267,7 @@
 			$dim->value = $this->src;
 			if (!isset($dim->assign)) {
-				return foldToCode($dim, $indent);
-			}
-			return foldToCode($this->dims[0]->assign, $indent) . ' = ' . str($dim, $indent);
+				return str($dim, $indent);
+			}
+			return str($this->dims[0]->assign, $indent) . ' = ' . str($dim, $indent);
 		}
 		/* flatten dims */
@@ -280,5 +280,5 @@
 			$assign = foldToCode($dim->assign, $indent);
 		}
-		return $this->toList($assigns) . ' = ' . str($this->src, $indent);
+		return str($this->toList($assigns)) . ' = ' . str($this->src, $indent);
 	}
 
@@ -1104,5 +1104,5 @@
 					if (is_a($rvalue, 'Decompiler_Fetch')) {
 						$src = str($rvalue->src, $EX);
-						if (substr($src, 1, -1) == substr($lvalue, 1)) {
+						if ('$' . unquoteName($src) == $lvalue) {
 							switch ($rvalue->fetchType) {
 							case ZEND_FETCH_GLOBAL:
@@ -1113,7 +1113,8 @@
 								$statics = &$EX['op_array']['static_variables'];
 								$resvar = 'static ' . $lvalue;
-								$name = substr($src, 1, -1);
+								$name = unquoteName($src);
 								if (isset($statics[$name])) {
 									$var = $statics[$name];
+									var_dump(str(value($statics)));
 									$resvar .= ' = ';
 									$resvar .= str(value($var), $EX);
@@ -1126,5 +1127,5 @@
 					}
 					// TODO: PHP_6 global
-					$rvalue = foldToCode($rvalue, $EX);
+					$rvalue = str($rvalue, $EX);
 					$resvar = "$lvalue = &$rvalue";
 					break;
