Jump to content

Send an unknown method call: Difference between revisions

Line 422:
say $object."$name"(5); # 47</lang>
The double quotes are required, by the way; without them the variable would be interpreted as a hard ref to a method.
 
=={{header|Phix}}==
Not specifically anything to do with objects, but you can construct routine names at runtime:
<lang Phix>procedure Hello()
?"Hello"
end procedure
 
string erm = "Hemmm"
for i=3 to 5 do
erm[i]+=-1+(i=5)*3
end for
 
call_proc(routine_id(erm),{})</lang>
 
=={{header|PHP}}==
7,820

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.