Bug #58319 [Com]: OCI-LOB invalid character in Class name

From: Date: Fri, 28 Oct 2016 03:41:34 +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-205044@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: m at ahungry dot com 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: 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. Previous Comments: ------------------------------------------------------------------------ [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? ------------------------------------------------------------------------ [2013-01-03 22:53:30] r dot ejem at seznam dot cz I don't see type-checking pointless especially in PHP which has poor to no compile-time type-checking. I think this bug should be fixed in future version. Invalid class name of a built-in class is, I think, a terrible mistake, which has to be definitely fixed. ------------------------------------------------------------------------ [2008-08-19 06:40:59] tony at daylessday dot org // check $clob is of type 'OCI-Lob' here It's pointless to check it because oci_new_descriptor() can return only two things - NULL and OCI-Lob class instance. ------------------------------------------------------------------------ [2008-08-19 06:37:50] kevinpgrant at yahoo dot co dot uk Description: ------------ checking if an IN OUT CLOB input parameter returned from Oracle is an instanceof OCI-Lob fails, because of the invalid hyphen character in the class/object name! We have to use workarounds involving get_class($mylob) == 'OCI-Lob' instead, or use the deprecated 'is_a' check. Reproduce code: --------------- $sql = "insert into table (field1, field2) values (field1 = 'value', field2 = empty_clob()) returning field2 into :field2"; OCIParse($conn, $sql); $clob = OCINewDescriptor($conn, OCI_D_LOB); // check $clob is of type 'OCI-Lob' here OCIBindByName($stmt, ":field2", &$clob, -1, OCI_B_CLOB); OCIExecute($stmt, OCI_DEFAULT); $clob->save("some text"); OCICommit($conn); Expected result: ---------------- should return true/false when testing fo instanceof OCI-Lob (suggest using OCI_Lob instead ...?) Actual result: -------------- php barfs due to '-' character ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=58319&edit=1

« previous php.bugs (#205044) next »