php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #70773
Patch my_test revision 2015-10-23 03:53 UTC by svein at vip dot qq dot com

Patch my_test for Scripting Engine problem Bug #70773

Patch version 2015-10-23 03:53 UTC

Return to Bug #70773 | Download this patch
Patch Revisions:

Developer: svein@vip.qq.com

//Segmentation fault (core dumped) when this function called
PHP_FUNCTION(my_test)
{
    long type = 0;
    char *function_name = NULL;
    int   function_name_len = 0;

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &type 
            ,&function_name,&function_name_len) == FAILURE) 
        {
        zend_error(E_ERROR, "my_test zend_parse_parameters error");
        }
    RETURN_LONG(1);
}
//this one is ok
PHP_FUNCTION(my_test_ok)
{
    long type = 0;
    char *function_name = NULL;
    int   function_name_len = 0;

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &type 
            ,&function_name,&function_name_len) == FAILURE) 
        {
        zend_error(E_ERROR, "my_test zend_parse_parameters error");
        }
}
//this one is ok too
PHP_FUNCTION(my_test_ok2)
{
    long type = 0;
    char *function_name = NULL;
    int   function_name_len = 0;
    RETURN_LONG(1);
}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC