F
F
Freud's cat2019-01-17 21:16:01
PHP
Freud's cat, 2019-01-17 21:16:01

Why do class modifiers work in php 7.0?

protectedJudging by php.net, modifiers were privateintroduced in PHP 7.1.
I am using php version 7.0.

php -v

PHP 7.0.33-0+deb9u1 (cli) (built: Dec  7 2018 11:36:49) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.33-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies

But code with class methods with these modifiers does not crash with Fatal Error, but works as it should.
Why is this happening?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2019-01-17
@medbrat69

tashchemta they were brought back in php5.
in 7.1, they simply extended their action to constants.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question