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

Dynamically rename a class #83

Open
JoyceBabu opened this issue May 10, 2015 · 3 comments
Open

Dynamically rename a class #83

JoyceBabu opened this issue May 10, 2015 · 3 comments

Comments

@JoyceBabu
Copy link

Is it possible to dynamically rename a class?

@jnbdz
Copy link

jnbdz commented Sep 14, 2015

It is, well it's methods:

http://php.net/manual/en/function.runkit-method-redefine.php

@zenovich
Copy link
Owner

@JoyceBabu I can add this feature at least for user classes, but we need to figure out how it should affect the class' objects, the class' succesors, their objects, code lines which use the class and so on.

@ramsey
Copy link

ramsey commented Mar 3, 2017

I have a similar use-case for testing purposes. I want to dynamically unload a class if it's already loaded into memory and then use class_alias() to alias another class to the same name. If I could rename the class with runkit, then, presumably, I wouldn't need to unload it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants