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 video = document.getElementById("video"); | |
var c1 = document.getElementById("roundy"); | |
var ctx = c1.getContext("2d"); | |
$('#button').click(function(){ | |
video.play(); | |
}); | |
video.addEventListener("play", function() { | |
timerCallback(); |
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
/* | |
* @author Niklas von Hertzen <niklas at hertzen.com> | |
* @created 30.12.2011 | |
* @website http://hertzen.com | |
*/ | |
function DataViewer( data, littleEndian ) { | |
var pos = 0, |
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 Test | |
{ | |
protected $x; | |
function __get($name) { | |
echo __METHOD__ . "\n"; | |
if (isset($this->x[$name])) { | |
return $this->x[$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 | |
class C | |
{ | |
function __call($name, $values) | |
{ | |
$values[0][0] = 'changed'; | |
} | |
} | |
$a = array('original'); |
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 setter { | |
public $n; | |
public $x = array('a' => 1, 'b' => 2, 'c' => 3); | |
function __get($nm) { | |
echo "Getting [$nm]\n"; | |
if (isset($this->x[$nm])) { | |
$r = $this->x[$nm]; |
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 | |
$func = create_function('',' | |
static $foo = 0; | |
return $foo++; | |
'); | |
var_dump($func()); | |
var_dump($func()); | |
var_dump($func()); | |
?> |
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 | |
$func = create_function('',' | |
static $foo = 0; | |
return $foo++; | |
'); | |
var_dump($func()); | |
var_dump($func()); | |
var_dump($func()); | |
?> |
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 object implements ArrayAccess { | |
public $a = array('1st', 1, 2=>'3rd', '4th'=>4); | |
function offsetExists($index) { | |
echo __METHOD__ . "($index)\n"; | |
return array_key_exists($index, $this->a); | |
} | |
function offsetGet($index) { |
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 | |
// simple case with missing element | |
$f = array("hello","item2","bye"); | |
list($a,,$b) = $f; | |
echo "A=$a B=$b\n"; | |
// Warning: Cannot use a scalar value as an array in %s on line %d | |
$c[$c=1] = 1; |
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 | |
function f($x) { | |
echo "f($x) "; | |
return $x; | |
} | |
echo "Function call args:\n"; | |
var_dump(f($i=0) < f(++$i)); | |
var_dump(f($i=0) <= f(++$i)); | |
var_dump(f($i=0) > f(++$i)); |
OlderNewer