<?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() || true) {}
} catch (FooNoMoreException $e) {}
var_dump($f);
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/ksV3V on line 6
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/ksV3V on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/ksV3V on line 6
Process exited with code 255.