If you need concurrency, it's best to add declare(ticks=1) at the top of your code. Example:
<?php declare(ticks=1); use vennv\vapm\CoroutineGen; function execute(string $name) { for ($i = 0; true; $i++) { echo "$name $i\n"; yield CoroutineGen::delay(100); } } CoroutineGen::runNonBlocking( execute("First Statement ") ); iterator_to_array(execute("Second Statement "));
Last updated 4 months ago