P粉6158866602023-09-06 11:48:23
This is indeed an ambitious goal; so ambitious that it would be foolish to try.
Now, you probably don't really mean "can do anything for anyone", but the fact that you're trying to express that without setting any limits is relevant to your question. This makes it unnecessarily difficult for you to find a serialization format.
For example, you mentioned Resources, which PHP uses for things like database connections, opening file handles, etc. They are ephemeral pointers to something that live for a while and then disappear, and serializing them is not only unsupported in PHP, but also makes almost no sense.
Instead of trying to cover "everything", you need to consider what types of data you actually need to process. Maybe you'll mainly use classes defined within the system, so you can define any format you want to represent them. Maybe you want to process an arbitrary collection of key-value pairs, in the form of a PHP array. You might want to leave room for future extensions, but that's just about flexibility of the format, not a concrete answer right now.
From there, you can look for the property you want and shop around:
Obviously, the list is endless...