This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class Human{ | |
public $birth; | |
public $death; | |
public function __construct(int $birth, int $death){ | |
$this->birth=$birth; | |
$this->death=$death; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class A extends Exception {} | |
class B extends A {} | |
$var = 0; | |
try { | |
try { | |
$var += 1; | |
throw new B; | |
$var += 2; |