Doc->Bug #79625 [Opn->Ver]: Internal classes in docs or parse error ?
| From: | requinix@php.net | Date: | Sun, 24 May 2020 21:58:39 +0000 |
| Subject: | Doc->Bug #79625 [Opn->Ver]: Internal classes in docs or parse error ? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-227143@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
Updated by: requinix@php.net
Reported by: bugs dot php dot net_nospam at adviesenzo dot nl
Summary: Internal classes in docs or parse error ?
-Status: Open
+Status: Verified
-Type: Documentation Problem
+Type: Bug
Package: OCI8 related
Operating System: N/A
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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