3
This component provides functionality that helps writing PHP code that has runtime-specific (PHP / HHVM) execution paths.
5
[![Latest Stable Version](https://poser.pugx.org/sebastian/environment/v/stable.png)](https://packagist.org/packages/sebastian/environment)
6
[![Build Status](https://travis-ci.org/sebastianbergmann/environment.png?branch=master)](https://travis-ci.org/sebastianbergmann/environment)
10
To add Environment as a local, per-project dependency to your project, simply add a dependency on `sebastian/environment` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Environment 1.0:
14
"sebastian/environment": "1.0.*"
22
use SebastianBergmann\Environment\Runtime;
24
$runtime = new Runtime;
26
var_dump($runtime->getNameWithVersion());
27
var_dump($runtime->getName());
28
var_dump($runtime->getVersion());
29
var_dump($runtime->getBinary());
30
var_dump($runtime->isHHVM());
31
var_dump($runtime->isPHP());
32
var_dump($runtime->hasXdebug());
33
var_dump($runtime->canCollectCodeCoverage());
39
PHP 5.5.8 (cli) (built: Jan 9 2014 08:33:30)
40
Copyright (c) 1997-2013 The PHP Group
41
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
42
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
49
string(14) "'/usr/bin/php'"
58
HipHop VM 2.4.0-dev (rel)
59
Compiler: heads/master-0-ga98e57cabee7e7f0d14493ab17d5c7ab0157eb98
60
Repo schema: 8d6e69287c41c1f09bb4d327421720d1922cfc67
64
string(14) "HHVM 2.4.0-dev"
67
string(42) "'/usr/local/src/hhvm/hphp/hhvm/hhvm' --php"