What is Object Orientation

 

What is Object Orientation

Object oriented is the design philosophy of programs based on encapsulation

Encapsulation is a process whereby data and processing are confined within one class

You can minimize the impact of class changes on outside (out of class)

OOP at PHP

php object Let’s write thought

It is easy to create class objects

Declare the object name as shown below

I will specify the class with new

Then, an object of the specified class is created

$ Object = new class

tarokun object

For example if the human class has already been defined

Object of human class tarokun (Taro)

If you want to create

$tarokun = new human ;

I do not need Kuwait

By the way, when you create objects of class in php

Do not quote a class

Then it will be err

$tarokun = new ‘human’ ;  //err

 

藤沢瞭介(Ryosuke Hujisawa)
  • りょすけと申します。18歳からプログラミングをはじめ、今はフロントエンドでReactを書いたり、AIの勉強を頑張っています。off.tokyoでは、ハイテクやガジェット、それからプログラミングに関する情報まで、エンジニアに役立つ情報を日々発信しています!

未整理記事