Tool to find lines eliminated by OpCache's bytecode optimizer
Clone or download
Latest commit 34fa4bc Dec 24, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build Initial commit Dec 22, 2018
src Prepare release Dec 24, 2018
tests Initial commit Dec 22, 2018
tools Initial commit Dec 22, 2018
.gitignore Initial commit Dec 22, 2018
.php_cs.dist Initial commit Dec 22, 2018
ChangeLog.md Prepare release Dec 24, 2018
LICENSE Initial commit Dec 22, 2018
README.md Prepare release Dec 24, 2018
build.xml Initial commit Dec 22, 2018
composer.json Prepare release Dec 24, 2018
foal Initial commit Dec 22, 2018
phive.xml Initial commit Dec 22, 2018
phpunit.xml Prepare release Dec 24, 2018

README.md

Find Optimized-Away Lines (FOAL)

foal finds lines of code that are eliminated by OpCache's bytecode optimizer.

Installation

PHP Archive (PHAR)

The easiest way to obtain foalis to download a PHP Archive (PHAR) that has all required dependencies bundled in a single file:

$ wget https://phar.phpunit.de/foal.phar

Composer

You can add this tool as a local, per-project, development-time dependency to your project using Composer:

$ composer require --dev sebastian/foal

You can then invoke it using the ./vendor/bin/foal executable.

Usage

example.php

<?php
function f()
{
    $result = 'result';

    return $result;
}
$ php foal.phar example.php
foal 0.1.0 by Sebastian Bergmann.

The OpCache optimizer eliminated the following sourcecode lines:

4          $result = 'result';
7      }