|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-12-05 03:20 UTC] fanjiapeng at 360 dot cn
[2017-12-05 03:56 UTC] laruence@php.net
-Status: Open
+Status: Not a bug
[2017-12-05 03:56 UTC] laruence@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 05:00:02 2025 UTC |
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