Crell / enum-comparison

A comparison of enumerations and similar features in different languages
80 stars 7 forks source link

var_export() #47

Closed Crell closed 3 years ago

Crell commented 3 years ago

Right now, it produces a __set_state-based output that populates a class. That's almost certainly wrong.

Instead, probably just produce the FQCN of the case so that = works correctly.

iluuu1994 commented 3 years ago

Good point. I'm not super-familiar with var_export but I'll look into it. We might just auto-implement __set_state and return the given constant. Edit Or probably better yet just drop the __set_state call.

iluuu1994 commented 3 years ago

This is now handled correctly.