Android Programmer learns PHP Development (8)-constant predefined constant operation symbol-phpstorm

Source: Internet
Author: User
Tags learn php natural logarithm pear value of pi
constants, predefined constants (understand), operation symbols (see this blog, the following operators are how to do not know, just understand the operator), the value of the variable is the time of the string A + + and--focus on the ~

An example of an arithmetic operation symbol.

<?php/** * Constant * *//$ denotes variable, can be re-assigned $root = "localhost";    Define represents a constant, cannot be re-assigned, or unset () to clear the constant define ("ROOT", 10,true);     The/** * defined () function checks to see if a constant exists.        * Note that the declaration constant is define () and the constant is defined () * Do not write the wrong * * * if (defined ("ROOT") {echo root+10;    echo "<br>";        }else{echo "defined false";    echo "<br>"; }/** * pre-defined constants (understand) */echo ' PHP Common predefined constants: '. '    <br> '; Echo ' Current PHP version is (php_version): '. Php_version. ' <br> '; The current version of PHP is (php_version): 5.6.29 Echo ' currently used operating system type (Php_os): '. Php_os. ' <br> '; The type of operating system currently in use (Php_os): WINNT echo ' Web server interface to PHP is (PHP_SAPI): '. Php_sapi. ' <br> '; The interface between the Web server and PHP is (PHP_SAPI): cgi-fcgi echo ' Maximum number of integers (Php_int_max): '. Php_int_max. ' <br> '; Maximum number of integers (Php_int_max): 2147483647 echo ' PHP default include path (Default_include_path): '. Default_include_path. ' <br> '; PHP default include path (Default_include_path):.; C:\php\pear echo ' Pear installation path (pear_install_dir): '. Pear_install_dir.' <br> '; PEAR installation Path (PEAR_INSTALL_DIR): C:\php\pear echo ' PEAR extension Path (pear_extension_dir): '. Pear_extension_dir. ' <br> '; PEAR extension Path (pear_extension_dir): C:\php\ext echo ' php execution Path (php_bindir): '. Php_bindir. ' <br> '; PHP execution Path (php_bindir): C:\php echo ' PHP Extension Module path is (php_libdir): '. Php_libdir. ' <br> '; The path to the PHP extension module is (php_libdir): C:\php Echo ' points to the nearest error (E_error): '. E_error. ' <br> '; Point to the nearest error (E_error): 1 Echo ' points to the nearest warning (e_warning): '. E_warning. ' <br> '; Point to the nearest warning (e_warning): 2 echo ' points to the nearest note (E_notice): '. E_notice. ' <br> '; Point to Nearest note (E_notice): 8 echo ' natural logarithm E value (m_e): '. M_e. ' <br> '; Natural logarithm E Value (m_e): 2.718281828459 echo ' Mathematical value of Pi (M_PI): '. M_pi. ' <br> '; The value of the Mathematical Pi (M_PI): 3.1415926535898 echo ' logical Truth (TRUE): '. TRUE. ' <br> '; Logical Truth (TRUE): 1 echo ' Logical false Value (FALSE): '. FALSE. ' <br> '; Logical False Value (FALSE): Echo ' Current number of lines of file (__line__): '. __line__. ' <br> '; Current number of file lines (__line__): Echo ' current file Pathname (__file__): '. __file__. ' <br> '; The current file path name (__file__): C:\Users\iwanghang\PhpstormProjects\untitled1\ceshi.php Echo ' currently called function name (__function__): '. __function__. ' <br> '; The currently called function name (__function__): Echo ' class name (__class__): '. __class__. ' <br> '; Class name (__class__): Method Name of Echo ' Class (__method__): '. __method__. ' <br> '; Method Name of the Class (__METHOD__):/** * operator symbol (see this blog, the following operators are how to do not know, just understand the operator) * such as two, 1 is the operation Cloud, + is the operator * unary operator: +1,-1,     ++,--,! * Two-ary operator: +,-,*,/,%,>,<,=,==,=== * Ternary operator: for example 1?2:3 * Arithmetic operation symbol: +,-,*,/,%,++,--* Assignment operation symbol: =,+=,-=,*=,/=,%= *     Comparison operation symbol: >,<,==,>=,<=,===,!=,!== * bit operation symbol:&,|,^,~,>>,<< * Other operational symbols:?,:,@,=>,-> */    /** * Arithmetic operation symbol: +,-,*,/,%,++,--*/echo "arithmetic operation symbol:<br>";    $a = 13;    $b = 2; echo $a + $b. "<br>"; Echo $a-$b. "<br>"; Echo $a * $b. "<br>"; echo $a/$b. "<br>"; 6.5 echo $a% $b. "<br>"; 1 echo $a + +. "<br>"; 13 Operation End A is 13, and the next time a value is echo $a-- . "<br>"; The 14 operation ends with a value of 14, and the next time a value is echo + + $a. "<br>"; 14 End of Operation a value is echo--$a. "<br>";    13 operation end a value of $x = "a";    $x + +; Echo $x. "<br>";    b $x + +; Echo $x. "<br>";    C $x--; Echo $x. "<br>";    C $x--; Echo $x. "<br>";    C + + $x; Echo $x. "<br>";    D--$x; Echo $x. "<br>"; D

The above is the Android programmer to learn PHP development (8)-constant predefined constant operation symbol-phpstorm content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • 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.