/hphp/runtime/ext/std/ext_std_variable.php

https://github.com/tstarling/hiphop-php · PHP · 180 lines · 76 code · 30 blank · 74 comment · 0 complexity · 6d5a086a43773903f0fcb1311521b079 MD5 · raw file

  1. <?hh
  2. // @generated by idl-to-hni.php
  3. /* Finds whether the given variable is a boolean.
  4. */
  5. <<__Native>>
  6. function is_bool(mixed $var): bool;
  7. /* Finds whether the type of the given variable is integer. To test if a
  8. * variable is a number or a numeric string (such as form input, which is
  9. * always a string), you must use is_numeric().
  10. */
  11. <<__Native>>
  12. function is_int(mixed $var): bool;
  13. <<__Native>>
  14. function is_integer(mixed $var): bool;
  15. <<__Native>>
  16. function is_long(mixed $var): bool;
  17. /* Finds whether the type of the given variable is float. To test if a
  18. * variable is a number or a numeric string (such as form input, which is
  19. * always a string), you must use is_numeric().
  20. */
  21. <<__Native>>
  22. function is_float(mixed $var): bool;
  23. <<__Native>>
  24. function is_double(mixed $var): bool;
  25. <<__Native>>
  26. function is_real(mixed $var): bool;
  27. /* Finds whether the given variable is numeric. Numeric strings consist of
  28. * optional sign, any number of digits, optional decimal part and optional
  29. * exponential part. Thus +0123.45e6 is a valid numeric value. Hexadecimal
  30. * notation (0xFF) is allowed too but only without sign, decimal and
  31. * exponential part.
  32. */
  33. <<__Native>>
  34. function is_numeric(mixed $var): bool;
  35. /* Finds whether the type given variable is string.
  36. */
  37. <<__Native>>
  38. function is_string(mixed $var): bool;
  39. /* Finds whether the given variable is a scalar. Scalar variables are those
  40. * containing an integer, float, string or boolean. Types array, object and
  41. * resource are not scalar. is_scalar() does not consider resource type
  42. * values to be scalar as resources are abstract datatypes which are currently
  43. * based on integers. This implementation detail should not be relied upon, as
  44. * it may change.
  45. */
  46. <<__Native>>
  47. function is_scalar(mixed $var): bool;
  48. /* Finds whether the given variable is an array.
  49. */
  50. <<__Native>>
  51. function is_array(mixed $var): bool;
  52. /* Finds whether the given variable is an object.
  53. */
  54. <<__Native>>
  55. function is_object(mixed $var): bool;
  56. /* Finds whether the given variable is a resource.
  57. */
  58. <<__Native>>
  59. function is_resource(mixed $var): bool;
  60. /* Finds whether the given variable is NULL.
  61. */
  62. <<__Native>>
  63. function is_null(mixed $var): bool;
  64. /* Returns the type of the PHP variable var. Warning Never use gettype() to
  65. * test for a certain type, since the returned string may be subject to change
  66. * in a future version. In addition, it is slow too, as it involves string
  67. * comparison. Instead, use the is_* functions.
  68. */
  69. <<__Native>>
  70. function gettype(mixed $v): string;
  71. /* This function gets the type of the given resource.
  72. */
  73. <<__Native>>
  74. function get_resource_type(resource $handle): string;
  75. <<__Native>>
  76. function boolval(mixed $var): bool;
  77. /* Returns the integer value of var, using the specified base for the
  78. * conversion (the default is base 10). intval() should not be used on
  79. * objects, as doing so will emit an E_NOTICE level error and return 1.
  80. */
  81. <<__Native>>
  82. function intval(mixed $var,
  83. int $base = 10): int;
  84. /* Gets the float value of var.
  85. */
  86. <<__Native>>
  87. function floatval(mixed $var): float;
  88. <<__Native>>
  89. function doubleval(mixed $var): float;
  90. <<__Native>>
  91. function strval(mixed $var): string;
  92. /* Set the type of variable var to type.
  93. */
  94. <<__Native>>
  95. function settype(mixed &$var,
  96. string $type): bool;
  97. /* print_r() displays information about a variable in a way that's readable by
  98. * humans. print_r(), var_dump() and var_export() will also show protected
  99. * and private properties of objects with PHP 5. Static class members will not
  100. * be shown. Remember that print_r() will move the array pointer to the end.
  101. * Use reset() to bring it back to beginning.
  102. */
  103. <<__Native>>
  104. function print_r(mixed $expression,
  105. bool $ret = false): mixed;
  106. <<__Native>>
  107. function var_export(mixed $expression,
  108. bool $ret = false): mixed;
  109. /* Dumps a string representation of an internal zend value to output.
  110. */
  111. <<__Native>>
  112. function debug_zval_dump(mixed $variable): void;
  113. /* Generates a storable representation of a value This is useful for storing
  114. * or passing PHP values around without losing their type and structure. To
  115. * make the serialized string into a PHP value again, use unserialize().
  116. */
  117. <<__Native>>
  118. function serialize(mixed $value): string;
  119. <<__Native>>
  120. function unserialize(string $str,
  121. array $class_whitelist = []): mixed;
  122. /* This function returns a multidimensional array containing a list of all
  123. * defined variables, be them environment, server or user-defined variables,
  124. * within the scope that get_defined_vars() is called.
  125. */
  126. <<__Native>>
  127. function get_defined_vars(): array;
  128. /* Imports GET/POST/Cookie variables into the global scope. It is useful if
  129. * you disabled register_globals, but would like to see some variables in the
  130. * global scope. If you're interested in importing other variables into the
  131. * global scope, such as $_SERVER, consider using extract().
  132. */
  133. function import_request_variables(string $types,
  134. string $prefix = ""): bool {
  135. throw new Exception("It is bad coding practice to remove scoping of ".
  136. "variables just to achieve coding convenience, ".
  137. "esp. in a language that encourages global ".
  138. "variables. This is possible to implement ".
  139. "though, by declaring those global variables ".
  140. "beforehand and assign with scoped ones when ".
  141. "this function is called.");
  142. }
  143. /* Import variables from an array into the current symbol table. Checks each
  144. * key to see whether it has a valid variable name. It also checks for
  145. * collisions with existing variables in the symbol table.
  146. */
  147. <<__Native>>
  148. function extract(array $var_array,
  149. int $extract_type = EXTR_OVERWRITE,
  150. string $prefix = ""): int;