douzheyo2617 2009-01-10 15:12
浏览 26
已采纳

使用Math_Matrix PEAR库的意外T_CLONE

I've not used PEAR before, and so I'm probably doing something dumb. I've installed the Math_Matrix library, but when I include it I just get an error. My entire code is this:

<?php
  $path = '/home/PEAR/Math_Matrix-0.8.0';
  set_include_path(get_include_path() . PATH_SEPARATOR . $path);
  include_once 'Matrix.php';
?>

The error I get is this:

Parse error: syntax error, unexpected T_CLONE, expecting T_STRING in /home/PEAR/Math_Matrix-0.8.0/Matrix.php on line 272

I'm not really sure what to make of that. I guess the explanations I can think of are:

  1. I've not installed the Math_Matrix library properly (I'm on a shared server which already had PEAR installed on it) or have downloaded the wrong version of it.
  2. I'm supposed to include something else before I include Matrix.php
  3. I've included the wrong file (or the right filename but with the wrong path, somehow).

To install it, I did the following:

pear install --alldeps channel://pear.phpunit.de/PHPUnit
pear install --alldeps channel://pear.php.net/Math_Vector-0.6.2
pear install Math_Matrix
  • 写回答

1条回答 默认 最新

  • doudouchan5830 2009-01-10 15:41
    关注

    From the [Math_Matrix](http://pear.php.net/package/Math_Matrix homepage) I can see that it was last updated in 2003. Since then, PHP has added the clone keyword, which is conflicting with the clone() function defined in Matrix.php.

    You need to update Matrix.php - a search & replace on "clone" with "clone2" should do it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