Remove restriction from script execution

In my automation script I really need to do something like:
<pre><code>$remoteWebDriver->executeScript('myWindow = window.open("", "My Window", "width=640,height=480,resizable,scrollbars");
myWindow.listOfPlaceholders = arguments[0];
myWindow.document.write("&lt;!doctype html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n ... A LOT OF HTML HERE ... &lt;\/body&gt;\n&lt;\/html&gt;");', array($placeholders));</code></pre>
In my case **$placeholders** is array, which caused exception. And the escaping of script code made impossible to send my html to JS. Am I doing something wrong? Do you plan to make such things possible to do?