Permalink
Browse files

Fix superglobal-access not to cause warnings, since they are initialized

  • Loading branch information...
steffen
steffen committed May 2, 2015
1 parent e8b442d commit 5a1205beb553f51b2e0065e4b653354a03bb7cdb
Showing with 7 additions and 5 deletions.
  1. +7 −5 Library/SymbolTable.php
@@ -193,11 +193,11 @@ public function getVariableForRead($name, CompilationContext $compilationContext
*/
$compilationContext->codePrinter->output('zephir_get_global(&' . $name . ', SS("' . $name . '") TSRMLS_CC);');
$superVar = new Variable('variable', $name, $compilationContext->currentBranch);
$superVar->setIsInitialized(true, $compilationContext, $statement);
$superVar->setDynamicTypes('array');
$superVar->setIsExternal(true);
$this->variables[$name] = $superVar;
$variable = new Variable('variable', $name, $compilationContext->currentBranch);
$variable->setIsInitialized(true, $compilationContext, $statement);
$variable->setDynamicTypes('array');
$variable->setIsExternal(true);
$this->variables[$name] = $variable;
} else {
$found = false;
$variable = $this->getVariable($name);
@@ -211,6 +211,8 @@ public function getVariableForRead($name, CompilationContext $compilationContext
$compilationContext->codePrinter->output('zephir_get_global(&' . $name . ', SS("' . $name . '") TSRMLS_CC);');
}
}
$variable->increaseUses();
return $variable;
}
if (!$this->hasVariable($name)) {

0 comments on commit 5a1205b

Please sign in to comment.