Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wierd var_dump() output for unserialized objects #64

Closed
rybakit opened this issue Oct 7, 2015 · 8 comments
Closed

Wierd var_dump() output for unserialized objects #64

rybakit opened this issue Oct 7, 2015 · 8 comments

Comments

@rybakit
Copy link
Contributor

rybakit commented Oct 7, 2015

Is there a reason to dump unserialized objects to such a specific format?

object(Obj)#%d (3) {
  ["a"]=>
  int(1)
  [%r"?b"?:protected"?%r]=>
  int(2)
  [%r"?c"?:("Obj":)?private"?%r]=>
  int(3)
}

To compare, here is a standard var_dump() output for the same object (https://3v4l.org/nXGBP):

object(Obj)#1 (3) { 
  ["a"]=> 
  int(1) 
  ["b":protected]=> 
  int(2) 
  ["c":"Obj":private]=> 
  int(3) 
}
@Sean-Der
Copy link
Member

Sean-Der commented Oct 7, 2015

Hi @rybakit

Is this in PHP 5 (and also is the behavior different in PHP 7)?

I think this is because we use the symtable operations, instead of the properties API? This wouldn't be hard to fix

@rybakit
Copy link
Contributor Author

rybakit commented Oct 7, 2015

Looks like this is only the case for PHP 5 (https://travis-ci.org/rybakit/travis-sandbox#L228-L235). It would be great to bring it in line with standard PHP output ;)

@Sean-Der
Copy link
Member

Sean-Der commented Oct 7, 2015

Yea totally! I agree it should be fixed.

I have a little bit of time this weekend, and will try my best to get it done then! If by Monday it isn't done feel free to poke me via GitHub/email and I will work on it right away.

thanks!

@rybakit
Copy link
Contributor Author

rybakit commented Oct 7, 2015

Great! Thank you very much for looking into it and the quick responses!

@rybakit
Copy link
Contributor Author

rybakit commented Oct 12, 2015

Hey @Sean-Der
Have you had a chance to look into the issue yet?

@Sean-Der
Copy link
Member

Hey @rybakit!

Sorry I got sick/burned out, so have been doing the bare minimum amount of work the past couple of days!

Sorry for the silence, this is still on my TODO list!

@rybakit
Copy link
Contributor Author

rybakit commented Oct 16, 2015

No worries and get better!

@m6w6
Copy link
Collaborator

m6w6 commented Nov 21, 2019

This is expected, %r encloses regexes in tests' EXPECTF sections.

@rybakit rybakit closed this as completed Dec 3, 2019
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

No branches or pull requests

3 participants