Prevent php class extension

for a while I try to decode my own shared file that contain all the important functions in the class but I think when I have a class like

class A { public function test($value){ 

and file encoded

maybe someone that

 class B extends A { public function test($value){ 

and change the whole function that contains my code that I can discover for myself.

http://www.php.net/manual/en/language.oop5.php

+4
source share
3 answers

Use final .

+7
source
 final class A { public function test($value){ 

or

 class A { final public function test($value){ 
+3
source

Use final keyword

+3
source

Source: https://habr.com/ru/post/1388307/


All Articles