Jump to content

[SOLVED] class extends


corillo181

Recommended Posts

i have a class

example

<?php
class student{
   public $id;

   function __construct($id){
     $this->id = $id;
   }

}
?>

 

and a class that extends it

example

<?php
class name extends student{
}
?>

 

my questions

if i want to add a __construct to the class name how would i do that?

when i do it it takes away the id from the parent and i need to be able to pass a id to it also.

Link to comment
https://forums.phpfreaks.com/topic/82981-solved-class-extends/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.