somefile.php
<?php
//some php code
?>
<script>
MyObject.someVar = 'some_text';
</script>
This file results single quotes in JavaScript to be encoded:
<script>
MyObject.someVar = 'some_text';
</script>
But if double quotes were used everything will be okay. What may be the problem with single quotes?