0

I am going through a website's code and I came across this line:

$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());

What does it mean?

5
  • 1
    is a boolean expression .. the result is true or false depending the boolend result of the different part of the expression in this case if the 3 part of the expression are true the result is true otherwise is false Commented Apr 2, 2018 at 15:46
  • What exactly are you confused by here? Commented Apr 2, 2018 at 15:46
  • @scaisEdge So if all those conditions are true $useStaticLoader will be true, otherwise it will be false, right? Commented Apr 2, 2018 at 15:48
  • exactly .. i have update the first comment for this Commented Apr 2, 2018 at 15:48
  • yes it checks for php versions and the zend loader file. Commented Apr 2, 2018 at 15:49

1 Answer 1

1

It is a boolean expression as scaisEdge said on his comment, to make it clear to you let's examine that expression :

First the variable $useStaticLoader will hold the result of the expression which can be true or false that's clear so far .

The first part of the condition is checking weather the current PHP version is greater or equal 5.6

  • PHP_VERSION_ID is a predefined constant that returns the version id of PHP for 5.6 it returns something like 50630 in php 7 something like 70025.

The second part of the condition is checking weather the engine used to execute PHP code is ZEND or HHVM.

The last condition is checking weather the zend_loader_file_encoded function exists which is a part of the Zend Guard loaded extenion which means he is checking weather the Zend Guard loaded extenion is installed or not.

To Simplify it the condition is checking if the the PHP version is greater than or equals 5.6 and if it is not HHVM and if the Zend Guard loaded extension is not available or installed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.