3

I've downloaded the Zend framework stable build (1.11, I believe), uploaded to my servers, and added it to my php include path.

My goal is to use the Feed and Feed_Writer modules to handle some RSS and Atom heavy lifting.

The problem is that whenever I include the Feed_Writer file, I get a random f that shows up at the beginning of my document.

require('Zend/Feed.php');
require('Zend/Feed/Writer/Feed.php');

will result in the f, but doesn't throw a fatal when I instantiate a Zend_Feed_Writer_Feed

require('Zend/Feed.php');

will not result in the f, but does throw a fatal when I instatiate a Zend_Feed_Writer_Feed

I'm new to the Zend framework, is this some sort of mysterious error code? If so, is there a reference for these sort of things? "Zend f" and "Zend output f" and "Zend echo f" are not particularly google friendly.

EDIT

Here is some source that is dumbed down from mine, but still exhibits the error

<?php
require('Zend/Feed.php');
require('Zend/Feed/Writer/Feed.php');

$feed = new Zend_Feed_Writer_Feed;
echo 'hi'
?>

The output from this is fhi

EDIT 2

Thanks to @Drew010 for the answer. Here's the little f

https://i.stack.imgur.com/h8zdM.png

wmarbut
  • 4,595
  • 7
  • 42
  • 72
  • Sounds like you have a stray `f` somewhere in one of your files (outside of PHP code). – Matt Aug 16 '12 at 13:20
  • do you still get the random `f` when using `require_once(Zend/Feed.php);`? I believe all dependencies are included in the main `Feed` script, so you might be `require`-ing the same file twice. Not sure if that's the case/cause here but it could cause issues – Elias Van Ootegem Aug 16 '12 at 13:22
  • @Matt, no error message and definitely no stray `f`. I am just starting to play with the framework. The only file that I have it included on is a few lines long and the `f` does not show up until I included the `Zend/Feed/Writer/Feed.php` file. Perhaps Zend has a stray somewhere in all of their includes, but I highly doubt that an enterprise level framework would do that in their stable release. – wmarbut Aug 16 '12 at 13:23
  • @EliasVanOotegem I do indeed still get it with the `require_once`. I thought the same thing about Feed `require`ing all dependencies, but I noticed that wasn't the case here b/c I get a `fatal` when I try to instantiate a `Zend_Feed_Writer_Feed` unless I include the second file. – wmarbut Aug 16 '12 at 13:25
  • Is it possible you were searching for something in a file, using `ctrl+f` but missed the `ctrl` button, inserting the `f` accidentally? – Matt Aug 16 '12 at 13:26
  • @Matt, I'm not catching any errors here, just playing around, so when I try to instantiate a class that doesn't exist it is a fatal error for php and the process exits. `Fatal error: Class 'Zend_Feed_Writer_Feed' not found` – wmarbut Aug 16 '12 at 13:27
  • Got it. Basically the error has nothing to do with the `f` showing up. – Matt Aug 16 '12 at 13:27
  • 1
    @wmarbut: If I were you, I'd dump my include paths, check to see if they're set correctly, and include `Zend/Feed/Writer.php` instead, to avoid any future issues. Also, I must say a rogue `f` somewhere in your code is _very_ likely – Elias Van Ootegem Aug 16 '12 at 13:31
  • @EliasVanOotegem I would tend to agree with you, but if you have a look at my edit, you will see that *very* dumbed down source still throws the error for me. I'll output those paths though, that's a good idea – wmarbut Aug 16 '12 at 13:33
  • 1
    Delete the ZF source, download a fresh copy and see if you still have the same problem. – Tim Fountain Aug 16 '12 at 13:36
  • @EliasVanOotegem the only thing in my include path is zend `.:/web_apps/library` – wmarbut Aug 16 '12 at 13:37
  • @wmarbut: I'm with Tim... I'm looking at the files here, can't see what's causing your problem. Get a fresh copy, check your `phpinfo()` output, and set your ini to `E_STRICT | E_ALL`, if you haven't already – Elias Van Ootegem Aug 16 '12 at 13:40
  • @EliasVanOotegem a new copy of Zend does the same thing. The source is the same from the edit. I'll try to get an environment to do `E_STRICT | E_ALL` later today. We run some legacy code, so I have to be careful – wmarbut Aug 16 '12 at 15:11
  • @wmarbut, legacy... ouch, `E_STRICT` will spit deprecated warnings all over probably... Might be a long shot, but I just thought of it: are you using `realpath('/web_apps/library')`? Since you're new to zend, also create a new project and look at the index.php file, see how they set up their include paths, might be overkill, but perhaps copy that, see if that has _anything_ to do with that ghost-`f` – Elias Van Ootegem Aug 16 '12 at 16:04
  • make sure you got the Zend Framework from http://framework.zend.com/download/latest, you just need the minimal unless you want ZendX and Dojo. – RockyFord Aug 16 '12 at 17:00
  • @RockyFord I did get it fromt the framework.zend.com/download/latest address, but I didn't get the minimal one. – wmarbut Aug 16 '12 at 17:57
  • 1
    I also am seeing this happening. @wmarbut did you have any luck fixing it? Switching back to an older version of zend fixed it for me. – camomileCase Aug 16 '12 at 18:05
  • @camomileCase, no, but I hadn't tried an older version. I may give that a try later. Thanks! – wmarbut Aug 16 '12 at 18:09
  • @camomileCase we've got an answer now! :) – wmarbut Aug 16 '12 at 22:10

1 Answers1

5

This issue is fixed in ZF 1.11.12, there was a bug where an f was accidentally placed at the beginning of the file Zend/Feed/Writer/Deleted.php.

Bug report is here. You can safely delete the f from the beginning of the file, or use the 1.11.12 release.

drew010
  • 68,777
  • 11
  • 134
  • 162
  • Thank you sir, you'd think that an enterprise framework would have better QC than this. – wmarbut Aug 16 '12 at 22:08
  • 1
    :) yea that's quite an unfortunate introduction to the code. I've been using 1.12 Beta for a few weeks now, it has some other fixes, one that I needed for php 5.4, you may want to check that out as well. – drew010 Aug 17 '12 at 05:42
  • The 1.11.12 release appears to have the bug as well. – camomileCase Aug 17 '12 at 18:18