PHP bug, possible workaround?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

PHP bug, possible workaround?

Post by John Cartwright »

I'm using the Zend Framework, latest SVN edition, and have run into what I think is this bug

Notice: Indirect modification of overloaded property Application_View_Layout::$tracks has no effect in C:\xampp\htdocs\Application\Template\Layout\Index.php on line 250

is generated during this simple iteration,

Code: Select all

<h3>Latest Music </h3>
<?php foreach ($this->tracks as $track) { ?>
<div class="right_articles">
	<p><strong><?php echo $track['title']; ?></strong><br />
		<?php echo $track['artists']; ?> <br />
		<a href="#">Listen</a> | <a href="#">Download</a>
	</p>
</div>
<?php } ?>
Everything is printed as expected. I guess it has to do with magic methods accessing the array, but I have no idea how to get rid of this notice! If you guys need more code, let me know.. but I truly am stumped.

PHP Version 5.2.0
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Make a copy of the array into a temporary variable?
Post Reply