Search in sources :

Example 1 with Printer

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

the class InfoFunctions method print_r.

public static Memory print_r(Environment env, @Runtime.Reference Memory value, boolean returned) {
    StringWriter writer = new StringWriter();
    Printer printer = new PrintR(env, writer);
    printer.print(value);
    if (returned) {
        return new StringMemory(writer.toString());
    } else {
        env.echo(writer.toString());
        return Memory.TRUE;
    }
}
Also used : StringWriter(java.io.StringWriter) StringMemory(php.runtime.memory.StringMemory) Printer(php.runtime.memory.output.Printer) PrintR(php.runtime.memory.output.PrintR)

Aggregations

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