Cause an intentional memory leak, for testing/debugging purposes */
ZEND_FUNCTION(leak)
{
- zend_long leakbytes=3;
+ zend_long leakbytes = 3;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &leakbytes) == FAILURE) {
return;
}
/* }}} */
-/* {{{ proto leak_variable(mixed variable [, bool leak_data]) */
+/* {{{ proto void leak_variable(mixed variable [, bool leak_data])
+ Leak a variable that is a resource or an object */
ZEND_FUNCTION(leak_variable)
{
zval *zv;
#ifdef ZEND_TEST_EXCEPTIONS
+/* {{{ proto void crash(void)
+ Crash the script */
ZEND_FUNCTION(crash)
{
- char *nowhere=NULL;
+ char *nowhere = NULL;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
memcpy(nowhere, "something", sizeof("something"));
}
+/* }}} */
#endif
#endif /* ZEND_DEBUG */