Skip to content

Instantly share code, notes, and snippets.

<?php
Class Human{
public $birth;
public $death;
public function __construct(int $birth, int $death){
$this->birth=$birth;
$this->death=$death;
}
}
sudo bash
cd /usr/local/lib
wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
tar -xvzf gearmand-1.1.12.tar.gz
cd gearmand-1.1.12/
apt-get install libboost-program-options-dev uuid-dev libevent-dev build-essential g++
./configure && sudo make && sudo make install
ldconfig
<?php
$strings = ['php5.4test', 'PHP5.5', 'php4', 'test_php5.6'];
$result = '';
foreach ($strings as $string) {
$result .= preg_match('/^php5*[3-6]+/i', $string) ? 'true ' : 'false ';
}
echo $result;
<?php
class A extends Exception {}
class B extends A {}
$var = 0;
try {
try {
$var += 1;
throw new B;
$var += 2;