PHP 调用对象方法问题
Call to a member function get_type() on string in
<code>public function process($aData, &$aResult, $aConfig) { var_dump($this->cart_object_apps);die;//数组里面是3个对象 foreach ($this->cart_object_apps as $key => $object) { $type_name = $object->get_type();//为什么调用此方法会包上述错误 //$aResult['object'][$type_name] = $object->getAll(true,$aData); } </code>
回复内容:
Call to a member function get_type() on string in
<code>public function process($aData, &$aResult, $aConfig) { var_dump($this->cart_object_apps);die;//数组里面是3个对象 foreach ($this->cart_object_apps as $key => $object) { $type_name = $object->get_type();//为什么调用此方法会包上述错误 //$aResult['object'][$type_name] = $object->getAll(true,$aData); } </code>
说明这个$object
没有get_type
方法。
我猜你是想调用gettype
来获取类型吧?请参考这里:http://php.net/manual/zh/function.gettype.php

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
