|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70716 Autoload a class will output an extra character "\n"
Submitted: 2015-10-15 06:54 UTC Modified: -
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ccxopen at gmail dot com Assigned:
Status: Open Package: yaf (PECL)
PHP Version: 5.5.30 OS: ubuntu 12.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
44 - 9 = ?
Subscribe to this entry?

 [2015-10-15 06:54 UTC] ccxopen at gmail dot com
Example A:

echo "a";
$A = new A(); //A.php in the application/library,YAF will autoload the class
echo "b";

The output is:

But Should be:

Example B:
I make a Class like this and put the file in application/library/Controller.php

abstract class Controller extends Yaf_Controller_Abstract{

Then I create a Index.php in application/controllers/index.php
class IndexController extends Controller {
    public function indexAction() {

        echo "a";

I call the action index,the output should be "a",but the result is "\na",an extra character "\n" appear before a.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-19 04:06 UTC]
This might happen if one of your class files has a closing ?> with a new line after it. If so, that is your problem, not yaf.

To avoid this problem, don't use a closing ?> in files that are entirely PHP code.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 11:01:29 2024 UTC