I'm dumping a zval container running on PHP version 7.3.5 (opcache is activated and PHP is thread safe enabled) following this given code :
<?php
$a = "new string";
$b = $a;
xdebug_debug_zval( 'a' );
accordingly to php.net documentation Example #3 Increasing refcount of a zval it outputs refcount=2 :
a: (refcount=2, is_ref=0)='new string'
On my setup (php7.3.5), it outputs refcount=1 :
a:
(refcount=1, is_ref=0)string 'new string' (length=10)
I actually reach the same output with PHP5.6 as the php.net documentation. What internally changed in PHP7 and why refcount remain 1 ?