On 19-01-2021 16:12, tyson andre wrote: > It seems inconsistent and prone to bugs when refactoring (e.g. converting to > string and not using the result) > to have two functions named var_export where one prints by default and the > other doesn't, but otherwise . > Changing to a different name entirely would solve that, such as var_repr(), > var_representation(), serialize_[value_]as_php_snippet(), etc. >
I am considering to try and introduce a __repr() magic method that is similar to the __repr__() method from Python. Having a var_repr() method which does not use the __repr() method would be confusing. So I would like to suggest not to use that name. As the intent of the resulting string is to obtain PHP code that will construct the variable, another option might be: var_constructor(). Regards, Dik Takken -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php