|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2016-10-05 05:32 UTC] remi@php.net
 Description:
------------
Reflection of some extension start reporting <visibility error>
Example:
 Class [ <internal:couchbase> class CouchbaseException extends Exception implements Throwable ] {
Method [ <internal:Core, inherits Exception, ctor> <visibility error> method __construct ] {
Reported as https://issues.couchbase.com/browse/PCBC-437
But this class simply extends core Exception.
Test script:
---------------
 zend_class_entry cbe;
 INIT_CLASS_ENTRY(cbe, "CouchbaseException", NULL);
 cb_exception_ce = zap_zend_register_internal_class_ex(&cbe, zend_exception_get_default());
Expected result:
----------------
Method [ <internal:Core, inherits Exception, ctor> public method __construct ] {
Actual result:
--------------
Method [ <internal:Core, inherits Exception, ctor> <visibility error> method __construct ] {
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 23:00:01 2025 UTC | 
Reaffecting to PDF as the error only appear when this extension is installed With pdf => issue $ php -n -d extension=pdf.so -d extension=json.so -d extension=couchbase.so --re couchbase | grep __cons Method [ <internal:Core, inherits Exception, ctor> <visibility error> method __construct ] { Without pdf => no issue $ php -n -d extension=json.so -d extension=couchbase.so --re couchbase | grep __cons Method [ <internal:Core, inherits Exception, ctor> public method __construct ] {The problem is the following code in pdf.c: pdflib_exception_class->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; This has two issues: * just adding the protected flags without removing the public flag creates an unexpected bitmask, because the visibility flags are supposed to be exclusive * this changes the flags of the inherited class[1] Rainer, please have a look at this issue. [1] <https://github.com/php/php-src/commit/a783891e>