In php, there are two methods for methods/variables of the callback class:
1. Create an object $ object = new Class () and then use "->" to call: $ object-> attribute/function, provided that the variable/method is accessible.
2. directly call the
In PHP, there are two ways to access a class's methods/variables:
1. Create Object $object = new Class (), and then use "->" to invoke: $object->attribute/function, provided that the variable/method is accessible.
2. Direct call to class
Order of static variable initialization1. Simple Rules
First look at a section of the most common Java code:
public class Test
{public
static Test1 t = new Test1 ();
public static int a = 0;
public static int B;
public static void Main
Static attributes and Methods belong to Classes rather than objects.
Static methods can be called directly by classes without class instantiation.
This article mainly describes: 1. State Code and member variables must be executed first than the
Currently, the developed websites are actually dynamic websites, but there are some differences in URLs. generally, website URLs include static URLs, dynamic URLs, and pseudo static URLs,
Currently, the developed websites are actually dynamic
Static is the definition of a static object or a static variable, and what are the characteristics of a variable or class method that is defined by static? We've seen the relevant examples of this article.
1. Create the object $object = new Class (),
"Master please near" PHP "global Reference passing" and "static statically variable" do not work
Two separate PHP files:
phpglobal.phpAnd
phpstatic.php
phpglobal.php All contents:
/*$FileName: phpglobal.php$Output:>>>Parse error:syntax error,
static indicates function :1, in the function body, the value of the static variable remains constant (memory function) 2, is a local global function, that can only be accessed by the function of this module (hidden function) static variable: The
① static members belong to the class, and non-static members belong to instances of the class.
② every instance of creating a class, the city in memory for the non static (dynamic) State members of the new allocation of a piece of storage;
Static
the current development of the site is actually a dynamic site, but there are some differences in the URL, the general URL is divided into static URLs, dynamic URLs, pseudo-static URLs, what are their differences?
static URL: URL similar to your
Class Main {static $service;p ublic function __construct () {$this->getservice ()->t (); $this->getservice ()- >t ();} public static function GetService1 () {return new Service ("BB");} public static function GetService2 () {if (self:: $service = =
static method Everyone should be more familiar with, here mainly talk about static methods in the inheritance of some considerations.
1, the parent class method if is static method, the subclass cannot overwrite is the Non-static method;
2, the
Java-static code block, constructor code block, constructor, and Java class initialization sequence. constructor java
Static code block: it is declared with staitc. It is executed only once when jvm loads the class.Construct a code block: the class
Request_terminate_timeout30 # indicates that after 30 seconds, php scripts that are not automatically ended are ended to release the occupied resources. Pm indicates the method used, that is, static (static) or dynamic (dynamic ). In older versions,
Public class Init {Private int age;//non-static initialization of statements Private Static String name; Static initialization of statements, first initialize static /** static initialization statements and static initialization modules are static
Java Tour (Fri)--this,static, keyword, main function, encapsulating tool class, generating Javadoc manual, static code block
Have a lot of weekend, continue to study
One. this keyword
Used to distinguish between local
2016-1- 2
Thread Communication
Traditional thread Communication
The Object class provides wait (),notify () , and Notifyall three methods
Application:synchronized modified synchronous method or synchronized method
PHPclassA {ConstConst_name = ' A '; Public Static $static _name= ' A '; Public Static $static _name_no_rewrite= ' A '; Private Static $_instance; Public Static functionStatic_func () {EchoA; } Public Static
Description
Parent class is FA and subclass is child
member variable = global variable a variable defined outside a method within a class
Static member =static decorated global variables
member variable = defined inside
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.