Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP 7.0 get_magic_quotes_runtime error

Tags:

php

I have code like that:

    if (function_exists('get_magic_quotes_runtime')) {
        $mqr = @get_magic_quotes_runtime();
        @set_magic_quotes_runtime(0);
    }

And when it is executed It returns error message: Uncaught Error: Call to undefined function set_magic_quotes_runtime()

But why function_exists('get_magic_quotes_runtime') returns true? Is it normal for PHP 7.0?

like image 236
Dmitro Avatar asked Sep 01 '26 14:09

Dmitro


1 Answers

get_magic_quotes_runtime has returned false since PHP 5.4, was marked deprecated in 7.4, and was removed from the language in 8.0

set_magic_quotes_runtime has been deprecated since 5.3, and was removed from the language in 7.0.

In short, you probably absolutely shouldn't have the words "magic quotes" anywhere in your code any more, they haven't had any functional effect in roughly a decade.

like image 196
iainn Avatar answered Sep 03 '26 04:09

iainn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!