--TEST--
-Bug #66811: Cannot access static::class in lambda, writen outside of a class
+Bug #66811: Cannot access static::class in lambda, written outside of a class
--FILE--
<?php
class A {
--TEST--
-Bug #70958 (Invalid opcode while using ::class as trait method paramater default value)
+Bug #70958 (Invalid opcode while using ::class as trait method parameter default value)
--FILE--
<?php
trait Foo
--FILE--
<?php
/* Prototype: array get_defined_vars(void);
- * Description: Returns a multidimentional array of all defined variables.
+ * Description: Returns a multidimensional array of all defined variables.
*/
/* Various variables definitions used for testing of the function */
--TEST--
-Test variable occuring on both LHS and RHS of list()
+Test variable occurring on both LHS and RHS of list()
--FILE--
<?php
{
public function __construct()
{
- echo "Trait contructor\n";
+ echo "Trait constructor\n";
}
}
new B();
--EXPECT--
-Trait contructor
+Trait constructor
public function __construct()
{
parent::__construct();
- echo "Trait contructor\n";
+ echo "Trait constructor\n";
}
}
--EXPECT--
Parent constructor
-Trait contructor
+Trait constructor
--TEST--
-Bug #75607 (Comparision of initial static properties failing)
+Bug #75607 (Comparison of initial static properties failing)
--FILE--
<?php
--TEST--
-Bug #75607 (Comparision of initial static properties failing)
+Bug #75607 (Comparison of initial static properties failing)
--FILE--
<?php
#define add_assoc_stringl(__arg, __key, __str, __length) add_assoc_stringl_ex(__arg, __key, strlen(__key), __str, __length)
#define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key), __value)
-/* unset() functions are only suported for legacy modules and null() functions should be used */
+/* unset() functions are only supported for legacy modules and null() functions should be used */
#define add_assoc_unset(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key))
#define add_index_unset(__arg, __key) add_index_null(__arg, __key)
#define add_next_index_unset(__arg) add_next_index_null(__arg)
uint32_t i = 0;
zend_ast_list *file_ast = zend_ast_get_list(CG(ast));
- /* Check to see if this declare is preceeded only by declare statements */
+ /* Check to see if this declare is preceded only by declare statements */
while (i < file_ast->children) {
if (file_ast->child[i] == ast) {
return SUCCESS;
/* Empty statements are not allowed prior to a declare */
return FAILURE;
} else if (file_ast->child[i]->kind != ZEND_AST_DECLARE) {
- /* declares can only be preceeded by other declares */
+ /* declares can only be preceded by other declares */
return FAILURE;
}
i++;
}
}
- /* These are assigned at the end to avoid unitialized memory in case of an error */
+ /* These are assigned at the end to avoid uninitialized memory in case of an error */
op_array->num_args = list->children;
op_array->arg_info = arg_infos;
DOM_GET_OBJ(nodep, id, xmlNodePtr, intern);
#if LIBXML_VERSION < 20627
-/* Implement logic from libxml xmlTextConcat to add suport for comments and PI */
+/* Implement logic from libxml xmlTextConcat to add support for comments and PI */
if ((nodep->content == (xmlChar *) &(nodep->properties)) ||
((nodep->doc != NULL) && (nodep->doc->dict != NULL) &&
xmlDictOwns(nodep->doc->dict, nodep->content))) {
>>>>>>>>>>>>>8 uleshort >0 \b, at offset %d
>>>>>>>>>>>>>(8.s+1) ubyte >0
>>>>>>>>>>>>>>&-1 string >\0 1st record "%s"
-# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL)
+# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
>>>>>>>24 ubelong&0x0133f7ff >0
# test for reserved NULL byte
>>>>>>>>47 ubyte 0
>>>>>>>>>>>>>8 uleshort >0 \b, at offset %d
>>>>>>>>>>>>>(8.s+1) ubyte >0
>>>>>>>>>>>>>>&-1 string >\0 1st record "%s"
-# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL)
+# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
>>>>>>>24 ubelong&0x0133f7ff >0
# test for reserved NULL byte
>>>>>>>>47 ubyte 0
if (ftp->use_ssl && ftp->use_ssl_for_data) {
ctx = SSL_get_SSL_CTX(ftp->ssl_handle);
if (ctx == NULL) {
- php_error_docref(NULL, E_WARNING, "data_accept: failed to retreive the existing SSL context");
+ php_error_docref(NULL, E_WARNING, "data_accept: failed to retrieve the existing SSL context");
return 0;
}
/* get the session from the control connection so we can re-use it */
session = SSL_get_session(ftp->ssl_handle);
if (session == NULL) {
- php_error_docref(NULL, E_WARNING, "data_accept: failed to retreive the existing SSL session");
+ php_error_docref(NULL, E_WARNING, "data_accept: failed to retrieve the existing SSL session");
SSL_free(data->ssl_handle);
return 0;
}
return 1;
}
- /* There is a chance the data isn't until later, would be wierd but it is possible */
+ /* There is a chance the data isn't until later, would be weird but it is possible */
if (gdTell(infile) != header->off) {
/* Should make sure we don't seek past the file size */
if (!gdSeek(infile, header->off)) {
im->colorsTotal = info->numcolors;
- /* There is a chance the data isn't until later, would be wierd but it is possible */
+ /* There is a chance the data isn't until later, would be weird but it is possible */
if (gdTell(infile) != header->off) {
/* Should make sure we don't seek past the file size */
if (!gdSeek(infile, header->off)) {
im->colorsTotal = info->numcolors;
- /* There is a chance the data isn't until later, would be wierd but it is possible */
+ /* There is a chance the data isn't until later, would be weird but it is possible */
if (gdTell(infile) != header->off) {
/* Should make sure we don't seek past the file size */
if (!gdSeek(infile, header->off)) {
im->colorsTotal = info->numcolors;
- /* There is a chance the data isn't until later, would be wierd but it is possible */
+ /* There is a chance the data isn't until later, would be weird but it is possible */
if (gdTell(infile) != header->off) {
/* Should make sure we don't seek past the file size */
if (!gdSeek(infile, header->off)) {
w = mb_tbl_code2uni_docomo1[s - mb_tbl_code2uni_docomo1_min];
if (w > 0xf000) {
w += 0x10000;
- } else if (w > 0xe000) { /* unsuported by Unicode 6.0 */
+ } else if (w > 0xe000) { /* unsupported by Unicode 6.0 */
w += 0xf0000;
}
*snd = 0;
w = mb_tbl_code2uni_kddi1[si];
if (w > 0xf000) {
w += 0x10000;
- } else if (w > 0xe000) { /* unsuported by Unicode 6.0 */
+ } else if (w > 0xe000) { /* unsupported by Unicode 6.0 */
w += 0xf0000;
}
}
w = mb_tbl_code2uni_kddi2[si];
if (w > 0xf000) {
w += 0x10000;
- } else if (w > 0xe000) { /* unsuported by Unicode 6.0 */
+ } else if (w > 0xe000) { /* unsupported by Unicode 6.0 */
w += 0xf0000;
}
}
w = mb_tbl_code2uni_sb1[si];
if (w > 0xf000) {
w += 0x10000;
- } else if (w > 0xe000) { /* unsuported by Unicode 6.0 */
+ } else if (w > 0xe000) { /* unsupported by Unicode 6.0 */
w += 0xf0000;
}
}
w = mb_tbl_code2uni_sb2[si];
if (w > 0xf000) {
w += 0x10000;
- } else if (w > 0xe000) { /* unsuported by Unicode 6.0 */
+ } else if (w > 0xe000) { /* unsupported by Unicode 6.0 */
w += 0xf0000;
}
} else if (s >= mb_tbl_code2uni_sb3_min && s <= mb_tbl_code2uni_sb3_max) {
w = mb_tbl_code2uni_sb3[si];
if (w > 0xf000) {
w += 0x10000;
- } else if (w > 0xe000) { /* unsuported by Unicode 6.0 */
+ } else if (w > 0xe000) { /* unsupported by Unicode 6.0 */
w += 0xf0000;
}
}
echo "Confirm language was changed:\n";
var_dump(mb_language());
-echo "Try changing to a non-existant language:\n";
+echo "Try changing to a non-existent language:\n";
var_dump(mb_language('Pig Latin'));
var_dump(mb_language());
?>
bool(true)
Confirm language was changed:
string(7) "English"
-Try changing to a non-existant language:
+Try changing to a non-existent language:
Warning: mb_language(): Unknown language "Pig Latin" in %s on line %d
bool(false)
--TEST--
-Bug #47803 Executing prepared statements is succesfull only for the first two statements
+Bug #47803 Executing prepared statements is successful only for the first two statements
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
}
if (fcall->extended_value < func->op_array.num_args) {
- /* don't inline funcions with named constants in default arguments */
+ /* don't inline functions with named constants in default arguments */
i = fcall->extended_value;
do {
(tmp & func_info->arg_info[opline->op1.num-1].info.type);
}
#if 0
- /* We won't recieve unused arguments */
+ /* We won't receive unused arguments */
if (ssa_vars[ssa_ops[i].result_def].use_chain < 0 &&
ssa_vars[ssa_ops[i].result_def].phi_use_chain == NULL &&
op_array->arg_info &&
/* from this point further, shared memory is supposed to be OK */
- /* remeber the last restart time in the process memory */
+ /* remember the last restart time in the process memory */
ZCG(last_restart_time) = ZCSG(last_restart_time);
/* Init auto-global strings */
$object = new stdclass;
$arr = array(1);
-// wrong paramters tests
+// wrong parameters tests
var_dump(openssl_encrypt($data, $wrong, $password));
var_dump(openssl_encrypt($object, $method, $password));
var_dump(openssl_encrypt($data, $object, $password));
// file to export cannot be written
@openssl_pkey_export_to_file($private_key_file, $invalid_file_for_write);
expect_openssl_errors('openssl_pkey_export_to_file write', ['2006D002']);
-// succesful export
+// successful export
@openssl_pkey_export($private_key_file_with_pass, $out, 'wrong pwd');
expect_openssl_errors('openssl_pkey_export', ['06065064', '0906A065']);
// invalid x509 for getting public key
strpos($original, ':') + 1,
strlen($original));
- // no real parser - any excotic setting can fool us
+ // no real parser - any exotic setting can fool us
$parts = explode(';', $dsn);
foreach ($parts as $k => $v) {
$tmp = explode('=', $v);
$dsn = changeDSN(getenv('PDOTEST_DSN'), array('dbname' => 'crazy;;dbname'));
$user = getenv('PDOTEST_USER');
$pass = getenv('PDOTEST_PASS');
-
+
new PDO($dsn, $user, $pass);
}
echo 'done!';
?>
--EXPECTF--
done!
-
}
/* If the SID constant exists, destroy it. */
- /* We must not delete any items in EG(zend_contants) */
+ /* We must not delete any items in EG(zend_constants) */
/* zend_hash_str_del(EG(zend_constants), "sid", sizeof("sid") - 1); */
sid = zend_get_constant_str("SID", sizeof("SID") - 1);
$port = 80;
$host = "yahoo.com";
$stringSocket = "send_socket_to_connected_socket";
-$stringSocketLenght = strlen($stringSocket);
+$stringSocketLength = strlen($stringSocket);
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$socketConn = socket_connect($socket, $host, $port);
-if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_OOB)===$stringSocketLenght){
+if(socket_send($socket, $stringSocket, $stringSocketLength, MSG_OOB)===$stringSocketLength){
print("okey\n");
}
-if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_EOR)===$stringSocketLenght){
+if(socket_send($socket, $stringSocket, $stringSocketLength, MSG_EOR)===$stringSocketLength){
print("okey\n");
}
-if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_EOF)===$stringSocketLenght){
+if(socket_send($socket, $stringSocket, $stringSocketLength, MSG_EOF)===$stringSocketLength){
print("okey\n");
}
-if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_DONTROUTE)===$stringSocketLenght){
+if(socket_send($socket, $stringSocket, $stringSocketLength, MSG_DONTROUTE)===$stringSocketLength){
print("okey\n");
}
?>
unset($port);
unset($host);
unset($stringSocket);
-unset($stringSocketLenght);
+unset($stringSocketLength);
unset($socket);
unset($socketConn);
?>
$port = 80;
$host = "yahoo.com";
$stringSocket = "send_socket_to_connected_socket";
-$stringSocketLenght = strlen($stringSocket);
+$stringSocketLength = strlen($stringSocket);
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$socketConn = socket_connect($socket, $host, $port);
-if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_OOB)===$stringSocketLenght){
+if(socket_send($socket, $stringSocket, $stringSocketLength, MSG_OOB)===$stringSocketLength){
print("okey\n");
}
-if(socket_send($socket, $stringSocket, $stringSocketLenght, MSG_DONTROUTE)===$stringSocketLenght){
+if(socket_send($socket, $stringSocket, $stringSocketLength, MSG_DONTROUTE)===$stringSocketLength){
print("okey\n");
}
?>
unset($port);
unset($host);
unset($stringSocket);
-unset($stringSocketLenght);
+unset($stringSocketLength);
unset($socket);
unset($socketConn);
?>
zend_object std;
} spl_SplObjectStorage; /* }}} */
-/* {{{ storage is an assoc aray of [zend_object*]=>[zval *obj, zval *inf] */
+/* {{{ storage is an assoc array of [zend_object*]=>[zval *obj, zval *inf] */
typedef struct _spl_SplObjectStorageElement {
zval obj;
zval inf;
ret = zend_string_init(str, str_len, 0);
if (levels == 1) {
- /* Defaut case */
+ /* Default case */
#ifdef PHP_WIN32
ZSTR_LEN(ret) = php_win32_ioutil_dirname(ZSTR_VAL(ret), str_len);
#else
* Source Code: ext/standard/array.c
*/
-/* Test in_array() with haystack as resouce and multidimentional arrays */
+/* Test in_array() with haystack as resouce and multidimensional arrays */
/* checking for Resources */
echo "*** Testing resource type with in_array() ***\n";
$additional_headers = "\nHEAD1: a\nHEAD2: b\n";
@unlink($outFile);
-echo "-- Invalid Header - preceeding newline--\n";
+echo "-- Invalid Header - preceding newline--\n";
// Calling mail() with all additional headers
var_dump( mail($to, $subject, $message, $additional_headers) );
echo @file_get_contents($outFile);
$additional_headers = "\rHEAD1: a\nHEAD2: b\r";
@unlink($outFile);
-echo "-- Invalid Header - preceeding newline--\n";
+echo "-- Invalid Header - preceding newline--\n";
// Calling mail() with all additional headers
var_dump( mail($to, $subject, $message, $additional_headers) );
echo @file_get_contents($outFile);
$additional_headers = "\r\nHEAD1: a\r\nHEAD2: b\r\n";
@unlink($outFile);
-echo "-- Invalid Header - preceeding newline--\n";
+echo "-- Invalid Header - preceding newline--\n";
// Calling mail() with all additional headers
var_dump( mail($to, $subject, $message, $additional_headers) );
echo @file_get_contents($outFile);
$additional_headers = "\r\n\r\nHEAD1: a\r\nHEAD2: b\r\n";
@unlink($outFile);
-echo "-- Invalid Header - preceeding newline--\n";
+echo "-- Invalid Header - preceding newline--\n";
// Calling mail() with all additional headers
var_dump( mail($to, $subject, $message, $additional_headers) );
echo @file_get_contents($outFile);
$additional_headers = "\n\nHEAD1: a\r\nHEAD2: b\r\n";
@unlink($outFile);
-echo "-- Invalid Header - preceeding newline--\n";
+echo "-- Invalid Header - preceding newline--\n";
// Calling mail() with all additional headers
var_dump( mail($to, $subject, $message, $additional_headers) );
echo @file_get_contents($outFile);
$additional_headers = "\r\rHEAD1: a\r\nHEAD2: b\r\n";
@unlink($outFile);
-echo "-- Invalid Header - preceeding newline--\n";
+echo "-- Invalid Header - preceding newline--\n";
// Calling mail() with all additional headers
var_dump( mail($to, $subject, $message, $additional_headers) );
echo @file_get_contents($outFile);
HEAD1: a\rHEAD2: b
A Message
--- Invalid Header - preceeding newline--
+-- Invalid Header - preceding newline--
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
bool(false)
--- Invalid Header - preceeding newline--
+-- Invalid Header - preceding newline--
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
bool(false)
--- Invalid Header - preceeding newline--
+-- Invalid Header - preceding newline--
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
bool(false)
--- Invalid Header - preceeding newline--
+-- Invalid Header - preceding newline--
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
bool(false)
--- Invalid Header - preceeding newline--
+-- Invalid Header - preceding newline--
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
bool(false)
--- Invalid Header - preceeding newline--
+-- Invalid Header - preceding newline--
Warning: mail(): Multiple or malformed newlines found in additional_header in %s/mail_basic6.php on line %d
bool(false)
--TEST--
-Test rand funtion when min and max are in proper or inverted order
+Test rand function when min and max are in proper or inverted order
--CREDITS--
PHP TestFEst 2017 - PHPDublin, PHPSP - Joao P V Martins <jp.joao@gmail.com>
--FILE--
?>
--FILE--
<?php
-/* Prototype : string vprintf(string $format , aaray $args)
- * Description: Output a formatted string
+/* Prototype : string vprintf(string $format , array $args)
+ * Description: Output a formatted string
* Source code: ext/standard/formatted_print.c
*/
?>
--FILE--
<?php
-/* Prototype : string vprintf(string $format , aaray $args)
- * Description: Output a formatted string
+/* Prototype : string vprintf(string $format , array $args)
+ * Description: Output a formatted string
* Source code: ext/standard/formatted_print.c
*/
?>
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , aaray $args)
- * Description: Return a formatted string
+/* Prototype : string vsprintf(string $format , array $args)
+ * Description: Return a formatted string
* Source code: ext/standard/formatted_print.c
*/
?>
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , aaray $args)
- * Description: Return a formatted string
+/* Prototype : string vsprintf(string $format , array $args)
+ * Description: Return a formatted string
* Source code: ext/standard/formatted_print.c
*/
php_url_scanner_reset_vars_impl(type);
goto finish;
}
- /* Check preceeding separator */
+ /* Check preceding separator */
if (!sep_removed
&& (size_t)(start - PG(arg_separator).output) >= separator_len
&& !memcmp(start - separator_len, PG(arg_separator).output, separator_len)) {
php_url_scanner_reset_vars_impl(type);
goto finish;
}
- /* Check preceeding separator */
+ /* Check preceding separator */
if (!sep_removed
&& (size_t)(start - PG(arg_separator).output) >= separator_len
&& !memcmp(start - separator_len, PG(arg_separator).output, separator_len)) {
--TEST--
-Bug #73793 (WDDX uses wrong decimal seperator)
+Bug #73793 (WDDX uses wrong decimal separator)
--SKIPIF--
<?php
if (!extension_loaded('wddx')) print 'skip wddx extension not available';
/* script_path_translated being set is a good indication that
* we are running in a cgi environment, since it is always
* null otherwise. otherwise, the filename
- * of the script will be retreived later via argc/argv */
+ * of the script will be retrieved later via argc/argv */
if (script_path_translated) {
const char *auth;
char *content_length = CGI_GETENV("CONTENT_LENGTH");
#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) && (HAVE_LIBREADLINE || HAVE_LIBEDIT) && !defined(COMPILE_DL_READLINE)
if (!interactive) {
/* The -a option was not passed. If there is no file, it could
- still make sense to run interactively. The presense of a file
+ still make sense to run interactively. The presence of a file
is essential to mitigate buggy console info. */
interactive = php_win32_console_is_own() &&
!(script_file ||
/* script_path_translated being set is a good indication that
* we are running in a cgi environment, since it is always
* null otherwise. otherwise, the filename
- * of the script will be retreived later via argc/argv */
+ * of the script will be retrieved later via argc/argv */
if (script_path_translated) {
const char *auth;
char *content_length = FCGI_GETENV(request, "CONTENT_LENGTH");
* WATCH_ON_HASHDATA: special watchpoint to watch for HT_GET_DATA_ADDR(ht) being efree()'d to be able to properly relocate Bucket watches
*
* Watch elements are either simple, recursive or implicit (PHPDBG_WATCH_* flags)
- * Simple means that a particular watchpoint was explicitely defined
+ * Simple means that a particular watchpoint was explicitly defined
* Recursive watch elements are created recursively (recursive root flag is to distinguish the root element easily from its children recursive elements)
* Implicit watch elements are implicitely created on all ancestors of simple or recursive watch elements
* Recursive and (simple or implicit) watch elements are mutually exclusive
$extension_method_info = mark_methods_as_tested($extension_method_info, $phpt_files);
/**
- * The loop to ouput the test coverage info
+ * The loop to output the test coverage info
* Should output: Extension, Class Name, Method/Function Name, Test Status, Test Files
*/
foreach($extension_method_info as $record) {
/* Check and conversion could be merged. This however would
be more expencive, if a non ASCII string was passed.
- TODO check wether the impact is acceptable. */
+ TODO check whether the impact is acceptable. */
if (in_len > 15) {
const char *aidx = (const char *)ZEND_SLIDE_TO_ALIGNED16(in);
/*
* PHP Sendmail for Windows.
*
- * This file is rewriten specificly for PHPFI. Some functionality
+ * This file is rewritten specificly for PHPFI. Some functionality
* has been removed (MIME and file attachments). This code was
* modified from code based on code written by Jarle Aase.
*