<?php class TestClass { public $var = 1; } $testArray = array( new TestClass(), new TestClass() ); foreach($testArray as $t) { $t->var = 2; } var_dump($testArray[0]->var);
You have javascript disabled. You will not be able to edit any code.