<?php
class A {
function __construct($i){
if ($i > 10) {
throw new Exception("valor maior que 10");
}
}
}
$a = new A(50);
if (!is_null($a)) {
echo $a;
}
Fatal error: Uncaught Exception: valor maior que 10 in /in/A73Au:7
Stack trace:
#0 /in/A73Au(13): A->__construct(50)
#1 {main}
thrown in /in/A73Au on line 7
Process exited with code 255.
Fatal error: Uncaught exception 'Exception' with message 'valor maior que 10' in /in/A73Au:7
Stack trace:
#0 /in/A73Au(13): A->__construct(50)
#1 {main}
thrown in /in/A73Au on line 7
Process exited with code 255.
Output for 5.0.3 - 5.0.4
Fatal error: Uncaught exception 'Exception' with message 'valor maior que 10' in /in/A73Au:7
Stack trace:
#0 /in/A73Au(7): A::__construct()
#1 /in/A73Au(13): A->__construct(50)
#2 {main}
thrown in /in/A73Au on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/A73Au on line 7
Process exited with code 255.