Getting errors using PHP7 bindings

Hi there,

I’ve built the newly supported PHP 7 bindings using SWIG 3.0.12 and PHP 7.0.32.

When I try and run the tests and implement the SDK, I get a number of errors relating to invalid declarations of functions:

Declaration of Popup::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos)

I am wholly unfamiliar with SWIG, therefor am not sure how to fix these issues in the mappings?

Hi Deon,

Thank you for contacting us. Regarding these warnings, you can safely ignore them as they should not affect the output. Are you experiencing any fatal errors?

Thank you.

Hi There,

Nope, no fatal errors. I have added some code which will ignore these warnings in a PHP 7 environment. Thanks for confirming!

Just wanted to confirm there is no fix for this yet?

We’ve upgraded from php 7.2 (where we didn’t see these warnings) to php 7.4 - and they now appear.

We run quite a few CLI commands, so would like to remove these without removing warnings completely.

PHP Warning: Declaration of Popup::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 7922
PHP Warning: Declaration of Ink::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 8319
PHP Warning: Declaration of Circle::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 15209
PHP Warning: Declaration of HighlightAnnot::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 15249
PHP Warning: Declaration of LineAnnot::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 15286
PHP Warning: Declaration of FreeText::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 15466
PHP Warning: Declaration of Movie::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 15729
PHP Warning: Declaration of RedactionAnnot::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 15899
PHP Warning: Declaration of Screen::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 16102
PHP Warning: Declaration of Square::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 16431
PHP Warning: Declaration of Squiggly::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 16471
PHP Warning: Declaration of StrikeOut::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 16508
PHP Warning: Declaration of Underline::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 16646
PHP Warning: Declaration of Watermark::Create($doc, $pos) should be compatible with Annot::Create($doc, $type, $pos) in /opt/pdftron/PDFNetC/Lib/PDFNetPHP_core.php on line 16683