Home > Backend Development > PHP Tutorial > PHP method to determine which class an object is derived from, PHP determines the derivation of an object_PHP tutorial

PHP method to determine which class an object is derived from, PHP determines the derivation of an object_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 09:49:38
Original
1035 people have browsed it

php method to determine which class an object is derived from, php to determine which class an object is derived from

The example in this article describes the method in php to determine which class an object is derived from. Share it with everyone for your reference. The specific implementation method is as follows:

<&#63;php 
$th = new Thread; //创建新对象 
if ($th instanceof Thread) //如果对象$th是Thread类型的,则输出Yes 
  echo "Yes"; 
else 
  echo "No"; 
&#63;>

Copy after login

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1019433.htmlTechArticlephp method to determine which class the object is derived from, php determines the object is derived. This article tells the example of php determining whether the object is derived. method from which class. Share it with everyone for your reference. Specific implementation...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template