function preStateMagic($name, $value) { parent::preStateMagic($name, $value); if ($this->arrayElementStarted == false) { if ($name == 'T_LNUMBER' || $name == 'T_VARIABLE' || $name == 'T_CONSTANT_ENCAPSED_STRING' || $name == 'T_ARRAY' || $name == '[') { //another embedded array. $this->addJS(ARRAY_ELEMENT_START_MAGIC); $this->arrayElementStarted = true; } //TODO - this needs to happen when the double arrow is encountered. // if ($name == 'T_LNUMBER'){ // // If someone is mixing automatic with numbered arrays, attempt to support it // // by continuing the automatic key after their numbered key // $this->keyCount = intval($value) + 1; // } } if ($name == 'T_DOUBLE_ARROW') { $this->doubleArrayUsed = TRUE; } if ($name == ',' || $name == ')') { //Array element has ended. $this->fixupArrayIndex(); } }
function scopePreStateMagic($name, $value) { $this->currentScope->preStateMagic($name, $value); }