Performance improvement
The overall performance of PHP 5.3 has improved 5-15%
MD5 () Fast 10-15%Better stack implementation in the engineConstants moved into Read-only memory.Exception Process Improvement (simplified, opcodes less)(require/include) _
No extra effort to view JSON output at any time"No extra effort" means that when you need to look at the JSON output, just turn the eyeball (and maybe at least two more clicks) to find the result quickly.
There are a lot of ways to view JSON output,
Test-driven Development and unit testing are the latest ways to ensure that your code is still working as we expect after modifications and significant adjustments. In this article, you'll learn how to unit test your PHP code at the module, database,
1, can local variables and global variable duplicate?
A: Yes, the local will screen the overall situation. To use a global variable, you need to use the "::"
Local variables can have the same name as global variables, and when referenced within a
Session Advanced App writes user information to the databaseFirst create a database tableSet up session table in experimental database SQLDB for storing dataCreate the required files under the root folder (the key is to session,class.php this type
The Library of program functions can be divided into 3 types: static function library (libraries), shared function library (GKFX libraries) and dynamic load function library (dynamically loaded libraries)The static function library is added to the
PHP generates XML data1) Assemble string: simple, easy to understand, commonly used2) using System classesSuch as:DomDocumentThe following details describe the assembled string to generate XML dataXML data requires 1. Header Information 2. Root node3
=The relationship between the key and value used for an array in an arrayFor example:$a = Array (' 0 ' = ' 1 ',' 2 ' = ' 4 ',);echo $a [' 0 '];echo $a [' 2 ']; -Methods and properties in a class to reference class instancesFor example:Class
The first is a set of code:
Abstract class user {} class admin extends user {private $ group; public static function create () {return new admin ();} public static function getgroup () {return "admin ";}//....... other functions ..}
Class
[Disclaimer: All Rights Reserved. You are welcome to reprint it. Do not use it for commercial purposes. Contact Email: feixiaoxing @ 163.com]
The functions mentioned here mainly refer to inline and static functions. Inline functions are special.
[Disclaimer: All Rights Reserved. You are welcome to reprint it. Do not use it for commercial purposes. Contact Email: feixiaoxing @ 163.com]
The functions mentioned here mainly refer to inline and static functions. Inline functions are special.
Copy CodeThe code is as follows:
Class Session_handler {
protected $maxlifetime = null;
protected $dbHandle = null;
public $config = null;
public static function init ($args) {
return new self ($args);
}
Public function __construct ($args)
Reply content:The revolution has not yet succeeded, comrades still need to work hard. A lot of code doesn't actually work. This program can be optimized for a very short period of time.
You look at a DB class that I wrote earlier. See for yourself.
Static Keywords of C ++
The static function of C ++ has two usage methods: static in process-oriented programming and static in object-oriented programming. The former applies to common variables and functions, and does not involve classes. The
Differences between php Object-Oriented Programming self and static, object-oriented programming self
In php object-oriented programming
class test{ public static function test(){ self::func(); static::func(); } public static function
PHP array operation class instance, php array instance
This example describes the PHP array operation class. Share it with you for your reference. The details are as follows:
Class ArrayHelper {/*** Delete blank elements from the array (including
[Switch] PHP5.3 test the essence of features finishing 1. introduce _ DIR _ magic constant to locate the script directory echo _ DIR __. |. dirname (_ FILE _); 2. allow orand expressions with two values to quickly obtain a non-empty value echo (1? :
Thinkphp is a fast, compatible and easy-to-use, lightweight, homegrown PHP development framework and the most widely used domestic framework in the country. Born in 2006, after FCS0.6.0 to thinkphp 0.9.5, after 1.0 to 3.0 development. 2015 released
Php custom session example sharing. The following code copies the session class code :? Phpclasssession {staticfunctioninit () {session_set_save_handler (array (session, open), array (session, close), and below a is the session class code
The code
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.