I feel so confused, little brother.

Source: Internet
Author: User
I feel so confused.
PHP Code
  
  * Foo * CB * Tango * CC * Foo * CD * * what the hell?! :) */?>



Is it covered, or what? Why output so ah, do not understand Ah, listen to chaos ah.

------Solution--------------------
What's it called? Trouble!
To be tired and tired
------Solution--------------------
If you don't understand, forget it, it doesn't matter.
------Solution--------------------
discuss

What's it called? Make dumplings for trouble!
To be tired and tired

------Solution--------------------
It might be clearer.
PHP Code
Class ca{/** * Test property for using direct default value * Test properties using immediate defaults */protected static $item = '        Foo ';        /** * Test property for using indirect default value * Test properties using indirect defaults */protected static $other = ' CA '; public static Function method () {print __method__. ' ' . __class__. ':: $item = '. Self:: $item. "        \ r \ n "; Print __method__. ' ' . __class__. ':: $otfer = '. Self:: $other. "    \ r \ n ";    The public static function Setother ($val) {self:: $other = $val;//Set A value of this scope. }}class CB extends ca{/** * Test Property with redefined default value * Redefined defaults Test Properties */protected stat        IC $item = ' Bar ';    public static function Setother ($val) {self:: $other = $val; }}class CC extends ca{/** * Test Property with redefined default value * Redefined defaults Test Properties */protected stat        IC $item = ' Tango '; public static Function method () {print __method__. ' ' . __class__. ':: $item = '. Self:: $item. "        \ r \ n "; Print __method__. ' ' . __class__. ':: $otfer = '. Self:: $other. "    \ r \ n ";     }/** * Now we drop redeclaring the Setother () method, use CA with ' self:: ' Just for fun. */}class CD extends ca{/** * Test Property with redefined default value * Redefined defaults Test Properties */protected STA        Tic $item = ' Foxtrot ';     /** * Now we drop redeclaring all methods to complete this issue. * Now, we give up all methods of re-declaring to complete this problem */}cb::setother (' CB '); It ' s Cb::method ()!cb::method (); It ' s Ca::method ()!cc::setother (' CC '); It ' s Ca::method ()!cc::method (); It ' s Cc::method ()!cd::setother (' CD '); It ' s Ca::method ()!cd::method (); It ' s Ca::method ()!
  • 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.