<?php
require_once('posterstore/productmanager.inc');
$pm = ProductManager::getInstance();
print "111";
$prints = $pm->getMatchingProducts(1);
print "111111";
?>怎么只能打印出 111不打印 111111$prints = $pm->getMatchingProducts(1);这句出什么错误了??

解决方案 »

  1.   

    把错误提示打开error_reporting(E_ALL ^ E_NOTICE);
      

  2.   

    $pm不是对象啊....,没有提示信息么?
     $pm = ProductManager::getInstance(); 得到的只是getInstance()的返回值ps: 1,通过 :: 可以直接调用某个类中的方法.
        2,创建对象后通过->调用方法.
      

  3.   

    <?php
    require_once('posterstore/productmanager.inc');
    $pm = new ProductManager();
    print "111";
    $prints = $pm->getMatchingProducts(1);
    print "111111";
    ?>
      

  4.   

    var_dump($pm);看看这个对象有没问题.