Closed Nek- closed 4 years ago
I can't see it.
@dg what can't you see? (the test failure is not good enough for you?)
I was not able to make a good fix for it :/.
The current behavior is intentional. See https://github.com/nette/php-generator/blob/fd5e55cdd652efbce5878a4d56584059bd9b0802/src/PhpGenerator/Dumper.php#L102
Maybe there should be an option to disable this?
Ok I get it. But it's not a bug, just a cosmetic thing because [606990006 => 'bar', 606990007 => 'baz']
is the same as [606990006 => 'bar', 'baz']
.
@dg absolutely. But this is also assuming PHP behaves like that, which is weird. And I think all weird stuff should not be considered as "this is good".
Of course, it's also extremely disturbing for people that will use generated classes, that's mostly why I'm suggesting to support this.
An option is probably the better idea, yes :).
I would not call it a weird, it is a documented standard behavior that I like to use, for example in $months = [1 => 'January', 'February', 'March', 'April', 'May', 'June', ...]
. But I understand that in the dumps where most keys are present, the missing ones are confusing.
Hello, I found this bug :(.