#!/usr/bin/env php getExtension() === 'php') { $fullname = $it->getPath() . '/' . $it->getBaseName(); $contents = file_get_contents($fullname); if ($contents === false) { echo "failed to read $fullname\n"; ++$retCode; } elseif (preg_match_all($polyfill, $contents, $matches)) { var_dump($fullname, $matches); ++$retCode; } } } return $retCode; } // Don't care if tests use polyfill $errors = findPolyfill(__DIR__ . '/../src') + findPolyfill(__DIR__ . '/../samples'); if ($errors !== 0) { echo "Found $errors files that might require polyfills\n"; exit(1); } echo "No polyfills needed\n";