From:             serovov at gmail dot com
Operating system: Any
PHP version:      5.2CVS-2008-10-10 (snap)
PHP Bug Type:     Unknown/Other Function
Bug description:  Excess method call in var_export.

Description:
------------
I'm looked in code of var_export and found excess method call.
in ext/standart/var.c in method 


PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC) /* {{{ */


We hava a switch:


switch (Z_TYPE_PP(struc)) {


And little bottom we have a case for array(php5.*/6) line ~407:


                break;
        case IS_ARRAY:
                myht = Z_ARRVAL_PP(struc);
                if (level > 1) {
                        php_printf("\n%*c", level - 1, ' ');
                }
                PUTS ("array (\n");
                zend_hash_apply_with_arguments(myht TSRMLS_CC, 
(apply_func_args_t)
php_array_element_export, 1, level, (Z_TYPE_PP(struc) == IS_ARRAY ? 0 :
1));



And We see, that the "Z_TYPE_PP(struc)" is aleready and always IS_ARRAY.
We must remove (Z_TYPE_PP(struc) == IS_ARRAY ? 0 : 1) and replace it to
"0".
Have a nice day =)



-- 
Edit bug report at http://bugs.php.net/?id=46273&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46273&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46273&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46273&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46273&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=46273&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46273&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46273&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46273&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46273&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46273&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=46273&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=46273&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46273&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46273&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46273&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46273&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46273&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46273&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46273&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46273&r=mysqlcfg

Reply via email to