php-src/sapi/phpdbg/tests/register_function.phpt
Niels Dossche 8cb15f6203 Fix crashes in function registration + test
Internal function won't need their refcount increased as they outlive
the debugger session, and userland functions won't be unloaded either.
So no refcount management is necessary for registered functions.
2025-01-06 20:17:25 +00:00

30 lines
384 B
PHP

--TEST--
Test registering of functions
--PHPDBG--
R testfunc
testfunc 1 2 3
R var_dump
var_dump foo
q
--FILE--
<?php
function testfunc() {
var_dump(func_get_args());
}
?>
--EXPECTF--
[Successful compilation of %s]
prompt> [Registered testfunc]
prompt> array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
prompt> [Registered var_dump]
prompt> string(3) "foo"
prompt>