z7zmey / php-parser

PHP parser written in Go
https://php-parser.com
MIT License
941 stars 63 forks source link

Json string not valid #110

Closed deenrookie closed 4 years ago

deenrookie commented 4 years ago

When I parsed this with jsondumper

<?php
class A{
    function a($b){
        eval($b);
    }
}
class B{
function __construct(){
        $this->session = new A();
    }
}
class C extends B{
}

class C extends B{
}

The output not right. But the site https://php-parser.com/ output is right. The site source code in open?

deenrookie commented 4 years ago

I have solved it. astString = strings.Replace(astString, "}{", "},{", -1)