├── 01-classes.php ├── 02-properties.php ├── 03-methods.php ├── 04-getters.php ├── 05-setters.php ├── 06-constructors.php ├── 07-inheritance-problem.php ├── 08-inheritance-solution.php ├── 09-public-private-protected.php ├── 10-static.php ├── 11-const.php ├── 12-abstract-classes.php ├── 13-interfaces.php ├── 14-overriding.php ├── 15-overloading.php ├── 16-namespaces.php ├── README.md ├── assets └── img │ ├── xampp-app.png │ ├── xampp-download.png │ └── xampp-homepage.png └── mobileLibs.php /01-classes.php: -------------------------------------------------------------------------------- 1 | "; 21 | var_dump($oldMobile); 22 | -------------------------------------------------------------------------------- /02-properties.php: -------------------------------------------------------------------------------- 1 | ) for accessing properties 18 | 19 | // we can assign those public properties in our class with this syntax 20 | $modernMobile->name = "Samsung s20"; 21 | $modernMobile->chipset = "Exynos"; 22 | $modernMobile->internalMemory = 128; 23 | 24 | echo "
"; 25 | 26 | // we can also access properties value by the arrow operator 27 | echo $modernMobile->chipset; 28 | 29 | // what happens if we assign a non existing value or a wrong value? 30 | $modernMobile->ramMemory = 1; 31 | $modernMobile->internMemory = 8; 32 | 33 | echo "
";
34 | var_dump($modernMobile);
35 | echo "
"; 36 | 37 | echo "
"; 38 | 39 | //----------------------------------------------------- 40 | // arrow operator is unique in objects and must not be 41 | // confused with double arrow operator used in arrays 42 | //----------------------------------------------------- 43 | 44 | // this is an example using an array and double arrow operators 45 | $mobileArray = [ 46 | 'name' => 'Xiaomi Mi10', 47 | 'chipset' => 'Snapdragon', 48 | 'internalMemory' => 64 49 | ]; 50 | echo $mobileArray['chipset']; -------------------------------------------------------------------------------- /03-methods.php: -------------------------------------------------------------------------------- 1 | name . " includes a " . $this->chipset . " chipset and " . $this->internalMemory . "GB of internal memory"; 19 | } 20 | } 21 | 22 | 23 | $modernMobile = new Mobile(); 24 | $modernMobile->name = "Samsung s20"; 25 | $modernMobile->chipset = "Exynos"; 26 | $modernMobile->internalMemory = 128; 27 | 28 | echo $modernMobile->showSpecs(); 29 | -------------------------------------------------------------------------------- /04-getters.php: -------------------------------------------------------------------------------- 1 | name . " ---"; 19 | } 20 | 21 | public function getChipset() 22 | { 23 | return $this->chipset; 24 | } 25 | 26 | public function getInternalMemory() 27 | { 28 | return $this->internalMemory; 29 | } 30 | } 31 | 32 | 33 | $modernMobile = new Mobile(); 34 | $modernMobile->name = "Samsung s20"; 35 | $modernMobile->chipset = "Exynos"; 36 | $modernMobile->internalMemory = 128; 37 | 38 | echo "--- GETTERS ---"; 39 | echo "
"; 40 | echo $modernMobile->getName(); 41 | echo "
"; 42 | echo $modernMobile->getChipset(); 43 | echo "
"; 44 | echo $modernMobile->getInternalMemory(); 45 | 46 | 47 | //----------------------------------------------------- 48 | // with this scenario where all properties are public 49 | // there won't be any differences between using getters 50 | // or accessing the properties via arrow operator 51 | //----------------------------------------------------- 52 | 53 | echo "

