reverse-print-r icon indicating copy to clipboard operation
reverse-print-r copied to clipboard

Multiline text causes MalformedPrintROutputException: Could NOT find closing bracket of "Array"

Open lanort opened this issue 4 years ago • 3 comments

Thanks for creating this library. It helped a lot 🙏🙏

I found one issue when trying to parse an array with multiline text. For example:

<?php
        $data = <<<EOL
Array
(
    [id] => WH-123
    [resource] => Array
        (
            [id] => 1234
            [note_to_payer] => Hi,

this is a multiline text.

        )
)
EOL;

        $reverser = new ReversePrintR($data);
        print_r($reverser->reverse());

This causes:

ReversePrintR\Exception\MalformedPrintROutputException Could NOT find closing bracket of "Array" on line 13.

lanort avatar Aug 12 '20 08:08 lanort

Thank you, I was able to reproduce the issue. Will try to tackle it ASAP.

simivar avatar Aug 12 '20 14:08 simivar

I am very sorry that it takes so long to resolve but I need to re-think the way we do reversing to handle such cases.

simivar avatar Nov 11 '20 13:11 simivar

@simivar no worries. I just wanted to let you know there is a "bug". 😊

lanort avatar Nov 11 '20 14:11 lanort