php-serialize
php-serialize copied to clipboard
How to serialize a object class with private and protected keys ?
At first, thanks for your helpful library. In some case I need serialize a js object with private and protected keys to PHP private, protected keys.
Any idea to help me ?
Hi @nicolasopt ! Thank you for reaching out. Javascript does not have protected keys, it does have private keys but I don't think we can access them outside the object to serialize them.
This may require us to make a pretty weird API. What's your use-case? Is it possible for you to use another way?
Thank you @steelbrain , My use-case:
- I want to serialize asgardPHP user object from nestjs API
- Then that serialize will be used in PHP API from asgard token. Seems I must to find other solution.