Bug #79625 [Dup]: Internal classes in docs or parse error ?
| From: | bugs dot php dot net_nospam at adviesenzo dot nl | Date: | Mon, 25 May 2020 20:38:44 +0000 |
| Subject: | Bug #79625 [Dup]: Internal classes in docs or parse error ? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227159@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79625&edit=1
ID: 79625
User updated by: bugs dot php dot net_nospam at adviesenzo dot nl
Reported by: bugs dot php dot net_nospam at adviesenzo dot nl
Summary: Internal classes in docs or parse error ?
Status: Duplicate
Type: Bug
Package: OCI8 related
Operating System: N/A
PHP Version: Irrelevant
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
@cmb Thanks for finding that one. I did search, but must have overlooked it.
Previous Comments:
------------------------------------------------------------------------
[2020-05-25 15:51:30] cmb@php.net
This is a duplicate of bug #58319.
------------------------------------------------------------------------
[2020-05-24 21:58:39] requinix@php.net
Note that you can class_alias them, or construct them through variable variables syntax.
Even if the classes are internal, they really shouldn't be named like that.
------------------------------------------------------------------------
[2020-05-24 21:25:29] bugs dot php dot net_nospam at adviesenzo dot nl
Description:
------------
Regards: https://www.php.net/manual/en/book.oci8.php
The OCI8 extension documentation shows there are two classes in this extension
OCI-Collection and OCI-Lob.
I have verified these classes are defined as such in the source code: https://github.com/php/php-src/blob/cebe750f460b8060ab21ae1e21980098f3f5b8e2/ext/oci8/oci8.c#L1050-L1051
However, these classes are not usable in userland code as they don't comply with the PHP rules
for naming classes and would result a parse error in any code using them: https://3v4l.org/WpIK4
If these classes are internal classes in C, I would not expect them to be shown in the
documentation.
If these classes _are_ intended to be used in userland code, they need renaming as they are
currently unusable.
I'm opening this issue to verify the intention behind these classes and if they are only
intended as internal C classes, I propose that the documentation about these classes be removed from
the PHP.net manual.
---
From manual page: https://php.net/class.OCI-Collection
---
Test script:
---------------
$oci8 = new OCI-Collection();
$closure = function(OCI-Lob $lob) {};
Expected result:
----------------
No parse error.
Actual result:
--------------
Parse error: syntax error, unexpected '-', expecting variable (T_VARIABLE) in /in/WpIK4 on
line 4
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79625&edit=1