Skip to content

Instantly share code, notes, and snippets.

View shin1x1's full-sized avatar
😀

Masashi Shinbara shin1x1

😀
View GitHub Profile
create table users (
id serial primary key,
username text not null,
password text not null,
created timestamp
);
INSERT INTO users (username, password, created) VALUES('osaka', '', NOW());
INSERT INTO users (username, password, created) VALUES('kyoto', '', NOW());
INSERT INTO users (username, password, created) VALUES('hyogo', '', NOW());
<?php
class A {
public $v = 1;
public function func() {
call_user_func(array($this, 'some'));
}
public function some() {
echo $this->v;
}
<?php
// authentication
if (!authentication()) {
exit;
}
$filepath = "/path/to/file";
$sizes = getimagesize($filepath);
if (!empty($sizes['mime'])) {
<?php
// authentication
if (!authentication()) {
exit;
}
$filepath = "/path/to/file";
$sizes = getimagesize($filepath);
if (!empty($sizes['mime'])) {
<?php
class Foo {
public $value = 'abc';
public function __wakeup() {
echo(__LINE__.' '.__METHOD__).PHP_EOL;
}
public function __destruct() {
echo(__LINE__.' '.__METHOD__).PHP_EOL;
<?php
class Foo {
public $value = 'abc';
public function __wakeup() {
echo(__METHOD__).PHP_EOL;
}
public function __destruct() {
echo(__METHOD__).PHP_EOL;
<?php
class Foo {
public $value = 'abc';
public function __destruct() {
echo(__METHOD__).PHP_EOL;
}
}
function func($text) {
<?php
class Foo {
public $value = 'abc';
public function __destruct() {
echo(__METHOD__).PHP_EOL;
}
}
function func($text) {
<?php
class Foo {
public $value = 'abc';
public function __toString() {
echo(__METHOD__).PHP_EOL;
return '';
}
}
<?php
class Foo {
public $var1 = '';
protected $var2 = '';
private $var3 = '';
public function setVars($var1, $var2, $var3) {
$this->var1 = $var1;
$this->var2 = $var2;
$this->var3 = $var3;