#!/usr/bin/env php getAll(); $output = array(); $output['@'.'generated'] = true; $output['params'] = array(); foreach (array('functions', 'classes', 'interfaces') as $type) { $output[$type] = array(); foreach ($reference[$type] as $name => $versions) { $name = strtolower($name); $versions = reset($versions); list($min, $max) = $versions; if (version_compare($min, $required) > 0) { $output[$type][$name] = $min; } if ($type == 'functions' && isset($versions[2])) { $params = explode(', ', $versions[2]); foreach ($params as $i => $version) { if (version_compare($version, $required) > 0) { $output['params'][$name][$i] = $version; } } } } } file_put_contents( dirname(__FILE__).'/../'.$target, json_encode($output)); echo "Done.\n";