Override parent method to accept custom property assigment
@param  mixed $var
@param  callable $func
@return void
354544
public function copyfrom($var,$func=NULL)
    {
        if (is_string($var)) {
            $var = Base::instance()->get($var);
        }
        if ($func) {
            $var = call_user_func($func, $var);
        }
        foreach ($var as $key=>$val) {
            if (
                array_key_exists($key, $this->fields)
                || array_key_exists($key, $this->extras)
            ) {
                $this->set($key,$val);
            }
        }
    }
278600
public function copyfrom($key,$func=NULL)
    {
        $var=is_array($key)?$key:Instance::get($key);
        if ($func)
            $var=call_user_func($func,$var);
        foreach ($var as $key=>$val)
            !isset($this->_properties['fields'][$key]) || $this->set($key, $val);

        return $this;
    }
20245
public function sort(callable $func = null, callable $ufunc = null, int $flags = 0): self
    {
        Arrays::sort($this->data, $func, $ufunc, $flags);

        return $this;
    }
711173
public function batch($var, $functions)
    {
        foreach (explode('|', $functions) as $function) {
            if (method_exists($this, $function)) {
                $var = call_user_func(array($this, $function), $var);
            } elseif (is_callable($function)) {
                $var = call_user_func($function, $var);
            } else {
                throw new Exception(
                    'The batch function could not find the "' . $function . '" function.'
                );
            }
        }

        return $var;
    }
310916
public function assign($variable, $property, ZephirVariable $symbolVariable, CompilationContext $compilationContext, $statement)
    {
        if (!$symbolVariable->isInitialized()) {
            throw new CompilerException("Cannot mutate variable '".$variable."' because it is not initialized", $statement);
        }

        /*
         * Arrays must be stored in the HEAP
         */
        if ($symbolVariable->isLocalOnly()) {
            throw new CompilerException("Cannot mutate variable '".$variable."' because it is local only", $statement);
        }

        if (!$symbolVariable->isInitialized()) {
            throw new CompilerException("Cannot mutate variable '".$variable."' because it is not initialized", $statement);
        }

        /*
         * Only dynamic variables can be used as arrays
         */
        if (!$symbolVariable->isVariable()) {
            throw new CompilerException("Cannot use variable type: '".$symbolVariable->getType()."' as array", $statement);
        }

        if ($symbolVariable->hasAnyDynamicType('unknown')) {
            throw new CompilerException('Cannot use non-initialized variable as an object', $statement);
        }

        /*
         * Trying to use a non-object dynamic variable as object
         */
        if ($symbolVariable->hasDifferentDynamicType(['undefined', 'object', 'null'])) {
            $compilationContext->logger->warning(
                'Possible attempt to increment non-object dynamic variable',
                ['non-object-update', $statement]
            );
        }

        /*
         * Check if the variable to update is defined
         */
        if ('this' == $symbolVariable->getRealName()) {
            $classDefinition = $compilationContext->classDefinition;
            if (!$classDefinition->hasProperty($property)) {
                throw new CompilerException("Class '".$classDefinition->getCompleteName()."' does not have a property called: '".$property."'", $statement);
            }
        } else {
            /*
             * If we know the class related to a variable we could check if the property
             * is defined on that class
             */
            if ($symbolVariable->hasAnyDynamicType('object')) {
                $classType = current($symbolVariable->getClassTypes());
                $compiler = $compilationContext->compiler;

                if ($compiler->isClass($classType)) {
                    $classDefinition = $compiler->getClassDefinition($classType);
                    if (!$classDefinition) {
                        throw new CompilerException('Cannot locate class definition for class: '.$classType, $statement);
                    }

                    if (!$classDefinition->hasProperty($property)) {
                        throw new CompilerException("Class '".$classType."' does not have a property called: '".$property."'", $statement);
                    }
                }
            }
        }

        $compilationContext->headersManager->add('kernel/object');
        $compilationContext->codePrinter->output('RETURN_ON_FAILURE(zephir_property_incr('.$symbolVariable->getName().', SL("'.$property.'") TSRMLS_CC));');
    }
