dWhen executing this code:

$this->items = $object->getItens();
...
foreach($this->items as $item)
{
...yadda yadda $item->getId() yadda yadada
}

within a symfony action, the php engine throws:

Notice: Indirect modification of overloaded property  xxxActions::$items has no effect in xxxactions.class.php

That’s related to a php bug , whose implications in symfony are described here. It looks like it’s related to php 5.2. I can see it appears on version 5.2.0  . It looks like the bug is gone in version 5.2.4.

Anyway, the simple workaround: insted of iterate through $this->items, we do:

$items = $object->getItems();
...
foreach($items as $item)
{
...yadda yadda $item->getId() yadda yadda
}
$this->items = $items;

and that’s it.


No Comments on “Beware: bug in php.”

You can track this conversation through its atom feed.

No one has commented on this entry yet.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>