Skip to content

Instantly share code, notes, and snippets.

@fillano
Created October 14, 2015 05:32
Show Gist options
  • Save fillano/36d0bfb917ed5bafb1f9 to your computer and use it in GitHub Desktop.
Save fillano/36d0bfb917ed5bafb1f9 to your computer and use it in GitHub Desktop.
<?php
declare(ticks=20000000);
$a = new handle();
register_tick_function(array(&$a, 'handler'));
while($a->a > 0) {
//sleep(1);
}
class handle {
var $a = 1;
public function handler() {
$this->a++;
echo "ticks handler() called with(".$this->a.")\n";
if($this->a > 10) $this->a = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment