note 100962 added to function.halt-compiler

From: Date: Wed, 17 Nov 2010 15:06:21 +0000
Subject: note 100962 added to function.halt-compiler
Groups: php.notes 
Request: Send a blank email to php-notes+get-174124@lists.php.net to get a copy of this message
It's possible to use __halt_compiler() with included files. Only the current file will be affected, so it could be a good way to make plugins which embed a controller and its view in the same file (like Ultimater at gmail dot com did). Base.php <?php echo "Base 1\n"; require 'Included.php'; echo "Base2 \n"; ?> Included.php <?php echo "Included 1\n"; __halt_compiler(); echo "Included 2\n"; ?> Calling Base.php will display: Base 1 Included 1 Base 2 ---- Server IP: 69.147.83.197 Probable Submitter: 88.180.135.171 ---- Manual Page -- http://www.php.net/manual/en/function.halt-compiler.php Edit -- https://master.php.net/note/edit/100962 Del: integrated -- https://master.php.net/note/delete/100962/integrated Del: useless -- https://master.php.net/note/delete/100962/useless Del: bad code -- https://master.php.net/note/delete/100962/bad+code Del: spam -- https://master.php.net/note/delete/100962/spam Del: non-english -- https://master.php.net/note/delete/100962/non-english Del: in docs -- https://master.php.net/note/delete/100962/in+docs Del: other reasons-- https://master.php.net/note/delete/100962 Reject -- https://master.php.net/note/reject/100962 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#174124) next »