"; 54 | echo "--- ARROW OPERATOR ---"; 55 | echo "
"; 56 | 57 | echo $modernMobile->name; 58 | echo "
"; 59 | echo $modernMobile->chipset; 60 | echo "
"; 61 | echo $modernMobile->internalMemory; 62 | -------------------------------------------------------------------------------- /05-setters.php: -------------------------------------------------------------------------------- 1 | internalMemory; 18 | } 19 | 20 | // setters are methods for changing properties 21 | public function setInternalMemory($internalMemory) 22 | { 23 | echo "* CHANGED internal memory from " . $this->internalMemory; 24 | $this->internalMemory = $internalMemory; 25 | echo " to " . $this->internalMemory; 26 | } 27 | } 28 | 29 | echo "
"; 30 | 31 | $modernMobile = new Mobile(); 32 | $modernMobile->name = "Samsung s20"; 33 | $modernMobile->chipset = "Exynos"; 34 | $modernMobile->internalMemory = 128; 35 | 36 | 37 | echo "
"; 38 | echo $modernMobile->getInternalMemory(); 39 | echo "
"; 40 | $modernMobile->setInternalMemory(256); 41 | echo "
"; 42 | echo $modernMobile->getInternalMemory(); 43 | -------------------------------------------------------------------------------- /06-constructors.php: -------------------------------------------------------------------------------- 1 | name = $name; 19 | $this->chipset = $chipset; 20 | $this->internalMemory = $internalMemory; 21 | echo "+ " . $this->name . " CREATED +
"; 22 | } 23 | 24 | // PHP will call __destruct at the end of the script, when the object is destructed or the script is stopped or exited. 25 | function __destruct() 26 | { 27 | echo "- DESTROYED : " . $this->name . " includes a " . $this->chipset . " chipset and " . $this->internalMemory . "GB of internal memory -
"; 28 | } 29 | } 30 | 31 | // Now we can instantiate a mobile object passing arguments in the correct order 32 | $modernMobile = new Mobile('Samsung s20', 'Exynos', 128); 33 | $oldMobile = new Mobile('BlackBerry', 'ARM', 1); 34 | echo "
"; 35 | -------------------------------------------------------------------------------- /07-inheritance-problem.php: -------------------------------------------------------------------------------- 1 | name = $name; 20 | $this->chipset = $chipset; 21 | $this->internalMemory = $internalMemory; 22 | echo "+ " . $this->name . " CREATED +
"; 23 | } 24 | 25 | function __destruct() 26 | { 27 | echo "- DESTROYED : " . $this->name . " includes a " . $this->chipset . " chipset and " . $this->internalMemory . "GB of internal memory -
"; 28 | } 29 | } 30 | 31 | // We need a class for mobiles with extra properties and methods that won't have every mobile 32 | // For example we could need a class for a mobile device with physical keyboard so we create a new one 33 | 34 | class Blackberry 35 | { 36 | public $name; 37 | public $chipset; 38 | public $internalMemory; 39 | public $keyboard; 40 | 41 | 42 | public function __construct($name, $chipset, $internalMemory, $keyboard) 43 | { 44 | $this->name = $name; 45 | $this->chipset = $chipset; 46 | $this->internalMemory = $internalMemory; 47 | $this->keyboard = $keyboard; 48 | echo "+ " . $this->name . " CREATED +
"; 49 | } 50 | 51 | //new method for getting keyboard type 52 | public function getKeyboard() 53 | { 54 | return $this->keyboard; 55 | } 56 | 57 | function __destruct() 58 | { 59 | echo "- DESTROYED : " . $this->name . " includes a " . $this->chipset . " chipset and " . $this->internalMemory . "GB of internal memory. It uses " . $this->keyboard . " Keyboard -
"; 60 | } 61 | } 62 | 63 | $samsung = new Samsung('Samsung s20', 'Exynos', 128); 64 | $blackberry = new BlackBerry('BlackBerry', 'ARM', 1, 'qwerty'); 65 | echo "
"; 66 | 67 | // Seems that we are repeating too much code... -------------------------------------------------------------------------------- /08-inheritance-solution.php: -------------------------------------------------------------------------------- 1 | name = $name; 20 | $this->chipset = $chipset; 21 | $this->internalMemory = $internalMemory; 22 | } 23 | 24 | public function getName() 25 | { 26 | return $this->name; 27 | } 28 | 29 | public function getChipset() 30 | { 31 | return $this->chipset; 32 | } 33 | 34 | public function getInternalMemory() 35 | { 36 | return $this->internalMemory; 37 | } 38 | 39 | public function getMobileDetails() 40 | { 41 | return "Name: $this->name, Chipset: $this->chipset, Internal Memory: $this->internalMemory"; 42 | } 43 | } 44 | 45 | // When you extend a class, the subclass inherits all of the public and protected methods from the parent class. 46 | class Blackberry extends Mobile 47 | { 48 | public $keyboard; 49 | 50 | // in php we use __construct to tell our class that this is the constructor method 51 | public function __construct($name, $chipset, $internalMemory, $keyboard) 52 | { 53 | // we use same constructor as father class with parent keyword and double colon 54 | parent::__construct($name, $chipset, $internalMemory); 55 | // and add new arguments necessary for the new son class 56 | $this->keyboard = $keyboard; 57 | } 58 | 59 | //new method for getting keyboard type 60 | public function getKeyboard() 61 | { 62 | return $this->keyboard; 63 | } 64 | } 65 | 66 | $samsung = new Mobile('Samsung s20', 'Exynos', 128); 67 | $blackberry = new BlackBerry('BlackBerry', 'ARM', 1, 'qwerty'); 68 | echo $blackberry->getName(); 69 | echo "\n"; 70 | echo $blackberry->getMobileDetails(); 71 | -------------------------------------------------------------------------------- /09-public-private-protected.php: -------------------------------------------------------------------------------- 1 | name = $name; 21 | $this->chipset = $chipset; 22 | $this->internalMemory = $internalMemory; 23 | $this->imei = $imei; 24 | echo "+ " . $this->name . " CREATED +
"; 25 | } 26 | 27 | // now getters methods meke more sense because we won't be able to access properties outside the class 28 | public function getName() 29 | { 30 | return "--- " . $this->name . " ---
"; 31 | } 32 | 33 | public function getChipset() 34 | { 35 | return $this->chipset; 36 | } 37 | 38 | public function getInternalMemory() 39 | { 40 | return $this->internalMemory; 41 | } 42 | 43 | // protected elements can be accessed only within the class itself and inside inherited classes. 44 | protected function getIMEI() 45 | { 46 | return $this->imei; 47 | } 48 | } 49 | 50 | class Blackberry extends Mobile 51 | { 52 | private $keyboard; 53 | 54 | public function __construct($name, $chipset, $internalMemory, $imei, $keyboard) 55 | { 56 | parent::__construct($name, $chipset, $internalMemory, $imei); 57 | $this->keyboard = $keyboard; 58 | } 59 | 60 | // show protected imei 61 | public function showIMEI() 62 | { 63 | return $this->getIMEI(); 64 | } 65 | } 66 | 67 | $samsung = new Mobile('Samsung s20', 'Exynos', 128, '000111222333'); 68 | $blackberry = new BlackBerry('BlackBerry', 'ARM', 1, '99966688555', 'qwerty'); 69 | 70 | //----------------------------------------------------- 71 | // with this scenario we can't access private or protected 72 | // attributes or methods via arrow operator 73 | //----------------------------------------------------- 74 | 75 | echo "
"; 76 | echo $samsung->getName(); // OK | Public method accessing a public property inside the class 77 | echo "
"; 78 | echo $samsung->name; // OK | Public property 79 | echo "
"; 80 | echo $samsung->getChipset(); // OK | Public method accessing a protected property inside the class 81 | echo "
"; 82 | echo $samsung->chipset; // ERROR | Private property so we can't access outside the class and throws: Fatal error: Uncaught Error: Cannot access privated property Mobile::$chipset 83 | echo "
"; 84 | echo $samsung->getIMEI(); // ERROR | Protected method so we can't call it outside our class and throws: Fatal error: Uncaught Error: Call to protected method Mobile::getIMEI() from context 85 | echo "
"; 86 | echo $samsung->imei; // ERROR | Private property so we can't access outside the class and throws: Fatal error: Uncaught Error: Cannot access private property Mobile::$imei 87 | echo "
"; 88 | echo $blackberry->showIMEI(); // OK | Public method accessing a inherited protected method inside the class 89 | echo "
"; 90 | echo $blackberry->getInternalMemory(); // OK | Public method accessing a inherited protected method inside the class 91 | echo "
"; 92 | echo $blackberry->internalMemory; // Uncaught Error: Cannot access protected property Blackberry::$internalMemory 93 | echo "
"; 94 | -------------------------------------------------------------------------------- /10-static.php: -------------------------------------------------------------------------------- 1 | name = $name; 35 | $this->chipset = $chipset; 36 | $this->internalMemory = $internalMemory; 37 | $this->imei = $imei; 38 | echo "+ CREATED " . $this->name . " WITH " . $this->internalMemory . " INTERNAL MEMORY +
"; 39 | } 40 | 41 | public function connectMobileInternet() 42 | { 43 | // we can call static methods without instantiating directly with class name and double colon 44 | return $this->name . " : " . Internet::connectInternet(); 45 | } 46 | } 47 | 48 | // we can acces to static properties without instanciating the class 49 | echo "
"; 50 | $company = Internet::$company; 51 | 52 | echo $company; 53 | echo "

