php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79625 Internal classes in docs or parse error ?
Submitted: 2020-05-24 21:25 UTC Modified: 2020-05-25 20:38 UTC
From: bugs dot php dot net_nospam at adviesenzo dot nl Assigned: cmb (profile)
Status: Duplicate Package: OCI8 related
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bugs dot php dot net_nospam at adviesenzo dot nl
New email:
PHP Version: OS:

 

 [2020-05-24 21:25 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-24 21:58 UTC] requinix@php.net
-Status: Open +Status: Verified -Type: Documentation Problem +Type: Bug
 [2020-05-24 21:58 UTC] 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-25 15:51 UTC] cmb@php.net
-Status: Verified +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2020-05-25 15:51 UTC] cmb@php.net
This is a duplicate of bug #58319.
 [2020-05-25 20:38 UTC] bugs dot php dot net_nospam at adviesenzo dot nl
@cmb Thanks for finding that one. I did search, but must have overlooked it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 07:01:27 2024 UTC