public function marshall()
    {
        $ctx = $this->getContext();
        $access = $ctx->getStreamAccess();
        $array = $this->getToMarshall();
        $args = new PhpArgumentCollection();

        foreach ($array as $a) {
            if (PhpUtils::isScalar($a) === false) {
                $msg = "The PhpArrayMarshaller class only deals with PHP scalar values, object or resource given.";
                throw new PhpMarshallingException($msg);
            }

            $args[] = new PhpArgument($a);
        }

        $arrayVarName = $ctx->generateVariableName($array);
        $access->writeVariable($arrayVarName);
        $access->writeEquals($ctx->mustFormatOutput());
        $access->writeFunctionCall('array', $args);
        $access->writeSemicolon($ctx->mustFormatOutput());

        $ctx->pushOnVariableStack($arrayVarName);
    }