This file contains hidden or 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 foo { | |
protected $bar; | |
public function setBar ($val) { | |
$this->bar = $val; | |
} | |
public function __get ($var) { | |
return $this->$var; |
This file contains hidden or 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 | |
$toSum = array(0.2,2.5,0.5,0.2,0.1,0.2,2.5,1.8); | |
$sum = 0; | |
$run = 0; | |
foreach($toSum as $value) { | |
$sum += $value; | |
switch(++$run) { | |
case 0: |
This file contains hidden or 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 | |
echo "Postep : "; | |
for ($i=0 ; $i<=100 ; $i++) { | |
echo "\033[5D"; // cofnij kursor 5 pozycji (move cursor 5 positions left) | |
echo str_pad($i, 3, ' ', STR_PAD_LEFT) . " %"; // wyjsie ma zawsze 5 znakow (output is always 5 symbols) | |
sleep(1); // lekka przerwa co by widac animacji (little pause to show animation) | |
} |
This file contains hidden or 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 dummyCollection { | |
protected $data = null; | |
function __construct() { | |
$this->data = array(); | |
} | |
public function add($element) { |
This file contains hidden or 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 | |
/** | |
* Description of EnumEmulator | |
* | |
* @author Bartosz | |
*/ | |
abstract class EnumEmulator { | |
private static $constCache = NULL; | |
private static $hasDefault = NULL; |
NewerOlder