Can we define many methods in a php class?

some body asks this question, but I want to talk about the fuctionality of the class. what happens if we define many methods for exapmle 1000,000 or more lines of code in a class. does this affect class performance? I mean, if we are an instance of a class object, do all methods go to memory? and they spend on memory usage? or it doesn’t matter at all.

Like this:

class User extends databaseObject{

    protected static $table_name="users";
    protected static $db_fields=array('id','user_type_id','firstname','lastname','password','email',
    'mobile','ostan_id','city_id','tahsilat_id','education_cluster_id','code_meli','birth_date',
    'mobile_verify_code','mail_verify_code','is_instituter','gender_id','active_by','actived_date');

    protected static $required=array('firstname','lastname','password','email','mobile');
    protected static $missing=array();

    public $id;
    public $user_type_id;
    public $firstname="";
    public $lastname="";
    public $password;
    public $email;
    public $mobile;
    public $ostan_id;
    public $city_id;
    public $tahsilat_id;
    public $education_cluster_id;
    public $code_meli;
    public $birth_date;
    public $mobile_verify_code;
    public $mail_verify_code;
    public $is_verified;
    public $is_instituter=0;
    public $active_by;
    public $actived_date;
+4
source share
2 answers

Unanswered: Don't worry about memory usage or performance until you have a performance issue.

: // (, , php , . PHP, , i/o, ). : . , , . , , .

: @N.B. , , ORM. ORM, . , , , .

+2

, . () . .

+1

All Articles