Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/04/2014, 09:23
Avatar de Italico76
Italico76
 
Fecha de Ingreso: abril-2007
Mensajes: 3.303
Antigüedad: 17 años, 1 mes
Puntos: 292
Respuesta: PHP función eval( ) no funciona correctamente

Código PHP:
Ver original
  1. <?php
  2.  
  3. Class Foo
  4. {
  5.     public static function bar($param)
  6.     {
  7.         print "Hola Mundo!";       
  8.     }
  9. }
  10.  
  11. var_dump(eval("Foo::bar('parámetro');"));  // imprime y luego me devuelve NULL
  12. var_dump(eval("Foo::bara('parámetro');"));  // PHP fatal error ...

Ahi tienes en mi interprete...... uso PHP 5.4.x ... pero podrias colocar el eval() dentro de un bloque TRY...CATCH
__________________
Salu2!