1

Have been using FPDF successfully for many years. Upon upgrading to PHP7, I was informed methods with the same name as their class will not be constructors in a future version of php.

Answers to question 37100373 say to simply change the function name to __construct.

I made this change in a filed called "pdf_parser.php" (FPDI - Version 1.4.4 by Jan Slabon)

function pdf_parser($filename) {

Changed to:

function __construct($filename) {

Making this change causes this error:

Call to undefined method pdf_parser::pdf_parser() in /usr/www/users/w6wehfc9/course/fpdf/fpdi_pdf_parser.php on line 74

Any help to resolve this would be appreciated.

0

1 Answer 1

1

in fpdi_pdf_parser.php change

function fpdi_pdf_parser($filename, &$fpdi)

to

function __construct($filename, &$fpdi)

and in fpdi_pdf_parser.php change

parent::pdf_parser($filename);

to

parent::__construct($filename);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.