You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
produces on Ubuntu 16.04 PHP 7.0.9-1+deb.sury.org~xenial+1 (cli) ( NTS ) with sqlsrv driver version 4.0.2 following output:
orig class Doctrine\Tests\DBAL\Functional\A exits: yes
lower class doctrine\tests\dbal\functional\a exits: yes
BEFORE: Doctrine\Tests\DBAL\Functional\A
orig class Doctrine\Tests\DBAL\Functional\A exits: no
lower class doctrine\tests\dbal\functional\a exits: yes
AFTER: doctrine\tests\dbal\functional\a
as you can see, the full qualified class name changed completely to lowercase and class_exists is unable to find the class with its original name! 😵
Unfortunately, the source code of the Linux version isn't release yet, but I'm persuaded that the bug also exists on Windows, for PHP5 and PHP7.
sqlsrv_fetch_object
modifies the full qualified class names of the supplied class.The following PHP Code
produces on Ubuntu 16.04
PHP 7.0.9-1+deb.sury.org~xenial+1 (cli) ( NTS )
with sqlsrv driver version 4.0.2 following output:as you can see, the full qualified class name changed completely to lowercase and
class_exists
is unable to find the class with its original name! 😵Unfortunately, the source code of the Linux version isn't release yet, but I'm persuaded that the bug also exists on Windows, for PHP5 and PHP7.
I suspect the line https://github.com/Azure/msphpsql/blob/PHP-7.0/sqlsrv/stmt.cpp#L797 is causing the problem, because the lowercase class name is create here and used in https://github.com/Azure/msphpsql/blob/PHP-7.0/sqlsrv/stmt.cpp#L825 to instantiate the corresponding object.
Since
zend_lookup_class
which is called in https://github.com/Azure/msphpsql/blob/PHP-7.0/sqlsrv/stmt.cpp#L816 is using the lower cased class name internally, it's not required to call it with a lower cased class name.I would recommend to use in
sqlsrv_fetch_object
the class name, spelled as returned fromget_declared_classes
.The text was updated successfully, but these errors were encountered: