Bug #75622 [Opn->Nab]: ZEND API zend_parse_parameters is called, refcount value is different

From: Date: Tue, 05 Dec 2017 03:56:29 +0000
Subject: Bug #75622 [Opn->Nab]: ZEND API zend_parse_parameters is called, refcount value is different
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212925@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75622&edit=1

 ID:                 75622
 Updated by:         laruence@php.net
 Reported by:        fanjiapeng at 360 dot cn
 Summary:            ZEND API zend_parse_parameters is called, refcount
                     value is different
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   CentOS release 6.2 (Final)
 PHP Version:        7.1Git-2017-12-04 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

I think you was meaning Z_REFCOUNT_P, Z_REFCOUNTED_P result bool value, indicate whether the value
is Z_TYPE_REFCOUNTED.


Previous Comments:
------------------------------------------------------------------------
[2017-12-05 03:20:09] fanjiapeng at 360 dot cn

update context on yesterday. The correct result is as follows:

Expected result(PHP 7.0.19 NTS, 7.2.0 NTS):
----------------
refcount = 1

Actual result(PHP 7.1.5 NTS):
--------------
refcount = 0

The PHP version 7.0.19 ( NTS ) and PHP 7.2.0 (cli)( NTS DEBUG ) this BUG does not exist.

------------------------------------------------------------------------
[2017-12-04 14:27:24] fanjiapeng at 360 dot cn

Description:
------------
In The PHP 7.1.5 (cli)( NTS DEBUG ).
My create a 'test' class with PHP extension, It's have a method __construct. Short
code:

PHP_METHOD(test, __construct)
{
    zval *configs = NULL;
    if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &configs) == FAILURE) {
        return;
    }
    php_printf("refcount = %d \n", Z_REFCOUNTED_P(configs));
}

The 'refcount' result of the first execution is 1, The 'refcount' result of the
second execution is 0. Both CLI mode and FPM mode all exist. The PHP version 7.0.19 ( NTS ) this BUG
does not exist.


Test script:
---------------
<?php
$configs = array(
    'dsn' => array('host' => '127.0.0.1', 'dbname'
=> 'test', 'port' => 3306),
);

$a = &$configs;
$b = $a;

$mysql = new test($a);

Expected result:
----------------
refcount = 0

Actual result:
--------------
refcount = 1


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75622&edit=1


Thread (3 messages)

« previous php.bugs (#212925) next »