"; 54 | 55 | 56 | $samsung = new Mobile('Samsung s20', 'Exynos', 128, '000111222333'); 57 | echo $samsung->connectMobileInternet(); 58 | -------------------------------------------------------------------------------- /11-const.php: -------------------------------------------------------------------------------- 1 | name = $name; 32 | $this->chipset = $chipset; 33 | $this->internalMemory = $internalMemory; 34 | $this->imei = $imei; 35 | echo "+ CREATED " . $this->name . " WITH " . $this->internalMemory . " INTERNAL MEMORY +
"; 36 | } 37 | 38 | // We can access constants with just name 39 | public function runMobileApp() 40 | { 41 | return $this->name . " RUNS " . APPNAME . " : " . Internet::connectInternet(); 42 | } 43 | } 44 | 45 | $samsung = new Mobile('Samsung s20', 'Exynos', 128, '000111222333'); 46 | echo $samsung->runMobileApp(); 47 | -------------------------------------------------------------------------------- /12-abstract-classes.php: -------------------------------------------------------------------------------- 1 | name = $name; 33 | $this->chipset = $chipset; 34 | $this->internalMemory = $internalMemory; 35 | $this->imei = $imei; 36 | echo "+ CREATED " . $this->name . " WITH " . $this->internalMemory . " INTERNAL MEMORY +
"; 37 | } 38 | 39 | public function runMobileApp() 40 | { 41 | return $this->name . " RUNS " . APPNAME . " : " . Internet::connectInternet(); 42 | } 43 | } 44 | 45 | class Blackberry extends Mobile 46 | { 47 | public $keyboard; 48 | 49 | public function __construct($name, $chipset, $internalMemory, $imei, $keyboard) 50 | { 51 | parent::__construct($name, $chipset, $internalMemory, $imei); 52 | $this->keyboard = $keyboard; 53 | } 54 | } 55 | 56 | $blackberry = new BlackBerry('BlackBerry', 'ARM', 1, '99966688555', 'qwerty'); 57 | echo $blackberry->runMobileApp(); 58 | 59 | // We cannot instantiate an abstract class by itself!! 60 | $samsung = new Mobile('Samsung s20', 'Exynos', 128, '000111222333'); // Fatal error: Uncaught Error: Cannot instantiate abstract class Mobile -------------------------------------------------------------------------------- /13-interfaces.php: -------------------------------------------------------------------------------- 1 | username = $username; 42 | $this->paassword = $password; 43 | 44 | return "¡Loggin succesful with $this->username!\n"; 45 | } 46 | 47 | public function saveData() 48 | { 49 | return "¡The user has successfully saved the information!\n"; 50 | } 51 | 52 | public function logout() 53 | { 54 | $this->username = null; 55 | $this->paassword = null; 56 | 57 | return "¡The user has successfully logged out the application!\n"; 58 | } 59 | 60 | // We can add methods not present in the interface 61 | public function exitApp() 62 | { 63 | echo "Clossing " . self::APPNAME . "..."; 64 | } 65 | } 66 | 67 | $app = new AssemblerApp(); 68 | 69 | echo $app->showSplashScreen(); 70 | echo $app->login("XxProAssemblerxX", "123456"); 71 | echo $app->saveData(); 72 | echo $app->logout(); 73 | echo $app->exitApp(); 74 | -------------------------------------------------------------------------------- /14-overriding.php: -------------------------------------------------------------------------------- 1 | name = $name; 22 | $this->internalMemory = $internalMemory; 23 | } 24 | 25 | public function getName() 26 | { 27 | return $this->name; 28 | } 29 | 30 | public function getInternalMemory() 31 | { 32 | return $this->internalMemory; 33 | } 34 | } 35 | 36 | // When you extend a class, the subclass inherits all of the public and protected methods from the parent class. 37 | class iPhonePlus extends iPhone 38 | { 39 | //Here we are overriding this method adding extra features that the previous "getName" doesn't have. 40 | public function getName() 41 | { 42 | return "¡The name of this iPhone is $this->name!"; 43 | } 44 | } 45 | 46 | $iPhone = new iPhone("iPhone X", "64"); 47 | echo $iPhone->getName() . "\n"; 48 | 49 | $iPhonePlus = new iPhonePlus("iPhone X Plus", "128"); 50 | echo $iPhonePlus->getName(); 51 | -------------------------------------------------------------------------------- /15-overloading.php: -------------------------------------------------------------------------------- 1 | dni = $dni; 39 | $this->name = $name; 40 | return "¡Login with short DNI!"; 41 | } 42 | 43 | public function loginFullDNI(string $dni) 44 | { 45 | $this->dni = $dni; 46 | return "¡Login with full DNI!"; 47 | } 48 | } 49 | 50 | $app = new App(); 51 | echo $app->login(53123456, "Pau") . "\n"; 52 | echo $app->login("53123456K"); 53 | -------------------------------------------------------------------------------- /16-namespaces.php: -------------------------------------------------------------------------------- 1 | name = $name; 73 | $this->chipset = $chipset; 74 | $this->internalMemory = $internalMemory; 75 | $this->imei = $imei; 76 | echo "+ CREATED " . $this->name . " WITH " . $this->internalMemory . " INTERNAL MEMORY +
"; 77 | } 78 | 79 | public function runAssemblerApp() 80 | { 81 | echo "
"; 82 | AssemblerApp::showSplashScreen(); 83 | echo "
"; 84 | AssemblerApp::getData(); 85 | AssemblerApp::showData(); 86 | echo "
"; 87 | AssemblerApp::exitApp(); 88 | } 89 | 90 | public function runAssemblerAppLib() 91 | { 92 | // We use the namespace for calling our library methods 93 | Lib\AssemblerApp::showSplashScreen(); 94 | echo "
"; 95 | Lib\AssemblerApp::getData(); 96 | Lib\AssemblerApp::showData(); 97 | echo "
"; 98 | Lib\AssemblerApp::exitApp(); 99 | } 100 | } 101 | 102 | class Blackberry extends Mobile 103 | { 104 | public $keyboard; 105 | 106 | public function __construct($name, $chipset, $internalMemory, $imei, $keyboard) 107 | { 108 | parent::__construct($name, $chipset, $internalMemory, $imei); 109 | $this->keyboard = $keyboard; 110 | } 111 | } 112 | 113 | $blackberry = new BlackBerry('BlackBerry', 'ARM', 1, '99966688555', 'qwerty'); 114 | echo $blackberry->runAssemblerApp(); 115 | echo "

