php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8257 Functions defined in the auto-appended file cannot be called from original file
Submitted: 2000-12-14 08:11 UTC Modified: 2000-12-14 10:00 UTC
From: dron007 at yahoo dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.3pl1 OS: Red Hat 5.2 (kernel 2.2.17)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dron007 at yahoo dot com
New email:
PHP Version: OS:

 

 [2000-12-14 08:11 UTC] dron007 at yahoo dot com
In php.ini file:
 auto_append_file =/usr/local/apache/htdocs/www/after.phtml

File test.phtml:
<?
 test();
?>

File after.phtml:
<?
 echo "after.phtml start<br>";
 function test()
   {
    echo "test";
   }
 echo "after.phtml end<br>";
?>

When I run file test.phtml I see the message:

"Fatal error: Call to undefined function: test() in /usr/local/apache3/htdocs/www/oc/test.phtml on line 2"

After removing the call of test() function in test.phtml everything works OK. It shows:

after.phtml start
after.phtml end

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-14 10:00 UTC] hholzgra@php.net
the append file is parsed after your script is done, 
what you are looking for is most likely auto_prepend,
not auto_append
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jul 15 21:00:01 2026 UTC