search
Homephp教程php手册PHP输出当前进程所有变量/常量/模块/函数/类的示例

PHP输出当前进程所有变量、常量、模块、函数、类的示例

1. get_defined_vars  (PHP 4 >= 4.0.4, PHP 5) — 获取由所有已定义变量所组成的数组
array get_defined_vars ( void )
此函数返回一个包含所有已定义变量列表的多维数组,这些变量包括环境变量、服务器变量和用户定义的变量。

复制代码 代码如下:


echo '

';<br>$b = array(1,1,2,3,5,8);<br>$arr = get_defined_vars();<br>// 打印 $b<br>print_r($arr["b"]);<br>// 打印所有服务器变量<br>print_r($arr["_SERVER"]);<br>// 打印变量数组的所有可用键值<br>print_r(array_keys(get_defined_vars()));<br>?><br>2. get_defined_functions (PHP 4 >= 4.0.4, PHP 5) — 获取所有已经定义的函数<br>array get_defined_functions ( void ) //void 表示为空,,不需要任何参数<br><?php <BR>echo '<pre class="brush:php;toolbar:false">';<br>function foo()<br>{<br>    echo "This is my function foo";<br>}<br>$arr = get_defined_functions();<br>print_r($arr);<br>?><br><br>3. get_loaded_extensions (PHP 4, PHP 5) — 获取所有可用的模块<br><p><span>复制代码</span> 代码如下:</p><p><br><?php <BR>echo '</p><pre class="brush:php;toolbar:false">';<br>print_r(get_loaded_extensions());<br>?><br><br>4. get_extension_funcs (PHP 4, PHP 5) — 获取指定模块的可用函数<br>array get_extension_funcs ( string $module_name ) 该函数返回指定模块所有可用的函数。传入的参数(模块名称)必须是小写<br><p><span>复制代码</span> 代码如下:</p><p><br><?php <BR>echo '</p><pre class="brush:php;toolbar:false">';<br>print_r(get_extension_funcs("gd"));<br>print_r(get_extension_funcs("xml"));<br>?><br><br>5. get_defined_constants (PHP 4 >= 4.1.0, PHP 5) —  获取关联数组的名字所有的常量和他们的价值<br>array get_defined_constants ([ bool $categorize = false ] )<br><p><span>复制代码</span> 代码如下:</p><p><br><?php <BR>echo '</p><pre class="brush:php;toolbar:false">';<br>define("MY_CONSTANT", 1);<br>print_r(get_defined_constants(true));<br>?><br><br>6. get_declared_classes (PHP 4, PHP 5) —  获取由已定义类的名字所组成的数组<br>    array get_declared_classes ( void )<br><p><span>复制代码</span> 代码如下:</p><p><br><?php <BR>echo '</p><pre class="brush:php;toolbar:false">';<br>//define classone<br>class classone { }<br>//define classtwo<br>class classtwo { }<br>//This will show X classes (built-ins, extensions etc) with<br>//classone and classtwo as the last two elements<br>print_r(get_declared_classes());<br>//define classthree<br>class classthree { }<br>//...and four<br>class classfour { }<br>//Shows the same result as before with class three and four appended<br>print_r(get_declared_classes());<br>?><br>



Statement
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
com surrogate是什么进程com surrogate是什么进程Sep 14, 2022 pm 02:56 PM

“com surrogate”是“C:\Windows\System32\dllhost.exe”的进程;出现该进程通常是“COM+”组件停止工作,这个进程占用高甚至直接未响应,这是由于电脑在加载文件图标的时候出现问题,导致电脑变的卡顿,可以在计算机属性设置中解决卡顿问题。

如何在 Windows 11 中停止任务管理器进程更新并更方便地终止任务如何在 Windows 11 中停止任务管理器进程更新并更方便地终止任务Aug 20, 2023 am 11:05 AM

如何在Windows11和Windows10中暂停任务管理器进程更新按CTRL+窗口键+删除打开任务管理器。默认情况下,任务管理器将打开“进程”窗口。正如您在此处看到的,所有应用程序都在无休止地移动,当您想要选择它们时,可能很难将它们指向下方。因此,按CTRL并按住它,这将暂停任务管理器。您仍然可以选择应用程序,甚至可以向下滚动,但您必须始终按住CTRL按钮。

什么是程序运行时指令流的最小单位什么是程序运行时指令流的最小单位Aug 23, 2022 pm 02:16 PM

“线程”是程序运行时指令流的最小单位。进程是指一个具有一定独立功能的程序,而线程是进程的一部分,描述指令流执行状态;线程是进程中的指令执行流的最小单位,是CPU调度的基本单位。一个线程是一个任务(一个程序段)的一次执行过程;线程不占有内存空间,它包括在进程的内存空间中。在同一个进程内,多个线程共享进程的资源;一个进程至少有一个线程。

multitip.exe是什么进程multitip.exe是什么进程Mar 13, 2023 pm 01:41 PM

multitip.exe是360内置的广告弹窗进程,其中包括了今日优品、焦点资讯、每日趣玩等广告弹窗;其删除方法:1、找到并删除sesvc.exe文件;2、在原来的目录下建立一个sesvc.exe目录,然后将这个目录的所有用户的“完全控制”权限设置为“拒绝”即可。

一个进程被唤醒意味着什么一个进程被唤醒意味着什么Jul 08, 2022 pm 04:50 PM

一个进程被唤醒意味着进程变为就绪状态。进程状态反映进程执行过程的变化,进程被唤醒就是激活这个进程,意味着它变为就绪状态,也表示该进程具备运行条件,等待系统分配处理器以便运行;但进入就绪状态后并不马上移至就绪队列队首,而是在队尾参加排队。

进程间的五种通信方式是什么进程间的五种通信方式是什么Dec 07, 2020 pm 01:51 PM

进程间的五种通信方式:1、管道,速度慢,容量有限,只有父子进程能通讯;2、FIFO,任何进程间都能通讯,但速度慢;3、消息队列,可以实现消息的随机查询,容量受到系统限制;4、信号量,不能传递复杂消息,只能用来同步;5、共享内存区,指两个或多个进程共享一个给定的存储区。

Go语言中如何输出带有换行符的文本Go语言中如何输出带有换行符的文本Mar 15, 2024 pm 04:15 PM

Go语言是一种现代化、高效且简洁的编程语言,广泛应用于各种领域的软件开发中。在Go语言中,输出带有换行符的文本非常简单,可以通过使用fmt包提供的Println函数实现。下面我们将具体介绍如何在Go语言中输出带有换行符的文本,以及相关的代码示例。在Go语言中,想要输出带有换行符的文本,可以使用fmt包提供的Println函数。Println函数会在输出文本的

父进程和子进程可以并发执行吗?父进程和子进程可以并发执行吗?Sep 02, 2022 am 11:29 AM

父进程和子进程可以并发执行;不管是父进程还是子进程都是系统分配资源的最小单位,都是独立的进程,是可以并发运行的,并发在微观上不是同时执行的,只是把时间分成若干段,使多个进程快速交替的执行,从宏观外来看,好像是这些进程都在执行。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment