Bug #73249 [Ver->Csd]: <visibility error> for Exception __construct
Edit report at https://bugs.php.net/bug.php?id=73249&edit=1
ID: 73249
Updated by: rjs@php.net
Reported by: remi@php.net
Summary: <visibility error> for Exception __construct
-Status: Verified
+Status: Closed
Type: Bug
Package: *PDF functions
Operating System: irrevelant
PHP Version: 7.0.11
Assigned To: rjs
Block user comment: N
Private report: N
New Comment:
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
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
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.
Previous Comments:
------------------------------------------------------------------------
[2016-10-26 14:58:51] rjs@php.net
Automatic comment from SVN on behalf of rjs
Revision: http://svn.php.net/viewvc/?view=revision&revision=340718
Log: fix bug#73249 and improve php7 wrapper (fixed a crash when extending the PDFlib Class)
------------------------------------------------------------------------
[2016-10-21 14:57:26] cmb@php.net
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:
<http://jpauli.github.io/2015/04/09/exceptional-php.html>.
------------------------------------------------------------------------
[2016-10-20 19:45:22] rjs@php.net
I'm not totally sure, but I think I was inspired by this code when I implemented this some
years ago:
https://github.com/php/php-gtk-src/blob/master/main/phpg_exceptions.c
I understand that this seems to be wrong and I will fix it. cmb@php.net, 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-05 08:20:37] cmb@php.net
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>
------------------------------------------------------------------------
[2016-10-05 06:58:54] remi@php.net
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 remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=73249
--
Edit this bug report at https://bugs.php.net/bug.php?id=73249&edit=1
Thread (7 messages)