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 | |
// synchronous code | |
// fetch operations are blocking | |
$profile = fetchProfile('@kaja47'); | |
$ids = []; | |
$cursor = '-1'; | |
do { |
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 | |
$_ = new Atrox\Access(); | |
$_->property; | |
// generates: |
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 | |
$testNumber = $argv[1]; | |
const TEST_SIZE = 100000; | |
class TestPriv { | |
private $a = 1; | |
private $b = 2; | |
private $c = 3; |
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 | |
// The only chance now, I felt was the possibility that we'd gone to such | |
// excess that nobody in the position to bring the hammer down on us could | |
// possibly believe it. | |
// Hunter S. Thompson | |
trait CompactClass { | |
private $data; |
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 | |
// advanced bit-twiddling | |
abstract class AbstractIntArray { | |
protected $length; | |
protected $data; | |
protected $typeSize; | |
function __construct($length) { |
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
var a: Int = 100 | |
var b: Int = 200 | |
a = a ^ b | |
b = b ^ a | |
a = a ^ b | |
println(a) // 200 | |
println(b) // 100 |
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 Magic { | |
function _list() { return "list"; } | |
function _function() { return "function"; } | |
function _and() { return "and"; } | |
function __call($name, $args) { return $this->{"_$name"}(); } | |
} |
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 | |
namespace Really\Long\Namespace; | |
class A { | |
static function myfunc() {} | |
const myfunc = 'Really\Long\Namespace\A::myfunc' | |
} |
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 A { val l: Long = 47 } | |
class B { val a: Int = 0; val b: Int = 0; def aa = a; def bb = b } | |
val a = new A | |
val b = new B | |
unsafe.putInt(a, 8, unsafe.getInt(b, 8)) | |
val a_b = a.asInstanceOf[B] | |
a_b.getClass // B |
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 | |
use React\Promise\Deferred; | |
function timeout($time, $promise, $loop) { | |
$defer = new Deferred; | |
$r = $defer->resolver(); | |
$sig = $loop->addTimer($time, function() use($r) { | |
$r->reject('timeout'); | |
}); |