1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Evil "eval()" dead?

Discussion in 'XenForo Pre-Sales Questions' started by AlexT, Jul 29, 2010.

  1. Shamil

    Shamil Well-Known Member

    Interesting. I know it's used in templates, I use it in my custom CMS, and that's about it.
     
  2. Jaxel

    Jaxel Well-Known Member

    I've just stumbled upon XF and I can already see that its something I want to switch over to as soon as possible. VB4 is complete garbage and I can't understand how it was ever released. I hear that eval() has overhead, while listener classes are better; but VB4 runs like crap, while VB3 ran great.

    Personally, once XF gets released, I plan on porting as many of my mods over that I can. Is there gonna be an advanced SDK available so that us mod authors can make sure our stuff is available asap?
     
  3. Eric

    Eric Active Member

    I do not care about HipHop PHP :p I only care about xF working... and working well.
     
    ChrisR likes this.
  4. Shamil

    Shamil Well-Known Member

    Both vB 4 and vB 3 use eval();. eval(); is used here for templates.

    About advanced SDK? Who knows, you're the first to suggest, but I assume the documentation (if produced) may be enough to satisfy this.
     
  5. feldon30

    feldon30 Well-Known Member

    vBulletin never had a SDK. But I'm hopeful that one will be created for XenForo, either by the third party community, XF themselves, or a combination.
     
  6. Shamil

    Shamil Well-Known Member

    People would trust an official, XenForo-created one, rather than a third part one. Although...
     
  7. AlexT

    AlexT Well-Known Member

    Deleted.
     
  8. pegasus

    pegasus Well-Known Member

    In my opinion, not being able to use dynamic values for define() and not being able to unset() things are real deal-breakers, and really limits usage of HipHop. How can you get rid of array associations? Note that $array['key'] = null will still leave the key in the array...
     
  9. feldon30

    feldon30 Well-Known Member

    As a workaround, can you come up with another null-like substance?

    $array['a'] = NULLLIKESUBSTANCE;
    $array['b'] = NULL;

    Treat $array['a'] as empty (but valid) value. Skip $array['b'] completely as if it were null.

    Obviously this is an ugly approach that will require extra logic in each loop, but nothing is impossible -- except me learning regex.
     
  10. Scott

    Scott Active Member

    unset() is supported, where did you see documentation it wasn't?

    Dynamic defines for setting the name are unsupported.
    define($var, $foo); // bad
    define('moo', $bar); // good
    is a bad idea and there is very little need for it ever.
     
    Enigma likes this.
  11. Cezz

    Cezz Well-Known Member

    Indeed I am sure the only thing unsupported is eval()
     
  12. AlexT

    AlexT Well-Known Member

    Deleted.
     
  13. Scott

    Scott Active Member

    I was at the presentation and spoke a little afterwards, most of these are really non issues. The biggest problem is eval() and create_function() and possibly phpinfo(), I've been working to fix that.

    For what its worth I've ran XF through HipHop without any issue.
     
    Floren, MGSteve, feldon30 and 10 others like this.
  14. AlexT

    AlexT Well-Known Member

    Deleted
     
  15. NolF

    NolF Active Member

    I've liked it for you :) Though I'm not sure what it means :/
     
  16. AlexT

    AlexT Well-Known Member

    Deleted.
     
    NolF likes this.
  17. Shamil

    Shamil Well-Known Member

    This is interesting. I'm going to pass a few of my scripts through it, and see what it brings up. Adios eval!
     
  18. Scott

    Scott Active Member

    its about 2x fast on the website and 4x on the API tier, though if you're spending a lot of time waiting on IO then it will be the same amount of time under HipHop.

    They're is usually some gentle massaging required to get a code base working, easier with new code that's designed for PHP 5.2+. The eval() method will need to be killed in the template layer and HTML email, but I haven't looked at that. Normally we force the templates into the filesystem to get around it.
     
  19. AlexT

    AlexT Well-Known Member

    Deleted.
     
  20. NolF

    NolF Active Member

    WoW neat :) thanks or the explanation. In that case it would be awesome to have ^^ I can do with more speed in my forums :D
     

Share This Page