Compiler.php
protected function exportArray(array $array, $quoteStyle = '\'')
    {

        $pairs = [];
        foreach ($array as $key => $val) {

            $pair = $this->exportScalar($key, $quoteStyle).' => ';

            if (is_array($val))
                $pair .= $this->exportArray($val, $quoteStyle);
            else if ($this->isVariable($val))
                $pair .= "isset($val) ? $val : null";
            else if ($this->isScalar($val) || in_array($val, [true, false, null], true))
                $pair .= $this->exportScalar($val, $quoteStyle);
            else
                $pair .= (string)$val;

            $pairs[] = $pair;
        }

        return '['.implode(', ', $pairs).']';
    }
protected function exportArray(array $array, $quoteStyle = '\'')
    {

        $pairs = [];
        foreach ($array as $key => $val) {

            $pair = $this->exportScalar($key, $quoteStyle).' => ';

            if (is_array($val))
                $pair .= $this->exportArray($val, $quoteStyle);
            else if ($this->isVariable($val))
                $pair .= "isset($val) ? $val : null";
            else if ($this->isScalar($val) || in_array($val, [true, false, null], true))
                $pair .= $this->exportScalar($val, $quoteStyle);
            else
                $pair .= (string)$val;

            $pairs[] = $pair;
        }

        return '['.implode(', ', $pairs).']';
    }
protected function exportArray ( array $ array , $ quoteStyle = '\'' ) { $ pairs = [ ] ; foreach ( $ array as $ key => $ val ) { $ pair = $ this -> exportScalar ( $ key , $ quoteStyle ) . ' => ' ; if ( is_array ( $ val ) ) $ pair .= $ this -> exportArray ( $ val , $ quoteStyle ) ; else if ( $ this -> isVariable ( $ val ) ) $ pair .= "isset($val) ? $val : null" ; else if ( $ this -> isScalar ( $ val ) || in_array ( $ val , [ true , false , null ] , true ) ) $ pair .= $ this -> exportScalar ( $ val , $ quoteStyle ) ; else $ pair .= ( string ) $ val ; $ pairs [ ] = $ pair ; } return '[' . implode ( ', ' , $ pairs ) . ']' ; }
Exports an array to a PHP-string recursively.

This works similar to var_export in PHP, with the difference
that it won't try to convert PHP-expression-style strings,
e.g. variables, scalar values like null, false, true and
expressions like arrays or function calls

@param array $array the array to export
@param string $quoteStyle the quote-style used, ' by default

@return string the exported array
Exports an array to a PHP - string recursively .