Search in sources :

Example 1 with VarExport

use of php.runtime.memory.output.VarExport in project jphp by jphp-compiler.

the class InfoFunctions method var_export.

public static Memory var_export(Environment env, TraceInfo trace, @Runtime.Reference Memory value, boolean returned) {
    StringWriter writer = new StringWriter();
    VarExport printer = new VarExport(env, writer);
    printer.print(value);
    if (printer.isRecursionExists()) {
        env.warning(trace, "var_export does not handle circular references");
    }
    if (returned) {
        return new StringMemory(writer.toString());
    } else {
        env.echo(writer.toString());
        return Memory.TRUE;
    }
}
Also used : StringWriter(java.io.StringWriter) VarExport(php.runtime.memory.output.VarExport) StringMemory(php.runtime.memory.StringMemory)

Aggregations

StringWriter (java.io.StringWriter)1 StringMemory (php.runtime.memory.StringMemory)1 VarExport (php.runtime.memory.output.VarExport)1