为了账号安全,请及时绑定邮箱和手机立即绑定

php 送我的类不存 为什么会报错 Fatal error: Class 'shoproduct' not found in

php 送我的类不存 为什么会报错 Fatal error: Class 'shoproduct' not found in

PHP
慕UI1458911 2018-02-23 18:41:39
<?phpclass ShoProductWriter{ public function write($shoproduct) { $str = "{$shoproduct->title}".$shoproduct->getProducer()."({$shoproduct->price})"; print $str; }}$c = new ShoProductWriter();$shoproduct1 = new shoproduct();
查看完整描述

2 回答

?
qq_嗨那谁快跑_0

TA贡献1条经验 获得超0个赞

shoproduct 类不存在,需要创建这个shoproduct类

查看完整回答
反对 回复 2018-05-14
?
我就是癈

TA贡献1条经验 获得超0个赞

应该是这一行出错

$shoproduct1 = new shoproduct();

你没有定义 class shoproduct

查看完整回答
反对 回复 2018-02-24
  • 2 回答
  • 0 关注
  • 1266 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号