haxe icon indicating copy to clipboard operation
haxe copied to clipboard

[PHP] class ErrorException conflict with php's native ErrorException

Open filt3rek opened this issue 8 months ago • 3 comments

I think there is a conflict with php's native ErrorException class becasue this compiles fine but fails on runtime :

class ErrorException extends haxe.Exception{
	public function new(msg:String){
		super(msg);
	}
}
class Main{
	static function main(){
		var e = new ErrorException("error");
		trace(e.details());
	}
}

Gives that at runtime :

PHP Fatal error:  Uncaught Error: Call to undefined method ErrorException::details() in /test/bin/lib/Main.php:18
Stack trace:
#0 /test/bin/index.php(13): Main::main()
#1 {main}
  thrown in /test/bin/lib/Main.php on line 18

I think there is nothing to do here but to be aware to not use class name's that already exist on specific plateforms... :/

filt3rek avatar Mar 11 '25 10:03 filt3rek