Bug #58319 [Com]: OCI-LOB invalid character in Class name
| From: | bugs dot php dot net_nospam at adviesenzo dot nl | Date: | Mon, 25 May 2020 20:46:29 +0000 |
| Subject: | Bug #58319 [Com]: OCI-LOB invalid character in Class name | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227160@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=58319&edit=1
ID: 58319
Comment by: bugs dot php dot net_nospam at adviesenzo dot nl
Reported by: kevinpgrant at yahoo dot co dot uk
Summary: OCI-LOB invalid character in Class name
Status: Open
Type: Bug
Package: OCI8 related
Operating System: linux
PHP Version: 5.2.5
Block user comment: N
Private report: N
New Comment:
As PHP 7.4 has come and gone and we're now at PHP 8, I believe ow would be a great time to
address this at long last.
My vote goes to renaming both the
OCI-Collection and OCI-Lob classes to
OCI_Collection and OCI_Lob respectively and adding an alias for each with
the old name.
Also see: https://bugs.php.net/bug.php?id=79625
Previous Comments:
------------------------------------------------------------------------
[2020-05-25 15:51:30] cmb@php.net
Related To: Bug #79625
------------------------------------------------------------------------
[2019-02-21 11:38:45] nikic@php.net
@tandre: Sounds good to me. I'd suggest renaming the class to OCI_Lob and making OCI-Lob the
alias though, to make everything use the new class name (while still being compatible with OCI-Lob,
if someone goes out of the way to use it).
------------------------------------------------------------------------
[2019-02-17 00:14:35] tandre@php.net
I'd be in favor of doing the following:
1. Add OCI_Lob as an internal class alias of OCI-Lob in PHP 7.4 and documenting that
2. Dropping the original OCI-Lob name in PHP 8.0
3. Forbidding internal extensions from registering class names that would be impossible for PHP code
to do, in PHP 8.0 (e.g. hyphens, starting with numbers, etc)
It seems doable - zend_register_class_alias("_ZendTestClassAlias", zend_test_class);
seems to do that in ext/zend_test/test.c
Same for OCI-Collection/OCI_Collection, etc.
There are several reasons for making this change:
1. The classes from OCI can't be type hinted in PHP programs for param/return types in the
signature, as mentioned earlier
2. This makes uses of those class difficult to statically analyze, and will make any tools
performing sanity checks of class names from Reflection fail. See https://github.com/phan/phan/issues/2222 and https://github.com/phan/PHPSignatures/pull/3#discussion_r246262546
3. The workarounds used by static analyzers and IDEs may mislead users into thinking that $x
instanceof OCI_Collection will work properly, making bugs more likely
------------------------------------------------------------------------
[2016-10-28 03:41:32] m at ahungry dot com
When using PHP7, how can this class be type hinted?
I think this class should be renamed to OCI_Lob instead of OCI-Lob to maintain standard naming
conventions.
------------------------------------------------------------------------
[2015-10-12 18:44:13] ashnazg@php.net
"if (is_a($clob, 'OCI-LOB')) {" is working fine for me (PHP 5.5.24)... should
this bug be closed?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=58319
--
Edit this bug report at https://bugs.php.net/bug.php?id=58319&edit=1