|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ccxopen at gmail dot com
New email:
PHP Version: OS:


 [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-2023 The PHP Group
All rights reserved.
Last updated: Tue Sep 26 08:01:24 2023 UTC