|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73249 <visibility error> for Exception __construct
Submitted: 2016-10-05 05:32 UTC Modified: 2016-10-26 15:05 UTC
From: Assigned: rjs (profile)
Status: Closed Package: *PDF functions
PHP Version: 7.0.11 OS: irrevelant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2016-10-05 05:32 UTC]
Reflection of some extension start reporting <visibility error>

 Class [ <internal:couchbase> class CouchbaseException extends Exception implements Throwable ] {
Method [ <internal:Core, inherits Exception, ctor> <visibility error> method __construct ] {

Reported as

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 ] {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-05 05:35 UTC]
Various extensions are affected:
- couchbase
- leveldb
- mongo
- pdflib
- protocolbuffers
- stomp
- strict
- varnish
- xmldiff
- yaf
- yar
- zmq
 [2016-10-05 06:58 UTC]
-Package: *General Issues +Package: *PDF functions
 [2016-10-05 06:58 UTC]
Reaffecting to PDF as the error only appear when this extension is installed

With pdf => issue

$ php -n -d -d -d  --re couchbase  | grep __cons
        Method [ <internal:Core, inherits Exception, ctor> <visibility error> method __construct ] {

Without pdf => no issue

$ php -n -d -d  --re couchbase  | grep __cons
        Method [ <internal:Core, inherits Exception, ctor> public method __construct ] {
 [2016-10-05 08:20 UTC]
-Status: Open +Status: Verified -Assigned To: +Assigned To: rjs
 [2016-10-05 08:20 UTC]
The problem is the following code in pdf.c:


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] <>
 [2016-10-20 19:45 UTC]
I'm not totally sure, but I think I was inspired by this code when I implemented this some years ago:

I understand that this seems to be wrong and I will fix it., do you have a source for (good) documentation/examples on how to do that stuff right, so that I can check the rest of the implementation.
 [2016-10-21 14:57 UTC]
I'm afraid there is not much documentation available (and I
wouldn't be able to write some). Maybe Julian's blog post about
exceptions is a bit helpful:
 [2016-10-26 14:58 UTC]
Automatic comment from SVN on behalf of rjs
Log: fix bug#73249 and improve php7 wrapper (fixed a crash when extending the PDFlib Class)
 [2016-10-26 15:05 UTC]
-Status: Verified +Status: Closed
 [2016-10-26 15:05 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

This is fixed in the new PECL package 4.0.1 and will be fixed in the next offical PDFlib Version.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 10:01:30 2024 UTC