Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ByteCode; PHP; Zend Optimizer

Posted on 2006-04-07
1
Medium Priority
?
448 Views
Last Modified: 2008-02-26
I am needing to write an app in PHP however:

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

index.php

...

foo($bar);
...



-----

x.php

....
foo($bar);
....

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.

Thanks
0
Comment
Question by:mnb93
1 Comment
 
LVL 11

Accepted Solution

by:
siliconbrit earned 2000 total points
ID: 16409435

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.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
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.
Suggested Courses
Course of the Month20 days, 23 hours left to enroll

810 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