Thread rostis MVC-Framework für Perl und PHP (59 answers)
Opened by rosti at 2013-02-07 19:30

rosti
 2013-02-07 22:04
#165611 #165611
User since
2011-03-19
3218 Artikel
BenutzerIn
[Homepage]
user image
2013-02-07T20:31:09 Muffi
Quote
Das Exception-Handling ist in PHP besser geregelt und überdies atomar, was in Perl nicht der Fall ist, sofern nach einem eval{} die globale Variable $@ abgefragt wird.


Was heisst das?


Nicht atomar: Du hast einen eval{} Block wo eine Exception auftreten kann. Danach fragst Du $@ ab. Das ist jedoch eine globale Variable, die an einer anderen Stelle bereits eine Änderung erfahren haben könnte. use Error implementiert das try/catch Konstrukt, womit ein Exceptionhandling atomar gemacht werden kann.

View full thread rostis MVC-Framework für Perl und PHP