Re: [PHP-DEV] var_export() array format

2018-02-20 Thread Derick Rethans
On Sun, 18 Feb 2018, Andreas Hennings wrote: > On 18 February 2018 at 02:04, David Rodrigues wrote: > > I just think that is not responsability of PHP to care about output format > > at core level (although we have the json pretty output support...). > > Why not? > E.g. JSON_PRETTY_PRINT is some

Re: [PHP-DEV] var_export() array format

2018-02-20 Thread Derick Rethans
On Sun, 18 Feb 2018, Andreas Hennings wrote: > I sometimes use var_export() to export a structured array and then > copy+paste it into my code. > And sometimes I use it as part of an automatic code generator. To iterate the purpose of var_export(): Output a variable structure in such a way that

Re: [PHP-DEV] var_export() array format

2018-02-17 Thread Paul Jones
> On Feb 17, 2018, at 18:27, Andreas Hennings wrote: > > What we can do is add a third parameter with flags. Big +1. When writing tests and setting the $expected value, one of the constantly recurring drudgeries is reformatting the correct var_export($actual) output from arrays to match the

Re: [PHP-DEV] var_export() array format

2018-02-17 Thread Andreas Hennings
On 18 February 2018 at 02:04, David Rodrigues wrote: > I just think that is not responsability of PHP to care about output format > at core level (although we have the json pretty output support...). Why not? E.g. JSON_PRETTY_PRINT is something I use a lot, often in situations where I don't or ca

Re: [PHP-DEV] var_export() array format

2018-02-17 Thread David Rodrigues
I just think that is not responsability of PHP to care about output format at core level (although we have the json pretty output support...). Maybe you can found some solution with packages. Em 17 de fev de 2018 10:28 PM, "Andreas Hennings" escreveu: > I sometimes use var_export() to export a