How does the PHP code execute even without closing the ?> PHP tag? -
following code come notice php file:
<?php # should log same directory file $log = klogger::instance(dirname(__file__), klogger::debug); $args1 = array('a' => array('b' => 'c'), 'd'); $args2 = null; $log->loginfo('info test'); $log->lognotice('notice test'); $log->logwarn('warn test'); $log->logerror('error test'); $log->logfatal('fatal test'); $log->logalert('alert test'); $log->logcrit('crit test'); $log->logemerg('emerg test'); $log->loginfo('testing passing array or object', $args1); $log->logwarn('testing passing null value', $args2);
you can notice closing php tag(?>
) not present there still statements within code working perfect. i'm not getting how possible execute code without completion of php tag(?>
). researched didn't satisfatory explanation. can guide me in regard? in advance.
the closing tag exists tell interpretter should stop executing text , output verbatim. unlike xml, requires openning , closing tags match valid, php interpretter uses tags delimit execution should start , stop.
just php file have no opening tag - meaining entire contents output, no closing tag necessary once end-of-file reached execution ends.
Comments
Post a Comment