- 1

Why is there no classes in php?

1st Mar 2018, 8:40 PM
Ankit Khanduri
Ankit Khanduri - avatar
6 odpowiedzi
+ 4
Hey, it is actually possible to create classes in php. See the lesson below to learn more. https://www.sololearn.com/learn/985/?ref=app
1st Mar 2018, 8:52 PM
Tarantino
Tarantino - avatar
+ 3
PHP is oop language
1st Mar 2018, 9:49 PM
Toni Isotalo
Toni Isotalo - avatar
+ 2
Hey you must be on the browser right? As it works on mobile and I just checked it on the browser and I saw 404, allow me to copy the info:
3rd Mar 2018, 7:50 PM
Tarantino
Tarantino - avatar
+ 2
PHP Classes php In PHP, a class can include member variables called properties for defining the features of an object, and functions, called methods, for defining the behavior of an object. A class definition begins with the keyword class, followed by a class name. Curly braces enclose the definitions of the properties and methods belonging to the class. For example: class Person { public $age; //property public function speak() { //method echo "Hi!" } } The code above defines a Person class that includes an age property and a speak() method. A valid class name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. Notice the keyword public in front of the speak method; it is a visibility specifier. The public keyword specifies that the member can be accessed from anywhere in the code. There are other visibility keywords and we will learn about them in later lessons. Courtesy of James Flanders
3rd Mar 2018, 7:52 PM
Tarantino
Tarantino - avatar
0
Toni what do you mean by oop language. Though I have heard about it but can you explain to a laymen?
2nd Mar 2018, 11:37 AM
Ankit Khanduri
Ankit Khanduri - avatar
0
Minato these links never work. It throws 404.
3rd Mar 2018, 7:48 PM
Ankit Khanduri
Ankit Khanduri - avatar