Bug #73916 [NEW]: zend_print_flat_zval_r and zend_print_zval_r_ex doesn't consider reference

From: Date: Thu, 12 Jan 2017 05:44:33 +0000
Subject: Bug #73916 [NEW]: zend_print_flat_zval_r and zend_print_zval_r_ex doesn't consider reference
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206547@lists.php.net to get a copy of this message
From:             x dot xiang at outlook dot com
Operating system: ALL
PHP version:      7.0.14
Package:          Output Control
Bug Type:         Bug
Bug description:zend_print_flat_zval_r and zend_print_zval_r_ex doesn't consider reference

Description:
------------
zend_print_flat_zval_r and zend_print_zval_r_ex doesn't consider
reference in php 7.0.x.

The following error may be triggered:
PHP Notice:  Array to string conversion;
Catchable fatal error: Object could not be converted to string.

This bug has been fixed in php 7.1, why php 7.0.x is not fixed.

Test script:
---------------
$a = array('a');
class b{};
$b = new b;
$test[] =& $a;
$test[] =& $b;
test($test);
function test() {
    debug_print_backtrace();
}


Expected result:
----------------
#0  test(Array ([0] => Array ([0] => a),[1] => b Object ())) called at
[/Users/playcrab/Documents/code/php/test/test7.php:7]

Actual result:
--------------
#0  test(Array ([0] => PHP Notice:  Array to string conversion in
/Users/playcrab/Documents/code/php/test/test7.php on line 9
PHP Stack trace:
PHP   1. {main}() /Users/playcrab/Documents/code/php/test/test7.php:0
PHP   2. test() /Users/playcrab/Documents/code/php/test/test7.php:7
PHP   3. debug_print_backtrace()
/Users/playcrab/Documents/code/php/test/test7.php:9
PHP Catchable fatal error:  Object of class b could not be converted to
string in /Users/playcrab/Documents/code/php/test/test7.php on line 9
PHP Stack trace:
PHP   1. {main}() /Users/playcrab/Documents/code/php/test/test7.php:0
PHP   2. test() /Users/playcrab/Documents/code/php/test/test7.php:7
PHP   3. debug_print_backtrace()
/Users/playcrab/Documents/code/php/test/test7.php:9

Notice: Array to string conversion in
/Users/playcrab/Documents/code/php/test/test7.php on line 9

Call Stack:
    0.0068     353088   1. {main}()
/Users/playcrab/Documents/code/php/test/test7.php:0
    0.0080     353928   2. test()
/Users/playcrab/Documents/code/php/test/test7.php:7
    0.0080     353928   3. debug_print_backtrace()
/Users/playcrab/Documents/code/php/test/test7.php:9

Array,[1] => 
Catchable fatal error: Object of class b could not be converted to
string in /Users/playcrab/Documents/code/php/test/test7.php on line 9

Call Stack:
    0.0068     353088   1. {main}()
/Users/playcrab/Documents/code/php/test/test7.php:0
    0.0080     353928   2. test()
/Users/playcrab/Documents/code/php/test/test7.php:7
    0.0080     353928   3. debug_print_backtrace()
/Users/playcrab/Documents/code/php/test/test7.php:9

-- 
Edit bug report at https://bugs.php.net/bug.php?id=73916&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=73916&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=73916&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=73916&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=73916&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=73916&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=73916&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=73916&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=73916&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=73916&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=73916&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=73916&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=73916&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=73916&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73916&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=73916&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=73916&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=73916&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73916&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=73916&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=73916&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#206547) next »