Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Drupal中PHP7.3不推荐使用的名称空间断言_Php_Drupal_Assert_Deprecated - Fatal编程技术网

Drupal中PHP7.3不推荐使用的名称空间断言

Drupal中PHP7.3不推荐使用的名称空间断言,php,drupal,assert,deprecated,Php,Drupal,Assert,Deprecated,英语不是我的第一语言,请耐心点 从 名称空间断言() 不推荐在命名空间内声明名为assert()的函数。 assert()函数由引擎进行特殊处理, 这可能会导致在定义命名空间时出现不一致的行为 具有相同名称的函数 我正在研究Drupal 7.72,我正在检查迁移到PHP 7.3的过程,当涉及到不推荐的功能时,我发现Drupal core在文件夹\misc\typo3\中的几个文件中使用了assert()函数。我确定的潜在风险如下: docroot\misc\typo3\drupal secur

英语不是我的第一语言,请耐心点

名称空间断言()

不推荐在命名空间内声明名为assert()的函数。 assert()函数由引擎进行特殊处理, 这可能会导致在定义命名空间时出现不一致的行为 具有相同名称的函数

我正在研究Drupal 7.72,我正在检查迁移到PHP 7.3的过程,当涉及到不推荐的功能时,我发现Drupal core在文件夹
\misc\typo3\
中的几个文件中使用了
assert()
函数。我确定的潜在风险如下:

  • docroot\misc\typo3\drupal security\PharExtensionInterceptor.php
  • docroot\misc\typo3\phar流包装器\src\Interceptor\connectioninterceptor.php
  • docroot\misc\typo3\phar流包装器\src\Interceptor\PharExtensionInterceptor.php
  • docroot\misc\typo3\phar流包装器\src\Interceptor\pharmadatainterceptor.php
  • docroot\misc\typo3\phar stream wrapper\src\PharStreamWrapper.php
  • docroot\misc\typo3\phar流包装器\src\Assertable.php
  • docroot\misc\typo3\phar流包装器\src\Behavior.php
  • docroot\misc\typo3\phar流包装器\src\Manager.php

我真的很困惑Drupal是如何声明断言函数的,即使它们已经被弃用了,也许我误读了文档?有一些方法可以测试这些文件,以确保所有东西都能在PHP7.3上工作?

这些文件不应该导致任何与不推荐使用的名称空间
assert()
相关的问题

该弃用引用了一个带名称空间的
assert()
函数,但这些文件中包含的是类方法

如果我的解释不清楚,这里有一个基本的差异示例:

名称空间断言函数(已弃用)


不推荐使用的函数通常会在下一个主要版本中删除,例如:PHP8。在那之前,他们会发出E_不推荐的消息,让你知道在不久的将来会发生什么。
<?php
namespace Foo;

function assert() {}
<?php
namespace Foo;

class Something
{ 
    public function assert() {}
}