laracasts/PHP-Vars-To-Js-Transformer — pull request #22 by zaccrites (2014-08-11 03:30:05+00:00)
Title: replaced json_encode with recursive array/object-literal encoding

I encountered a problem with json_encode in that it cannot echo object literals or raw expressions (eg, functions or variable names).

This will recursively create object literals or arrays as necessary.