ForNext
Only Do What Only You Can Do
144. pass number or string by reference
Hyperpolyglot Interpreted Languages: PHP, Perl, Python, Ruby より (2012.05.08)
VBScript
JScript
Perl
sub foo { $_[0] += 1; $_[1] .= "ly"; } my $n = 7; my $s = "hard"; foo($n, $s);
PHP
function foo(&$x, &$y) { $x += 1; $y .= "ly"; } $n = 7; $s = "hard"; foo($n, $s);
Python
not possible
Ruby
not possible