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 | |
| $document = new DomDocument(); | |
| $html = $document->createElement('html'); | |
| $document->appendChild($html); | |
| $body = $document->createElement('body'); | |
| $html->appendChild($body); |
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 | |
| // ds* berechnen die Quersumme (digital sum: 12345 wird 15) | |
| // dr* berechnen die iterierte Quersumme (digital root: 12345 wird 6) | |
| function ds1($number) { | |
| $sum = 0; | |
| while($number > 0) { | |
| $sum += $number % 10; |
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 | |
| $outputBuffer = new OutputBuffer(); | |
| $outputBuffer->capture(function() { | |
| echo 'foo'; | |
| throw new Exception('foobar'); | |
| echo 'bar'; | |
| }); | |
| echo $outputBuffer; |
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 Boolean extends SplBool { | |
| public function toggle() { | |
| $this -= 1; | |
| return $this; | |
| } | |
| } |
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 Request { | |
| public function send() { | |
| } | |
| } |
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 Collection extends ArrayObject { | |
| /** | |
| * $callback(mixed $value, mixed $key, Iterator $iterator) | |
| */ | |
| public function map(Closure $callback) { | |
| $iterator = $this->getIterator(); | |
| $result = new static(); |
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 | |
| $array = array( | |
| 'foo' => 23, | |
| 'bar' => 42 | |
| ); | |
| $result = array_map(function($value) { | |
| return $value * 2; | |
| }, $array); |
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 | |
| $m = 3; | |
| $array = array_filter(range(23, 42), function($value, $index) use($m) { | |
| return $index % $m == 0; | |
| }, ARRAY_FILTER_USE_BOTH); | |
| var_dump($array); |
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 | |
| $context = 'foobar'; | |
| $closure = function($value, $index) use($context) { | |
| var_dump($context); | |
| var_dump($value * 2); | |
| }; | |
| unset($context); |
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 | |
| namespace Application\Modules\Boards\Controllers; | |
| use Blar\MVC\Controllers\XmlRpcController as BaseXmlRpcController, | |
| Blar\Password, | |
| Blar\Session\SessionManager, | |
| Blar\Network\XmlRpc\XmlRpc, | |
| Blar\Network\Http\HttpRequest, | |
| Blar\Network\Curl, |