PHP Classes, Interfaces, and Traits (Ep. 3)
Channel: Christian Hur
Date: 15/06/2020

⭕ Overview
Below are some general characteristics of classes, interfaces, and traits.  The lists are incomplete and not detailed but capture some important features to understand them.

🟩 CLASSES
Can:
  CAN have a constructor
  CAN have zero or more data members and/or methods
  CAN be used to instantiate objects
  CAN only extend a maximum of one Class (abstract or concrete)
  CAN implement many Interfaces
  CAN use many Traits

Cannot:
  CANNOT have abstract methods
  CANNOT have nested Classes

🟩 TRAITS
Can:
  CAN have a constructor
  CAN have data fields
  CAN have methods
  CAN use many Traits

Cannot:
  CANNOT extend Classes or implement Interfaces
  CANNOT have abstract methods
  CANNOT be used to instantiate objects

🟩 INTERFACES
Can:
  CAN extend many Interfaces
  CAN have only function definitions
  CAN only be implemented by an abstract or concrete Class

Cannot:
  CANNOT have a constructor
  CANNOT have data members
  CANNOT have abstract methods
  CANNOT be used to instantiate objects
  CANNOT extend Classes or use Traits

⭕ About me
I am a Web Instructor, and I’ve authored a textbook and some complete sets of video training courses for https://www.linkedin.com/learning (formerly Lynda.com) and https://www.packtpub.com.

⭕ Visit my site: https://christianhur.com
⭕ My complete online training courses:
      ☑️ The DOM in JavaScript, jQuery, AngularJS, and React : https://www.linkedin.com/learning/the-dom-in-javascript-jquery-angularjs-and-react
      ☑️ Building JSF Web Applications with Java EE 7:  https://www.linkedin.com/learning/building-jsf-web-applications-with-java-ee-7
      ☑️ Troubleshooting Vue.js:  https://www.packtpub.com/application-development/troubleshooting-vuejs-video
      ☑️ Angular 7 New Features:  https://www.packtpub.com/web-development/angular-7-new-features-video
      ☑️ Full-Stack Web Development with Flask: https://www.packtpub.com/web-development/full-stack-web-development-flask-video
      ☑️ Full-Stack Web Development with Django & Angular 8: https://www.packtpub.com/web-development/full-stack-web-development-with-django-and-angular-8-video
      ☑️ Angular 9 New Features:  https://www.packtpub.com/web-development/angular-9-new-features-video

⭕ Check out my book:
Developing Business Applications for the Web: With HTML, CSS, JSP, PHP, ASP.NET, and JavaScript is available on Amazon and MC Press. 
      ☑️ Link:  https://www.mc-store.com/collections/christian-hur/products/developing-business-applications-for-the-web-with-html-css-jsp-php-asp-net-and-javascript