unset() is considered undefined in the HHVM debugger
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
**Describe the bug**
The `unset()` builtin does not appear to be defined in the HHVM command line debugger/repl (`hhvm -a`).
**Standalone code, or other way to reproduce the problem**
```
$ hhvm --no-config -a
hphpd> $foo = dict['test' => true];
$foo = dict['test' => true];
hphpd> unset($foo['test']);
unset($foo['test']);
Notice: Attempted to interpret unknown debugger command as PHP!
Hit a php exception : Error: Call to undefined function unset() in :1
Stack trace:
#0 (1): include()
#1 (): include()
#2 {main}
```
But this works via a CLI script:
```
<<__EntryPoint>>
function main(): void {
$foo = dict['a' => true];
var_dump($foo);
unset($foo['a']);
var_dump($foo);
}
```
```
$ hhvm test.hack
dict(1) {
["a"]=>
bool(true)
}
dict(0) {
}
```
**Expected behavior**
`unset()` should be defined and should work in the debugger.
**Actual behavior**
```
Hit a php exception : Error: Call to undefined function unset() in :1
```
**Environment**
- Operating system
**MacOS Catalina**
- Installation method
**homebrew**
- HHVM Version
```
hhvm --version
HipHop VM 4.80.0 (rel)
Compiler: 1603142563_N
Repo schema: 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
```
### Other context
I'm not sure which version this broke in - it behaves this way under 4.56 as well, but it works as expected in 4.39.
Contributor guide
Assessment
This issue has not been assessed yet.