removeArrayValue example

/** * Post initialize operations * * @return void */
    protected function postInit()
    {
        //Remove exponentiation operator if the feature         //is not enabled         if (!$this->features->exponentiationOperator) {
            Utils::removeArrayValue(
                $this->assignmentOperators,
                "**="
            );
            unset($this->logicalBinaryOperators["**"]);
        }

        //Remove coalescing operator if the feature         //is not enabled         if (!$this->features->coalescingOperator) {
            unset($this->logicalBinaryOperators["??"]);
        }

        
foreach (array("whitespaces", "lineTerminators") as $key) {
            foreach ($this->$key as $i => $char) {
                if (is_int($char)) {
                    $this->{$key}[$i] = Utils::unicodeToUtf8($char);
                }
            }
        }

        //Remove exponentiation operator if the feature         //is not enabled         if (!$this->features->exponentiationOperator) {
            Utils::removeArrayValue($this->punctuators, "**");
            Utils::removeArrayValue($this->punctuators, "**=");
        }

        if (!$this->features->optionalChaining) {
            Utils::removeArrayValue($this->punctuators, "?.");
        }

        //Remove logical assignment operators if the feature         //is not enabled         if (!$this->features->logicalAssignmentOperators) {
            Utils::removeArrayValue($this->punctuators, "&&=");
            
Home | Imprint | This part of the site doesn't use cookies.