2008年10月1日星期三

Re: [fw-db] Zend_Db_Profiler_Firebug - query time fix

Christoph Dorn pisze:
Diabl0,

Could you please take a look at ticket

http://framework.zend.com/issues/browse/ZF-4437

and provide your feedback.
Heh, i don't even have comment rights on issue tracker so here is my answer:

Example code:

        $data = array ();
        for($i = 1; $i < 10; $i ++) {
            $data [] = rand ( 0, 10 ) / rand ( 2, 9 );
        }
       
        echo '<pre>'; var_dump ( $data ); echo '</pre>';
       
        echo '<pre>ZJE::e '; print_r ( Zend_Json_Encoder::encode ( $data ) ); echo '</pre>';
        echo '<pre>ZE::e '; print_r ( Zend_Json::encode ( $data ) ); echo '</pre>';


Example output:

array(9) {   [0]=>   int(1)   [1]=>   float(0,5)   [2]=>   float(0,888888888889)   [3]=>   int(1)   [4]=>   float(0,857142857143)   [5]=>   float(1,66666666667)   [6]=>   int(2)   [7]=>   float(0,125)   [8]=>   int(3) } 
ZJE::e [1,0,5,0,888888888889,1,0,857142857143,1,66666666667,2,0,125,3]
ZE::e [1,0.5,0.888888888889,1,0.857142857143,1.66666666667,2,0.125,3]


So, as you can see problem is somewhere in Zend_Json_Encoder.


--
Krzysztof Szatanik

没有评论: