The idea of yesterday's expansion through the Chinese variable! Do not shoot bricks

Source: Internet
Author: User
$ Number of atomic bombs = 100;
Class atomic bomb {
Public $ raw materials;
Public $ production quantity;
Public Function _ construct ()
{
$ This-> raw material = "Uru 235 ";
}

Public Function mass production ()
{
Global $ Number of atomic bombs;
$ This-> production quantity = $ this-> production quantity + (RAND (10000,999 99 ));
Return $ Number of atomic bombs + $ this-> production quantity;
}
}

Class factory {
Public Function I create and create ($ object name)
{
Return new $ Object Name;
}
}

Class in Japan {
Public $ preparation;
Public Function _ construct ($ Number of atomic bombs prepared)
{
$ This-> prepare = $ number of prepared atomic bombs;
}

Public Function attack ()
{
Echo "Just listen to the bang, China will". $ this-> prepare. "The Hot atomic bomb is still in every corner of Japan! ";
}
}

/* Test by myself */
$ Atomic bomb factory = Factory: I create an atomic bomb ("atomic bomb ");
$ Current number of atomic bombs = $ atomic bomb factory-> batch production ();
$ Current number of atomic bombs = $ atomic bomb factory-> batch production ();
$ Current number of atomic bombs = $ atomic bomb factory-> batch production ();
$ Current number of atomic bombs = $ atomic bomb factory-> batch production ();
$ Current number of atomic bombs = $ atomic bomb factory-> batch production ();
$ Current number of atomic bombs = $ atomic bomb factory-> batch production ();
$ Current number of atomic bombs = $ atomic bomb factory-> batch production ();
$ Current number of atomic bombs = $ atomic bomb factory-> batch production ();
$ Current number of atomic bombs = $ atomic bomb factory-> batch production ();
$ Chinese mission = new hitting Japan ($ Number of atomic bombs currently );
$ Chinese mission-> attack ();

 

Running normally under Lamp

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.