PHP 7.0 get_magic_quotes_runtime 错误

Dmi*_*tro 5 php

我有这样的代码:

    if (function_exists('get_magic_quotes_runtime')) {
        $mqr = @get_magic_quotes_runtime();
        @set_magic_quotes_runtime(0);
    }
Run Code Online (Sandbox Code Playgroud)

当它执行时,它返回错误消息:Uncaught Error: Call to undefined function set_magic_quotes_runtime()

但为什么function_exists('get_magic_quotes_runtime')会返回呢true?PHP 7.0正常吗?

iai*_*inn 7

get_magic_quotes_runtime自 PHP 5.4 起返回 false,在 7.4 中被标记为已弃用,并在 8.0 中从该语言中删除

set_magic_quotes_runtime自 5.3 起已弃用,并在 7.0 中从语言中删除。

简而言之,您可能绝对不应该再在代码中的任何地方使用“魔术引号”一词,它们在大约十年内没有产生任何功能效果。