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 这种微信登录授权 谁可以做啊
  • ¥15 请问我该如何添加自己的数据去运行蚁群算法代码
  • ¥20 用HslCommunication 连接欧姆龙 plc有时会连接失败。报异常为“未知错误”
  • ¥15 网络设备配置与管理这个该怎么弄
  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来