Skip to content

Conversation

@Nek-
Copy link

@Nek- Nek- commented Jan 17, 2020

  • bug fix (that is only bug exposition ATM)
  • BC break? no

Hello, I found this bug :(.

@dg
Copy link
Member

dg commented Jan 17, 2020

I can't see it.

@Nek-
Copy link
Author

Nek- commented Jan 17, 2020

@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 :/.

@JanTvrdik
Copy link
Contributor

JanTvrdik commented Jan 18, 2020

The current behavior is intentional. See

$keyPart = $k === $counter ? '' : $this->dumpVar($k) . ' => ';

Maybe there should be an option to disable this?

@dg
Copy link
Member

dg commented Jan 18, 2020

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'].

@Nek-
Copy link
Author

Nek- commented Jan 19, 2020

@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 :).

@dg
Copy link
Member

dg commented Jan 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants