 
  PHP ver gevorderde | 
                         | 
                        je kan met exceptions gaan werken, ben het mijzelf nu ook aan het aanleren PHP.net: exceptions  
 
VB: 
    
    
        
            
                
class CheckMail {
  public function __construct($mail) {
    $this->Check($mail);
    
    catch(Exception $e) {
      echo 'Fout:'. $e->GetMessage();
    }
  }
  protected function Check($mail) {
    if(!preg_match('#[hoi](.*)[/hoi]#i', '<span>//1</span>')) {
      throw new Exeception('blalala');
    }
  }
}
             
            class CheckMail {     public function __construct($mail) {     $this->Check($mail);       catch(Exception $e) {       echo 'Fout:'. $e->GetMessage();     }   }     protected function Check($mail) {     if(!preg_match('#[hoi](.*)[/hoi]#i', '<span>//1</span>')) {       throw new Exeception('blalala');     }   } } 
 
  
         
          
     
  
 
Natuurlijk waardeloze class, maar gaat om de exception |