- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.21
- Parse error: syntax error, unexpected '{', expecting '(' in /in/tkvc6 on line 19
Process exited with code 255.
<?php
class FooNoMoreException extends Exception {}
class Foo {
protected $count = 500;
public function step() {
if (!$this->count) {
throw new FooNoMoreException('No more steps to take.');
}
$this->count--;
}
}
$f = new Foo;
try {
while ($f->step()) {}
} catch {}
var_dump($f);