danielmewes / php-rql

A PHP client driver for the RethinkDB query language (ReQL).
http://php-rql.dnsalias.net/
339 stars 60 forks source link

Add test to prevent autoloader bug #148

Open Geekimo opened 7 years ago

Geekimo commented 7 years ago

Not testing if $val is a string before testing if it is a subclass can cause autoloader class to abnormally load a class which match string value in include directory.

Geekimo commented 7 years ago

Spent five hours on this bug. I use Symfony's UniversalClassLoader and had a test.php file inside it which was used to do some bare test outside of the framework. But I had a variable with 'test' string inside it, then the bug came.