How to programmatically check if running on HHVM?

marcio

I need to run a given package on both HHVM runtime and traditional PHP runtime. My question: is there a way to check programmatically if current environment is HHVM? Something like this:

<?php
if(running_on_hhvm()) {
    // do hhvm compatible routine
}
else {
    // do normal routine
}
SamV

You can utilise the constant HHVM_VERSION specific to HHVM:

if (defined('HHVM_VERSION')) {
    // Code
}

You can put this in your own function if you want.

function is_hhvm() {
    return defined('HHVM_VERSION');
}

if (is_hhvm()) {
    // Code
}

Source: http://www.hhvm.com/blog/2393/hhvm-2-3-0-and-travis-ci

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to programmatically check if running on HHVM?

From Dev

How to check if ufw is running programmatically

From Dev

How to check programmatically if Zookeeper is running?

From Dev

How to programmatically check if Kafka Broker is up and running in Python

From Dev

Silex running in Nginx with HHVM

From Dev

How to programmatically check if row is deletable?

From Dev

How to check if a domain exists programmatically?

From Dev

How to check if hdfs is running?

From Dev

How to check if hdfs is running?

From Dev

How to programmatically retrieve the GID of a running process

From Dev

How to close all running app programmatically in android?

From Dev

How to programmatically retrieve the GID of a running process

From Dev

Trying to setup Memcached with Symfony running on NGINX/HHVM

From Dev

Running phpunit tests using HHVM (HipHop)

From Dev

Is HHVM or PHP5 Zend running?

From Dev

Is HHVM or PHP5 Zend running?

From Java

How to check if a service is running on Android?

From Dev

How to check if a NSTimer is running or not in Swift?

From Dev

android how to check if service is running

From Dev

How to check if a service is running in chef?

From Dev

How to check if a process is running on Windows?

From Dev

How to check if ElasticSearch is running properly

From Dev

How to check the process is already running or not

From Dev

How to check JobService is running or not in android?

From Dev

How to check if a timer is still running or not?

From Dev

How to check the process is already running or not

From Dev

how to check that mapreduce is running parallelly?

From Dev

how to check the daemon running status

From Dev

How to check progress of running cp?

Related Related

HotTag

Archive