Deprecated: Assigning the return value of new by reference is
deprecated in C:\Workspace\htdocs\feedBlurb\processing\simplepie.inc
on line 738
this is the error I get when I run the following SimplePie code on my server:
<?php
require_once("processing/simplepie.inc");
$feed = new SimplePie();
$feed->set_feed_url(array('http://feeds2.feedburner.com/CssTricks', 'http://smashingmagazine.com'));
$feed->enable_cache(true);
$feed->set_cache_location('core/cache');
$feed->set_cache_duration(1800);
$feed->init();
$feed->handle_content_type();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='UTF-8'>
<title>Feedblurb</title>
</head>
<body>
<div id="content">
<h1>Feedblurb</h1>
<?php if($feed->error): ?>
<span id='error'><?php echo $feed->error; ?></span>
<?php endif; ?>
<?php foreach($feed->get_items() as $item): ?>
<?php endforeach; ?>
</div>
</body>
</html>
It seems like all instances of SimplePie don’t seem to work on my server.. But I have a WordPress blog which is running SimplePie and that seems to work just fine. My development server is running the latest version of XAMPP. Any ideas?
You are using a version of SimplePie specifically designed to support legacy PHP4 applications, so your modern installation of XAMPP will cause it to cough up deprecation warnings.
You should upgrade to a newer version of SimplePie which is actively maintained and designed for modern versions of PHP.
If you can’t upgrade, you can either fix the error yourself, or configure your server to stop reporting deprecation warnings by changing
error_leveltoE_ALL & ~E_DEPRECATEDin your php.ini: