PHP 7.2 additions

This commit is contained in:
Michael Moravec 2017-12-23 06:50:43 +01:00
parent 9961027930
commit c7b7dd2a9d
No known key found for this signature in database
GPG Key ID: 2930160BB3C7CFE4
13 changed files with 149 additions and 60 deletions

View File

@ -1101,3 +1101,28 @@ function sapi_windows_cp_is_utf8() {
* @link https://wiki.php.net/rfc/iterable
*/
function is_iterable($value) {}
/**
* Encodes an ISO-8859-1 string to UTF-8
* @link http://php.net/manual/en/function.utf8-encode.php
* @param string $data <p>
* An ISO-8859-1 string.
* </p>
* @return string the UTF-8 translation of <i>data</i>.
* @since 4.0
* @since 5.0
*/
function utf8_encode ($data) {}
/**
* Converts a string with ISO-8859-1 characters encoded with UTF-8
* @since 4.0
* @since 5.0
to single-byte ISO-8859-1
* @link http://php.net/manual/en/function.utf8-decode.php
* @param string $data <p>
* An UTF-8 encoded string.
* </p>
* @return string the ISO-8859-1 translation of <i>data</i>.
*/
function utf8_decode ($data) {}

View File

@ -617,3 +617,22 @@ final class Closure {
*/
public static function fromCallable (callable $callable) {}
}
/**
* Classes implementing <b>Countable</b> can be used with the
* <b>count</b> function.
* @link http://php.net/manual/en/class.countable.php
*/
interface Countable {
/**
* Count elements of an object
* @link http://php.net/manual/en/countable.count.php
* @return int The custom count as an integer.
* </p>
* <p>
* The return value is cast to an integer.
* @since 5.1.0
*/
public function count();
}

View File

@ -1320,6 +1320,13 @@ class ReflectionClass implements Reflector {
*/
public function isIterateable () {}
/**
* Checks if iterateable
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
* @since 7.2
*/
public function isIterable () {}
/**
* Implements interface
* @link http://php.net/manual/en/reflectionclass.implementsinterface.php

View File

@ -643,25 +643,6 @@ class ParentIterator extends RecursiveFilterIterator {
public function getChildren() { }
}
/**
* Classes implementing <b>Countable</b> can be used with the
* <b>count</b> function.
* @link http://php.net/manual/en/class.countable.php
*/
interface Countable {
/**
* Count elements of an object
* @link http://php.net/manual/en/countable.count.php
* @return int The custom count as an integer.
* </p>
* <p>
* The return value is cast to an integer.
* @since 5.1.0
*/
public function count();
}
/**
* The Seekable iterator.
* @link http://php.net/manual/en/class.seekableiterator.php

View File

@ -190,4 +190,12 @@ function iterator_apply ($iterator, $function, array $args = null) {}
* @since 5.4.0
*/
function class_uses($class, bool $autoload = true ) {}
/**
* @param object $obj
* @return int
* @since 7.2
*/
function spl_object_id($obj) {}
?>

View File

@ -1131,7 +1131,7 @@ class DOMDocument extends DOMNode {
* The DOMNodeList class
* @link http://php.net/manual/en/class.domnodelist.php
*/
class DOMNodeList implements Traversable {
class DOMNodeList implements Traversable, Countable {
/**
* @var int
@ -1152,7 +1152,12 @@ class DOMNodeList implements Traversable {
* index.
* @since 5.0
*/
public function item ($index) {}
public function item ($index) {}
/**
* @since 7.2.0
*/
public function count() {}
}
@ -1161,7 +1166,7 @@ class DOMNodeList implements Traversable {
* @link http://php.net/manual/en/class.domnamednodemap.php
* @property-read $length The number of nodes in the map. The range of valid child node indices is 0 to length - 1 inclusive.
*/
class DOMNamedNodeMap implements Traversable {
class DOMNamedNodeMap implements Traversable, Countable {
/**
* Retrieves a node specified by name
@ -1224,6 +1229,11 @@ class DOMNamedNodeMap implements Traversable {
*/
public function removeNamedItemNS ($namespaceURI, $localName) {}
/**
* @since 7.2.0
*/
public function count() {}
}
/**

View File

@ -3,20 +3,22 @@
// Start of ftp v.
/**
* @param $ftp
* @param $remote_file
* @param $local_file
* @param $mode
* @param resource $ftp
* @param string $remote_file
* @param string $local_file
* @param int $mode
* @return bool
* @since 7.2
*/
function ftp_append ($ftp, $remote_file, $local_file, $mode){}
function ftp_append ($ftp, $remote_file, $local_file, $mode = 0){}
/**
* @param $ftp
* @param $directory
* @param resource $ftp
* @param string $directory
* @return array
* @since 7.2
*/
function ftp_mlsd ($ftp, $directory){}
function ftp_mlsd ($ftp, $directory) {}
/**
* Opens an FTP connection

View File

@ -2225,6 +2225,15 @@ function imagefilter ($image, $filtertype, $arg1 = null, $arg2 = null, $arg3 = n
*/
function imageconvolution ($image, array $matrix, $div, $offset) {}
/**
* @param resource $im
* @param int $res_x
* @param int $res_y
* @return array
* @since 7.2
*/
function imageresolution ($im, $res_x = 96, $res_y = 96) {}
/**
* Used as a return value by imagetypes

View File

@ -343,5 +343,17 @@ define('JSON_ERROR_INVALID_PROPERTY_NAME',9);
*/
define('JSON_ERROR_UTF16',10);
/**
* @since 7.2
**/
define('JSON_INVALID_UTF8_IGNORE',1048576);
/**
* @since 7.2
*/
define('JSON_INVALID_UTF8_SUBSTITUTE',2097152);
// End of json v.1.3.1
?>

View File

@ -566,7 +566,7 @@ function mb_strimwidth ($str, $start, $width, $trimmarker = null, $encoding = nu
/**
* Convert character encoding
* @link http://php.net/manual/en/function.mb-convert-encoding.php
* @param string $str <p>
* @param string|array $str <p>
* The string being encoded.
* </p>
* @param string $to_encoding <p>
@ -914,7 +914,7 @@ function mb_get_info ($type = null) {}
/**
* Check if the string is valid for the specified encoding
* @link http://php.net/manual/en/function.mb-check-encoding.php
* @param string $var [optional] <p>
* @param string|array $var [optional] <p>
* The byte stream to check. If it is omitted, this function checks
* all the input from the beginning of the request.
* </p>
@ -1304,6 +1304,30 @@ function mbereg_search_getregs () {}
function mbereg_search_getpos () {}
/**
* @param int $cp
* @param string $encoding
* @return string|false
* @since 7.2
*/
function mb_chr($cp, $encoding) {}
/**
* @param string $cp
* @param string $encoding
* @return int|false
* @since 7.2
*/
function mb_ord($str, $encoding) {}
/**
* @param string $cp
* @param string $encoding
* @return string|false
* @since 7.2
*/
function mb_scrub($str, $encoding) {}
/**
* @param $position
*/

View File

@ -819,6 +819,7 @@ function openssl_pbkdf2($password, $salt, $key_length, $iterations, $digest_algo
* You can specify a filename with <i>content</i> that will
* be filled with the verified data, but with the signature information
* stripped.
* @param string|null
* </p>
* @return mixed true if the signature is verified, false if it is not correct
* (the message has been tampered with, or the signing certificate is invalid),
@ -826,7 +827,7 @@ function openssl_pbkdf2($password, $salt, $key_length, $iterations, $digest_algo
* @since 4.0.6
* @since 5.0
*/
function openssl_pkcs7_verify($filename, $flags, $outfilename = null, array $cainfo = null, $extracerts = null, $content = null) { }
function openssl_pkcs7_verify($filename, $flags, $outfilename = null, array $cainfo = null, $extracerts = null, $content = null, $pk7 = null) { }
/**
* Decrypts an S/MIME encrypted message
@ -1060,6 +1061,14 @@ function openssl_get_cert_locations() { }
function openssl_get_curve_names() {}
/**
* @param string $P7B
* @param array $certs
* @return bool
* @since 7.2
*/
function openssl_pkcs7_read($P7B, &$certs) {}
define ('OPENSSL_VERSION_TEXT', "OpenSSL 1.0.0e 6 Sep 2011");
define ('OPENSSL_VERSION_NUMBER', 268435551);
define ('X509_PURPOSE_SSL_CLIENT', 1);

View File

@ -549,31 +549,6 @@ function xml_parser_set_option ($parser, $option, $value) {}
*/
function xml_parser_get_option ($parser, $option) {}
/**
* Encodes an ISO-8859-1 string to UTF-8
* @link http://php.net/manual/en/function.utf8-encode.php
* @param string $data <p>
* An ISO-8859-1 string.
* </p>
* @return string the UTF-8 translation of <i>data</i>.
* @since 4.0
* @since 5.0
*/
function utf8_encode ($data) {}
/**
* Converts a string with ISO-8859-1 characters encoded with UTF-8
* @since 4.0
* @since 5.0
to single-byte ISO-8859-1
* @link http://php.net/manual/en/function.utf8-decode.php
* @param string $data <p>
* An UTF-8 encoded string.
* </p>
* @return string the ISO-8859-1 translation of <i>data</i>.
*/
function utf8_decode ($data) {}
define ('XML_ERROR_NONE', 0);
define ('XML_ERROR_NO_MEMORY', 1);
define ('XML_ERROR_SYNTAX', 2);

View File

@ -534,10 +534,18 @@ function inflate_init ($encoding, $options = array()) {}
function inflate_add ($context, $encoded_data, $flush_mode = ZLIB_SYNC_FLUSH) {}
/**
* @param $resource
* @param resource $context
* @return bool
* @since 7.2
*/
function inflate_get_read_len ($resource){}
function inflate_get_read_len ($context){}
/**
* @param resource $context
* @return bool
* @since 7.2
*/
function inflate_get_status() {}
define ('FORCE_GZIP', 31);
define ('FORCE_DEFLATE', 15);