--FILE--
<?php
$env = new MtHaml\Environment('php', array('enable_escaper' => true));
echo $env->compileString($parts['HAML'], "$file.haml");
--HAML--
%html
    %body{:some=> "attr& #{$foo}"}
        %p{"#{$foo}" => "foo"}(z=$x)
            = "escaped"
            &= "escaped"
            != "not escaped"
--EXPECT--
<html>
  <body <?php echo MtHaml\Runtime::renderAttributes(array(array('some', ('attr& ' . $foo))), 'html5', 'UTF-8'); ?>>
    <p <?php echo MtHaml\Runtime::renderAttributes(array(array($foo, 'foo'), array('z', $x)), 'html5', 'UTF-8'); ?>>
      <?php echo htmlspecialchars("escaped",ENT_QUOTES,'UTF-8'); ?>
      <?php echo htmlspecialchars("escaped",ENT_QUOTES,'UTF-8'); ?>
      <?php echo "not escaped"; ?>
    </p>
  </body>
</html>

