Well, the same bug as winning

Source: Internet
Author: User
Well... a winning bug? PHPcodevar_dump ($ sumArr ['trade _ CLOSED ']); $ sumValue = array_sum ($ sumArr); var_dump ($ sumArr ['Trad... A bug like winning?
PHP code
  var_dump($sumArr['TRADE_CLOSED']);$sumValue = array_sum($sumArr);var_dump($sumArr);var_dump($sumArr['TRADE_CLOSED']);


Result:
Int 3
Array (size = 4)
'Wait _ SELLER_SEND_GOODS '=> int 8
'Wait _ BUYER_CONFIRM_GOODS '=> int 37
'Wait _ BUYER_PAY '=> int 2
'Trade _ CLOSED '=> & int 50
Int 50

This is character? Is this a bug? What's your sister's problem?

I used a temporary file to re-write a small piece of code for testing, but the output was normal...


------ Solution --------------------
Why is TRADE_CLOSED a reference?
------ Solution --------------------
PHP code
$ SumArr = Array ('wait _ SELLER_SEND_GOODS '=> 8, 'Wait _ BUYER_CONFIRM_GOODS' => 37, 'Wait _ BUYER_PAY '=> 2, 'trade _ CLOSED '=> 50,); var_dump ($ sumArr ['trade _ CLOSED']); $ sumValue = array_sum ($ sumArr); var_dump ($ sumArr ); var_dump ($ sumArr ['trade _ CLOSED ']);
------ Solution --------------------
PHP code
    8,'WAIT_BUYER_CONFIRM_GOODS' =>37,'WAIT_BUYER_PAY' =>2,'TRADE_CLOSED'=>&$aa,);var_dump($sumArr['TRADE_CLOSED']);$sumValue = array_sum($sumArr);var_dump($sumArr);var_dump($sumArr['TRADE_CLOSED']);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.