ByteCode; PHP; Zend Optimizer

Posted on 2006-04-07
Last Modified: 2008-02-26
I am needing to write an app in PHP however:

function foo ($bar)
if ($bar === 'boo')
return true;
return false;
}// End Function







That is an example I don't want to hear anything about the specifics above.

Anyway, see the delemia; I could write the code in place of the function and it would run that tiny bit faster, however to the developer it is harder and annoying. So my question is:

If I "encode" something with Zend/Ioncube/Source Guardain will that turn the stuff into bytecode and do away with the functions... ie. convert the nice code with functions into (compiled but sorta means) the "Expanded" form. (eg. the if's are inplace of the function)

I hope this makes sense.

Question by:mnb93
    1 Comment
    LVL 11

    Accepted Solution


    Yes, that is exactly what the optimizer does, although it's a little more complex than that.

    The optimizer actually removes the overhead of the function *and* the if statement, and creates an inline gate for this logic.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now