<?php class Obj { public function runAfter($callback) { $arg = microtime(); // Something random $callback($arg); } } $obj = new Obj(); for($i=0; $i<=3; $i++) { $obj->runafter(function($arg) use($i) { echo "$i is done and arg is $arg\n"; }); }
You have javascript disabled. You will not be able to edit any code.