Add a variable to a class instance at runtime: Difference between revisions
Add a variable to a class instance at runtime (view source)
Revision as of 06:07, 27 January 2021
, 3 years ago→{{header|Phix}}: for dynamic names use []
(added MiniScript example) |
m (→{{header|Phix}}: for dynamic names use []) |
||
Line 1,265:
end class
wobbly wobble = new()
?wobble.jelly -- 0
--?wobble["jelly"] -- for dynamic names use []
wobble.jelly = "green"
?wobble.jelly -- "green"</lang>
=={{header|PHP}}==
|