Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can class_alias() be undone?

Tags:

php

Let's say that in a unit test I want to use class_alias() to substitute a fake class for one that would normally be used:

class_alias('MyFakeTestingClass', 'Some\Real\Class\Somewhere');

Is there any way to undo this operation so that Some\Real\Class\Somewhere can go back to being used normally afterward? This does not work:

class_alias('Some\Real\Class\Somewhere', 'Some\Real\Class\Somewhere');
like image 516
chaos Avatar asked Nov 24 '15 23:11

chaos


1 Answers

No.‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

like image 194
chaos Avatar answered Nov 12 '22 02:11

chaos