Description
PHP allows isset() and unset() to take multiple arguments, but elephc rejects both forms with an arity error.
This is a direct PHP compatibility issue.
Reproduction
isset()
<?php
$a = 1;
$b = null;
echo isset($a, $b) ? "yes\n" : "no\n";
PHP output
elephc behavior
Compilation fails with:
error[4:6]: isset() takes exactly 1 argument
unset()
<?php
$a = 1;
$b = 2;
unset($a, $b);
echo isset($a) ? "a\n" : "na\n";
echo isset($b) ? "b\n" : "nb\n";
PHP output
elephc behavior
Compilation fails with:
error[4:1]: unset() takes exactly 1 argument
Expected behavior
Both programs should compile and behave like PHP:
isset($a, $b) should return true only if all operands are set and not null
unset($a, $b) should unset all listed variables
Actual behavior
elephc hard-rejects the PHP-valid multi-argument forms.
Environment
- elephc 0.21.14
- PHP 8.4.20
- macOS ARM64
Notes
This likely lives in builtin signature / argument validation rather than runtime lowering.
Description
PHP allows
isset()andunset()to take multiple arguments, but elephc rejects both forms with an arity error.This is a direct PHP compatibility issue.
Reproduction
isset()PHP output
elephc behavior
Compilation fails with:
unset()PHP output
elephc behavior
Compilation fails with:
Expected behavior
Both programs should compile and behave like PHP:
isset($a, $b)should returntrueonly if all operands are set and notnullunset($a, $b)should unset all listed variablesActual behavior
elephc hard-rejects the PHP-valid multi-argument forms.
Environment
Notes
This likely lives in builtin signature / argument validation rather than runtime lowering.