/** * Enable response chunking * * @link https://github.com/chriso/klein.php/wiki/Response-Chunking * @link http://bit.ly/hg3gHb * @param string $str An optional string to send as a response "chunk" * @access public * @return Response */ public function chunk($str = null) { parent::chunk(); if (null !== $str) { printf("%x\r\n", strlen($str)); echo "{$str}\r\n"; flush(); } return $this; }