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 | |
function hoge(&$str) { | |
$str = "hoge"; | |
} | |
$my_str = "Aaaaaa"; | |
echo $my_str.PHP_EOL; // "Aaaaaa" |
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 Hoge { | |
public function __toString() { | |
return get_class($this); | |
} | |
public static function hhh() { | |
echo "hoge!!!\n"; | |
} | |
} |
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
class Task | |
class Hoge | |
def self.hoge | |
puts "hoge!!!!" | |
end | |
end | |
module Foo | |
def foo | |
Hoge.hoge |
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 | |
$arr = array(4,1,3); | |
print_r($arr); | |
$a = array_shift($arr); | |
print_r($arr); | |
array_unshift($arr, $a); | |
print_r($arr); | |
//Array | |
//( |
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 Hoge { | |
private $h; | |
public function __construct(&$h) { | |
$this->h &= $h; | |
} | |
public function hhh($str) { | |
$this->h["str"] = $str; | |
} |
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 | |
abstract class Goo { | |
public static function g() { | |
echo "goooooo!\n"; | |
} | |
} | |
Goo::g(); // goooooo! |
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 Hoge { | |
public function foo() { | |
$this->bar(); | |
} | |
public function bar() { | |
echo "Hoge::bar()\n"; | |
} | |
} |
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 | |
abstract class ItemShop { | |
public function order_item($type) { | |
//$item = $this->factory->create_item($type); | |
$item = $this->create_item($type); | |
if ($item->is_expired()) return; | |
if ($item->is_sold_out()) return; | |
if ($item->on_sale()) { | |
$item->sale_price(); |
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 | |
require_once "./simpleitemfactory.php"; | |
class ItemShop { | |
private $factory; | |
public function __construct(SimpleItemFactory $factory) { | |
$this->factory = $factory; | |
} |
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
{ | |
"fields": { | |
"project": | |
{ | |
"key": "TEST" | |
}, | |
"summary": "REST ye merry gentlemen.", | |
"description": "Creating of an issue using project keys and issue type names using the REST API", | |
"issuetype": { | |
"name": "Bug" |