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
-init { | |
$operators = array( | |
'+' => 10, | |
'-' => 10, | |
'*' => 20, | |
'/' => 20, | |
'^' => 30 | |
); | |
$right_associative = 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
-namespace Nette\Templates | |
-name LatteParser | |
-init { | |
$self = (object) array( | |
"latte_pair" => array( | |
"if" => TRUE, | |
"for" => TRUE, | |
"foreach" => TRUE, | |
"while" => TRUE, |
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
calc | |
= expression !. | |
// left associative | |
expression | |
= f:factor ( "+" g:factor { $f = $f + $g; } | |
/ "-" g:factor { $f = $f - $g; } | |
)* | |
-> $f |
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 | |
$time = microtime(true); | |
$i = 0; | |
loop: | |
if ($i >= 1000) goto endloop; | |
$ret = dummy($i); | |
++$i; | |
goto loop; | |
endloop: |
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
+------------+ +--------------+ +---------------+ | |
| reads <:<<<<<<:<<<<<<<<<<<<<<:<<< HTTP resposne <<<:< writes | | |
| | | -:--- HTTP request ----:> | | |
| | | | | | | |
| SSH client | | proxy script | | server script |-----+ | |
| | | | | | | | |
| writes >:>>>>>>:>>>>>>. | | ^ reads | | | |
+------------+ +------|-------+ +--|------------+ | | |
| | | | |
| +--^----+ | |
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 sh\commands; | |
function hello(array $argv, array $envp, array $descriptors) | |
{ | |
// $descriptors[0] is stdin | |
// $descriptors[1] is stdout | |
// $descriptors[2] is stderr | |
fwrite($descriptors[1], "hello, world!\n"); |
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 | |
{ | |
function stream_open() { return TRUE; } | |
function stream_eof() { return FALSE; } | |
function stream_read($count) | |
{ | |
$backtrace = debug_backtrace(); | |
if (isset($backtrace[1]['function']) && $backtrace[1]['function'] === 'fread') { |
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 | |
/** | |
* Wraps callback with some default params | |
*/ | |
class fn | |
{ | |
/** | |
* @var callback Wrapped callback | |
*/ | |
private $callback; |
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 | |
{ | |
function stream_open() { return TRUE; } | |
function stream_eof() { return FALSE; } | |
function stream_read($count) | |
{ | |
var_dump($count); | |
return ""; |
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
Jak nejlépe na tree walker v PHP? |