1
votes

I develop an application and the generation of the PDF on Windows walks (works) very well. Yesterday I wanted to test my application on Linux, I use Lamp who turns on PHP 7. When I launch the generation of the PDF here is the message that I obtain:

**Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; FPDF has a deprecated constructor

Filename: php/fpdf.php

Line Num

ber: 12**

Can someone help me?

Thanks

1
The message is clear: php is changing the way of declaring class constructors. Get a new version of your library with the appropriate fix. See: stackoverflow.com/questions/37100373/… - Oscar
Thanks, but I have the latest version of FPDF Libraty and I have the good systaxe of the constructor : **function __construct($orientation='P', $unit='mm', $size='A4'){} **. On Windows the code work very well with PHP 7 - Cyrusien Kamgue

1 Answers

1
votes

I think I got your answer...

<?php
require('fpdf/fpdf.php');

// instead of "$doc = new PDF();" use "$doc = new FPDF();"

$doc = new FPDF('P', 'mm', array(100,150));
$doc -> AddPage();
$doc -> SetFont('Arial','B', 16);
$doc -> MultiCell(40,10, 'hello word!');
$doc -> OutPut('F', 'folio.pdf');