"; 116 | echo $blackberry->runAssemblerAppLib(); 117 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | `#php` `#oop` `#master-in-software-engineering` 2 | 3 | # Assembler School: OOP Basics with PHP 4 | 5 | In this project you will learn the basics of OOP using mobile devices as a reference. In the _"Project files"_ section you will find a description of the content to be displayed in each file. 6 | 7 | ## Table of contents 8 | 9 | - [Table of contents](#table-of-contents) 10 | - [Getting Started](#getting-started) 11 | - [Dependencies](#dependencies) 12 | - [Tools](#tools) 13 | - [OOP Introduction](#oop-introduction) 14 | - [Project files](#project-files) 15 | 16 | ## Getting Started 17 | 18 | ### The repo 19 | 20 | First, you will need to clone the repo: 21 | 22 | ```bash 23 | $ git clone https://github.com/assembler-school/oop-basics.git 24 | ``` 25 | 26 | ### Presentation material 27 | 28 | - [Slides](https://docs.google.com/presentation/d/1cZxutGPDqUGsLWLVen_ATjd7dEkeoPS_v_fy1y0C5Co/edit?usp=sharing) 29 | 30 | ## Dependencies 31 | 32 | Before we can get started you will need to make sure that all the necessary dependencies are installed in your system. 33 | 34 | ### PHP 35 | 36 | You can install it by following the instructions [in the official docs](https://www.php.net/downloads) (we recommend that you install the version that is named _Current_). 37 | 38 | To verify that you have installed it correctly, you can run the following command from the terminal that should output the version installed: 39 | 40 | ```bash 41 | $ php -version 42 | ``` 43 | 44 | ## Tools 45 | 46 | In the event that you prefer to use a tool that installs everything you need to configure and run a PHP server, we recommend using [XAMPP](https://www.apachefriends.org/es/download.html) 47 | 48 | ### XAMPP 49 | 50 | XAMPP is a completely free and easy to install Apache distribution that contains MariaDB, PHP, and Perl. The XAMPP installation package has been designed to be incredibly easy to install and use. 51 | 52 | xampp homepage 53 | 54 | You have to go to the [download page](https://www.apachefriends.org/es/download.html) and it will automatically recommend installing the latest version available. 55 | 56 | xampp download 57 | 58 | Once downloaded and installed, in the case that the Windows operating system you will see the following screen, in which you will only have to start the Apache service. 59 | 60 | xampp app 61 | 62 | ## OOP Introduction 63 | 64 | Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods). 65 | 66 | ## Project files 67 | 68 | ### [01 - Classes](./01-classes.php) 69 | 70 | The OOP paradigm encapsulates concepts of the real world in what is called as Classes which create Objects. In this file you will learn how to create a class and instanciate it. 71 | 72 | ### [02 - Properties](02-properties.php) 73 | 74 | Class member variables are called properties. In this file, you will learn how to add properties to a class and get them when the class is instantiated. 75 | 76 | ### [03 - Methods](03-methods.php) 77 | 78 | Properties define the characteristics of an object and the methods (functions in a class are called methods) which define the behavior of the Class. In this file you will learn how to create methods inside a class. 79 | 80 | ### [04 - Getters](04-getters.php) 81 | 82 | The get method returns the attribute value, usually there is a get method for each attribute of the class. In this file you will learn how to create **getter** methods. 83 | 84 | ### [05 - Setters](05-setters.php) 85 | 86 | The set method sets the attribute value, usually there is a get method for each attribute of the class. In this file you will learn how to create **setter** methods. 87 | 88 | ### [06 - Constructors](06-constructors.php) 89 | 90 | A constructor allows you to initialize an object's properties upon creation of the object. In this file you will learn how to create the constructor method. 91 | 92 | ### [07 - Inheritance problem](07-inheritance-problem.php) 93 | 94 | There are several disadvantages of not applying inheritance in our code. In this file you will lean what's the problem if you don't apply any inheritance in your code. 95 | 96 | ### [08 - Inheritance soluction](08-inheritance-solution.php) 97 | 98 | The child class will inherit all the public and protected properties and methods from the parent class. In addition, it can have its own properties and methods. In this file you will learn how to apply the inheritance in your code. 99 | 100 | ### [09 - Public, private & protected](09-public-private-protected.php) 101 | 102 | Properties and methods can have access modifiers which control where they can be accessed. In this file you will learn le three access modifiers. 103 | 104 | ### [10 - Static](10-static.php) 105 | 106 | Static properties and methods can be called directly - without creating an instance of the class first. In this file you will learn how to use static properties and methods. 107 | 108 | ### [11 - Const](11-const.php) 109 | 110 | Constants cannot be changed once it is declared. Class constants can be useful if you need to define some constant data within a class. In this file you will learn how to create constants within a class. 111 | 112 | ### [12 - Abstract classes](12-abstract-classes.php) 113 | 114 | Abstract classes and methods are when the parent class has a named method, but need its child class(es) to fill out the tasks. In this file you will learn how to create and use abstract classes. 115 | 116 | ### [13 - Interfaces](13-interfaces.php) 117 | 118 | Interfaces allow you to specify what methods a class should implement. 119 | Interfaces make it easy to use a variety of different classes in the same way. When one or more classes use the same interface, it is referred to as "polymorphism". In this file you will learn how to create and extend interfaces. 120 | 121 | ### [14 - Overriding](14-overriding.php) 122 | 123 | In function overriding, both parent and child classes should have same function name with and number of arguments. In this file you will learn how to implement overriding. 124 | 125 | ### [15 - Overloading](15-overloading.php) 126 | 127 | Function overloading contains same function name and that function preforms different task according to number of arguments. In this file you will learn how to implement overloading. 128 | 129 | ### [16 - Namespaces](16-namespaces.php) 130 | 131 | Namespaces are qualifiers that solve two different problems: 132 | 133 | 1. They allow for better organization by grouping classes that work together to perform a task 134 | 2. They allow the same name to be used for more than one class 135 | 136 | In this file you will learn how to create and use namespaces. 137 | -------------------------------------------------------------------------------- /assets/img/xampp-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alejandroaperez1994g/oop-basics/e93b98cf51e6defb0892856b507a6cb4b047b2e1/assets/img/xampp-app.png -------------------------------------------------------------------------------- /assets/img/xampp-download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alejandroaperez1994g/oop-basics/e93b98cf51e6defb0892856b507a6cb4b047b2e1/assets/img/xampp-download.png -------------------------------------------------------------------------------- /assets/img/xampp-homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alejandroaperez1994g/oop-basics/e93b98cf51e6defb0892856b507a6cb4b047b2e1/assets/img/xampp-homepage.png -------------------------------------------------------------------------------- /mobileLibs.php: -------------------------------------------------------------------------------- 1 |