D
D
Dmitry2016-02-07 16:13:24
PHP
Dmitry, 2016-02-07 16:13:24

Stupid question about abstract classes?

Could you explain to me how abstract classes work directly in PHP?
Let's assume I have an abstract class Parent in which connection to a DB is carried out.
There are 10 child classes that inherit from Parent.
If I create 10 objects from each child class on the page, does that mean I will have 10 db connections?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Grachev, 2016-02-07
@By_Engine

If you create 10 objects from each of the 10 child classes, then you will have 100 connections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question