在C:xamppphp Pear Config.php第80行中,通过引用分配new的返回值已被弃用


Pear error: Deprecated: Assigning the return value of new by reference is deprecated in C:xamppphpPEARConfig.php on line 80 Deprecated

我试图安装Media frontpage (www.mediafrontpage.net)来监控我的sickbeard/sabnzbd等。由于这些烦人的PEAR错误,我无法让它工作:

Deprecated: Assigning the return value of new by reference is deprecated in C:'xampp'php'PEAR'Config.php on line 80 
Deprecated: Assigning the return value of new by reference is deprecated in C:'xampp'php'PEAR'Config.php on line 166

奇怪的是,mediaffrontpage根本没有使用pear !我仍然得到这个恼人的错误。

我的另一个应用程序需要PEAR,所以我不能直接删除它。

看这个截图,你可以看到错误:http://piclair.com/data/kfw8s.jpg

我尝试使用'php go-pear '升级pear。

导致错误的行看起来像

 $var = &new Something;

去掉new前面的&号

要么将error_reporting设置为没有E_DEPRECATED的值(例如E_ALL ^ E_DEPRECATED或仅为0),要么使用不基于旧PHP版本的CMS

使用这个:

$object = &new class();
在早期的PHP版本中,

是将对象作为引用存储在代码中的必要方式,但在当前版本中,所有对象都是自动引用,因此使用&new现在已弃用

这只是一个描述赋值问题的包错误。所以我们通常可以替换赋值 =,与= 在错误语句的两行中。这样我们的问题就解决了。