Ver Mensaje Individual
  #11 (permalink)  
Antiguo 27/10/2013, 11:27
Avatar de Fernand0
Fernand0
 
Fecha de Ingreso: septiembre-2005
Ubicación: Buenos Aires
Mensajes: 610
Antigüedad: 18 años, 7 meses
Puntos: 19
Respuesta: error_handler no toma algunos errores

Código PHP:
Ver original
  1. set_error_handler('errorHandler');
  2.  
  3. function errorHandler($errno, $errstr)
  4. {
  5.     echo "error: $errno<br>";
  6. }
  7.  
  8. function a($b)
  9. {
  10.     echo "$b<br>";
  11. }
  12.  
  13. a();

este codigo obviamente funciona, el tema es que a traves de...

Control.php
Código PHP:
Ver original
  1. argControl::start();
  2. $this->object = new $class();
  3. argControl::stop();

argControl.php
Código PHP:
Ver original
  1. class argControl
  2. {
  3.    
  4.     public static $func = array(
  5.                                __CLASS__,
  6.                                'errorHandler'
  7.                            );
  8.    
  9.     public static function start($func = null)
  10.     {
  11.         if(!empty($func))
  12.             static::$func = $func;
  13.        
  14.         set_error_handler(static::$func);
  15.     }
  16.    
  17.     public static function stop()
  18.     {
  19.         restore_error_handler();
  20.     }
  21.    
  22.     public static function errorHandler($errno, $errstr)
  23.     {
  24.         echo "error: $errno<br>";
  25.     }
  26.    
  27. }

no.. :/