Skip to content

Instantly share code, notes, and snippets.

@swynter-ladbrokes swynter-ladbrokes/Output
Last active Aug 29, 2015

Embed
What would you like to do?
Cross namespace tick handler doesn't work as I'd hope...
<?php
include('TickThing.class.php');
echo "Do something\n";
sleep(30);
echo "Do something else\n";
#php main.php
Registering tick function as Tick\Thing::tick()
* Tick
* Tick
Do something
Do something else
<?php namespace Tick;
declare(ticks=1);
class Thing {
static public function init() {
echo "Registering tick function as " . self::CLASS . "::tick()\n";
register_tick_function([self::CLASS, 'tick']);
}
static public function tick() {
echo "* Tick\n";
}
}
Thing::init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.