I'm using an old system with PHP 5.4 that I can't upgrade. I had to make a small change by adding a library for PDF file generation called FPDF/FPDI that has this function:
protected function getPdfParserInstance(StreamReader $streamReader)
{
/** @noinspection PhpUndefinedClassInspection */
if (\class_exists(FpdiPdfParser::class)) {
/** @noinspection PhpUndefinedClassInspection */
return new FpdiPdfParser($streamReader);
}
return new PdfParser($streamReader);
}
The problem is that ::class
was added in PHP 5.5 as explained in this question.
The question is: what changes need to be made to this function to work in PHP 5.4?