Current Location: Home> Function Categories> __halt_compiler

__halt_compiler

Interrupt the compiler execution
Name:__halt_compiler
Category:Miscellaneous
Programming Language:php
One-line Description:Stop compiler execution.

Definition and usage

__halt_compiler() function is used to stop the compiler's execution.

grammar

 __halt_compiler ( )

illustrate

The __halt_compiler() function is not actually used to stop the compiler in regular PHP scripts. Its main purpose is to use it with the Phar packager. When creating a Phar archive, you can use the __halt_compiler() function to separate the PHP code from the archived metadata. In this case, nothing after __halt_compiler() is executed as PHP code, but is stored in the metadata archived by Phar. This function itself does not really "stop" the PHP compiler, its name may be a bit misleading. Calling this function in a regular PHP script does not actually have any effect.

Similar Functions