--TEST-- Extending LuaSandbox --FILE-- {"var$i"} = $i; } var_dump( $sandbox ); for($i=6; $i<=10; $i++){ $sandbox->{"var$i"} = $i; } var_dump( $sandbox ); echo "ok\n"; --EXPECT-- object(ExtendedLuaSandbox)#1 (5) { ["var1"]=> int(1) ["var2"]=> int(2) ["var3"]=> int(3) ["var4"]=> int(4) ["var5"]=> int(5) } object(ExtendedLuaSandbox)#1 (10) { ["var1"]=> int(1) ["var2"]=> int(2) ["var3"]=> int(3) ["var4"]=> int(4) ["var5"]=> int(5) ["var6"]=> int(6) ["var7"]=> int(7) ["var8"]=> int(8) ["var9"]=> int(9) ["var10"]=> int(10) } ok