How to update a function of other class from another class

Clash Royale CLAN TAG#URR8PPP
How to update a function of other class from another class
I can call a function from other class but can't update/overwrite it from other class. is there any way to update a function of other class in different file from other class's function in different file.
thanks
file A.php
class FPDF
function header
//some code
file B.php
Class Users extents basecontroller
function viewPDF
require_once(A.php)
$pdf = new FPDF
$pdf->Header()
require_once(A.php);
Class PDF extends FPDF
// Page header
function Header()
// Logo
// Line break
$this->Ln(100);
Could you please provide a brief code excerpt? Are you sure about the class you're trying to extend is not a
final one?– fabrik
1 hour ago
final
What do you mean by the update, do you want to change the code of that function or just want to execute that function or what? Please specify with some code snippet.
– Ashok Gujjar
1 hour ago
what you mean by update a function of other class.Please ask question properly and show Piece of code where you stuck
– Harry baldaniya
1 hour ago
I am using codeigniter framwork, i used require to include that file which contains the function i need to update. and it shows error if i use extent that class, it says constant fpdf already defined
– Danial
1 hour ago
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Show a small example of what you want to achieve
– splash58
1 hour ago