Skip to content

Instantly share code, notes, and snippets.

@rjd22
rjd22 / coroutine.php
Created September 23, 2013 10:12 — forked from nikic/coroutine.php
<?php
error_reporting(E_ALL);
/* Data can be send to coroutines using `$coroutine->send($data)`. The sent data will then
* be the result of the `yield` expression. Thus it can be received using a code like
* `$data = yield;`.
*/
/* What we're building in this script is a coroutine-based streaming XML parser. The PHP
// Controller
<?php defined('SYSPATH') or die('No direct script access.');
class Contact_Controller extends Website_Controller
{
public function index()
{
url::redirect();
}