global $global_nums; //全局变量的使用 $global_nums = 0; class play_games {
public $name; public $age; public function __construct($n,$a) //构造函数初始化 {
$this->name =$n; $this->age=$a; } public function add_plays() //成员方法 {
global $global_nums; //再次申明 $global_nums +=1; echo $this->name.'加入了游戏当中 '; } } $p1 = new play_games('anikin',12); //只是创建了人,但是不会玩游戏 $p1->add_plays(); //开始玩游戏 $p2 = new play_games('jack',10); $p2->add_plays(); $p3 = new play_games('rose',20); $p3->add_plays(); echo '总共'.$global_nums.'个人参与到了游戏当中'; ?>
class Student {
public static $fee = 0; public $name; function __construct($n) {
$this->name=$n; } public static function enterShcool($ifee) {
self::$fee+=$ifee; } public static function getFree() {
return self::$fee; } } $s1 = new Student('anikin'); $s1->enterShcool(5000);
$s2 = new Student('jack'); Student::enterShcool(3400);
在客户端访问subversion版本库时出现这个错误:
svnserve.conf:12: Option expected
为什么会出现这个错误呢,就是因为subversion读取配置文件svnserve.conf时,无法识别有前置空格的配置文件,如### This file controls the configuration of the svnserve daemon, if you##
什么是Akka
Message-Driven Runtime is the Foundation to Reactive Applications
In Akka, your business logic is driven through message-based communication patterns that are independent of physical locatio
zabbix_api网上比较多的写法是python或curl。上次我用java--http://bossr.iteye.com/blog/2195679,这次用perl。for example: #!/usr/bin/perl
use 5.010 ;
use strict ;
use warnings ;
use JSON :: RPC :: Client ;
use
package com.test;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
public class TestMap {
public static v
MySQL server has gone away 问题解决方法,需要的朋友可以参考下。
应用程序(比如PHP)长时间的执行批量的MYSQL语句。执行一个SQL,但SQL语句过大或者语句中含有BLOB或者longblob字段。比如,图片数据的处理。都容易引起MySQL server has gone away。 今天遇到类似的情景,MySQL只是冷冷的说:MySQL server h
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml&