那这个错误时怎么回事?
Fatal error: Attempt to access a Java property on a non-Java object in D:\Apache2\htdocs\ftp.php on line 3

解决方案 »

  1.   

    首先你把你 php.ini 中的 display_errors = On 改为 display_errors = Off 保存重起apache.文件: test.javapublic class test
    {
    int a;

    public void seta(int val){
    this.a=val;
    }

    public int geta(){
    return a;
    }
    }文件 test.php
    <?
    $test=new Java("test");
    $test->seta(123);
    echo $test->geta();
    ?>运行显示结果:
    123
      

  2.   

    to myblessu
    你给的程序的确可以正确显示
    但是display_errors = On 改为 display_errors = Off
    就把所有的错误给屏蔽了,这样不太好吧
    还有php中不能直接给java的实例变量赋值
    如果$test->a=123;
    就会出现这样的错误,这是怎么回事?
    Fatal error: Attempt to access a Java property on a non-Java object