#!/usr/bin/env php getFunctions() as $function => $compat) { $output['functions'][$function] = array( 'min' => nonempty($compat['php.min'], null), 'max' => nonempty($compat['php.max'], null), ); if (idx($compat, 'parameters')) { $output['params'][$function] = array_map( 'trim', explode(',', $compat['parameters'])); } } foreach ($reference->getInterfaces() as $interface => $compat) { $output['interfaces'][$interface] = array( 'min' => nonempty($compat['php.min'], null), 'max' => nonempty($compat['php.max'], null), ); } foreach ($reference->getClasses() as $class => $compat) { $output['classes'][$class] = array( 'min' => nonempty($compat['php.min'], null), 'max' => nonempty($compat['php.max'], null), ); } foreach ($reference->getConstants() as $constant => $compat) { $output['constants'][$constant] = array( 'min' => nonempty($compat['php.min'], null), 'max' => nonempty($compat['php.max'], null), ); } foreach ($reference->getClassMethods() as $class => $methods) { if (!array_key_exists($class, $output['classMethods'])) { $output['classMethods'][$class] = array(); } foreach ($methods as $method => $compat) { $output['classMethods'][$class][$method] = array( 'min' => nonempty($compat['php.min'], null), 'max' => nonempty($compat['php.max'], null), ); } } } ksort($output['params']); ksort($output['functions']); ksort($output['classes']); ksort($output['interfaces']); ksort($output['constants']); ksort($output['classMethods']); // Grepped from PHP Manual. $output['functions_windows'] = array( 'apache_child_terminate' => false, 'chroot' => false, 'getrusage' => false, 'imagecreatefromxpm' => false, 'lchgrp' => false, 'lchown' => false, 'nl_langinfo' => false, 'strptime' => false, 'sys_getloadavg' => false, 'checkdnsrr' => '5.3.0', 'dns_get_record' => '5.3.0', 'fnmatch' => '5.3.0', 'getmxrr' => '5.3.0', 'getopt' => '5.3.0', 'imagecolorclosesthwb' => '5.3.0', 'inet_ntop' => '5.3.0', 'inet_pton' => '5.3.0', 'link' => '5.3.0', 'linkinfo' => '5.3.0', 'readlink' => '5.3.0', 'socket_create_pair' => '5.3.0', 'stream_socket_pair' => '5.3.0', 'symlink' => '5.3.0', 'time_nanosleep' => '5.3.0', 'time_sleep_until' => '5.3.0', ); file_put_contents( phutil_get_library_root('arcanist').'/../'.$target, id(new PhutilJSON())->encodeFormatted($output)); echo "Done.\n";