3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cellData = (object) ['c' => 500, 'g' => 500]; foreach ($cellData as $key => $value) { $cellData->$key = $value*2; echo $key; } var_dump( $cellData );
based on o2FAO
Output for 5.6.0 - 5.6.29, 7.1.0 - 7.3.0beta1
cgobject(stdClass)#1 (2) { ["c"]=> int(1000) ["g"]=> int(1000) }
Output for 7.0.0 - 7.0.20
ccgobject(stdClass)#1 (2) { ["c"]=> int(2000) ["g"]=> int(1000) }