1230269
private function addTo(string $func, $args)
    {
        // Only already existing attributes can get filled with the args
        if (!isset($this->{$func})) {
            Throw new HtmlException(sprintf('Type "%s" is not allowed as html property/attribute', $func));
        }

        // Do we have one argument or two?
        if (count($args) == 1) {

            // One argument and not an array means we have one single value to add
            // This is when you set attributes without values like selected, disabled etc.
            if (!is_array($args[0])) {
                $this->{$func}[$args[0]] = false;
            }
            else {
                // Check the arguments for assoc array and add arguments according to the
                // result of check as key, val or only as val
                $array = new IsAssoc($args[0]);

                if ($array->isAssoc()) {
                    foreach ($args[0] as $key => $val) {
                        $this->{$func}[$key] = $val;
                    }
                }
                else {
                    foreach ($args[0] as $val) {
                        $this->{$func}[$val] = false;
                    }
                }
            }
        }
        else {
            $this->{$func}[$args[0]] = $args[1];
        }
    }
26217
function setScriptCloudVariables($type, $id, $variables, $multicall = false)
    {
        if (!is_string($type)) {
            throw new InvalidArgumentException('type = ' . print_r($type, true));
        }
        if (!is_string($id)) {
            throw new InvalidArgumentException('id = ' . print_r($id, true));
        }
        if (!is_array($variables) || !$variables) {
            throw new InvalidArgumentException('variables = ' . print_r($variables, true));
        }

        return $this->execute(ucfirst(__FUNCTION__), array($type, $id, $variables), $multicall);
    }
1344937
public function setFunc($func)
    {
        if ($func === null) {
            $this->func = $func;
            return $this;
        }

        if (!is_string($func)) {
            throw new InvalidArgumentException(
                'Function name should be a string.'
            );
        }

        $func = strtoupper($func);
        if (!in_array($func, $this->validFunc())) {
            throw new InvalidArgumentException(sprintf(
                'Function "%s" not allowed in this context.',
                $func
            ));
        }

        $this->func = $func;
        return $this;
    }
139866
public void setFunctions(Map<String, String> funcs) {
        if (null == funcs || funcs.isEmpty()) {
            return;
        }
        functions = funcs;
    }
510131
public function exists(callable $func)
    {
        $isExists = false;

        foreach ($this->elements as $key => $value) {
            if ($func($key, $value)) {
                $isExists = true;
                break;
            }
        }

        return $isExists;
    }
558842
function doMember(func) {
        /*jshint validthis:true*/
        func = func || this;

        // Check if it is a named func already
        if (func[$name]) {
            return func;
        }

        var caller = process._dejavu.caller;

        // Check if outside the instance/class
        if (!caller) {
            throw new Error('Attempting to mark a function as a member outside an instance/class.');
        }

        // Check if already marked as anonymous
        if (func[$anonymous]) {
            throw new Error('Function is already marked as an member.');
        }

        func[$anonymous] = true;
        func = wrapMethod(null, func, caller.constructor);
        func[$anonymous] = true;

        return func;
    }
953035
public function value(callable $callback, $value, $key = null): void
    {
        $input = $this->resolve($value);

        if (!$input->isValid()) {
            return;
        }

        call_user_func($callback, $input->value(), $key);
    }
906324
public function registerFunction($name, $func, $prototype = null)
    {
        $this->userFunctions[$this->normalizeName($name)] = [$func, $prototype];
    }
1325558
public function _set($name, $value)
    {
        $object = $this->getObject();
		$callable = function() use ($name, $value, $object) {
			if (!property_exists($object, $name) && !method_exists($object, '__set'))
			{
				throw new \Exception('Property ' . $name . ' doesn\'t exist on object of class ' . get_class($object));
			}
			$object->$name = $value;
		};
		$this->breakScopeAndExecute($callable);
    }
602392
public void sort(String func) {
        if (func == null || func.isEmpty()) {
            Object ary = invokeJavascript("sort");
        } else {
            Object ary = invokeJavascript("sort", func);
        }
    }
643164
function(oThis, sName, oValue, fDomAdaptationCallback){
		if (!oThis.getDomRef()) {
			oThis.setProperty(sName, oValue);
			return;
		}
		var bSkipUpdate = fDomAdaptationCallback.apply(oThis, []);
		if (!bSkipUpdate) {
			oThis.setProperty(sName, oValue, true);
		}
	}
851105
public function callback($callback, $func, $args=array())
	{
		// Make sure the callback is set (this is protecting us when running in non-interactive mode and callbacks aren't set)
		if (!isset($this->callbacks[$callback]))
		{
			return false;
		}

		// Call function
		return call_user_func_array(array($this->callbacks[$callback], $func), $args);
	}