<GIT List Command>
- git commit - URL
bill = 0 | |
products = {} | |
products[:a] = {:nama => 'sampo', :harga => 25000} | |
products[:b] = {:nama => 'sikat gigi', :harga => 10000} | |
products[:c] = {:nama => 'air mineral', :harga => 3000} | |
products[:d] = {:nama => 'gelas', :harga => 4000} | |
products[:e] = {:nama => 'piring', :harga => 7000} | |
loop do | |
products.each do |key, product| |
<?php | |
class A | |
{ | |
public $foo = 1; | |
} | |
$a = new A; | |
$b = $a; // $a and $b are copies of the same identifier | |
// ($a) = ($b) = <id> |
<?php | |
//Class where we are going to implement typehinting | |
class Typehinting_Test | |
{ | |
//Implementation Type Hinting in PHP | |
//Forcing to pass argument as object of class Test1 | |
public function type_hint_method(Test1 $parameter) | |
{ | |
$parameter->test_method(); | |
} |
<?php | |
function bool2str($bool) | |
{ | |
if ($bool === false) { | |
return 'FALSE'; | |
} else { | |
return 'TRUE'; | |
} | |
} |
<?php | |
final class BaseClass | |
{ | |
//Code… | |
} | |
class ChildClass extends BaseClass | |
{ | |
//Code… |
<?php | |
class test | |
{ | |
public $a; | |
private $b; | |
function __construct($a, $b) | |
{ | |
$this->a = $a; |
<?php | |
class test | |
{ | |
public $a; | |
private $b; | |
function __construct($a, $b) | |
{ | |
$this->a = $a; | |
$this->b = $b; |