Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 06-26-2018, 11:19 PM   #1
Krina
Registered User
 
Join Date: Jun 2018
Posts: 60
What are Traits?

What are Traits?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Krina is offline   Reply With Quote

Old 01-30-2019, 11:57 AM   #2
frankone
Registered User
 
Join Date: Jan 2016
Location: Romania
Posts: 28
Hi there,
Traits are similar to classes, but they cannot be instantiated, therefore they do not contain a constructor. You can group a set of methods in a trait, that will be reused with future classes you will have.
However, i'm sure you are familiar now with them, i see the post is 6mo old.
__________________
webdesign | web development | support and maintenance

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
frankone is offline   Reply With Quote
Old 08-26-2019, 02:54 AM   #3
rankindia
Registered User
 
Join Date: Aug 2017
Location: New Delhi
Posts: 76
A trait is a group of various methods that reuse in single inheritance. A Trait is intended to reduce some limitations of single inheritance by enabling a developer to reuse sets of processes.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
rankindia is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:00 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.