Test unset(), empty() and isset() functions
--FILE--
<?php
-/* Prototype: void unset ( mixed $var [, mixed $var [, mixed $...]] );
- Description: unset() destroys the specified variables
-
- Prototype: bool empty( mixed $var );
- Description: Determine whether a variable is considered to be empty
-
- Prototype: bool isset ( mixed $var [, mixed $var [, $...]] );
- Description: Returns TRUE if var exists; FALSE otherwise
-*/
-
echo "*** Testing unset(), empty() & isset() with scalar variables ***\n";
// testing scalar variables
Olivier Doucet
--FILE--
<?php
-/* Prototype : void restore_error_handler(void)
- * Description: Restores the previously defined error handler function
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing restore_error_handler() : error bug #46196 ***\n";
var_dump( set_error_handler( 'myErrorHandler' ) );
--FILE--
<?php
/*
- * proto bool function_exists(string function_name)
* Function is implemented in Zend/zend_builtin_functions.c
*/
--FILE--
<?php
-/* Prototype : array get_defined_functions ( void )
- * Description: Gets an array of all defined functions.
- * Source code: Zend/zend_builtin_functions.c
-*/
-
echo "*** Testing get_defined_functions() : basic functionality ***\n";
function foo() {}
Testing get_defined_vars() Function
--FILE--
<?php
-/* Prototype: array get_defined_vars(void);
- * Description: Returns a multidimensional array of all defined variables.
- */
-
/* Various variables definitions used for testing of the function */
$number = 22.33; //number
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alnum(mixed $c)
- * Description: Checks for alphanumeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_alnum() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alnum(mixed $c)
- * Description: Checks for alphanumeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_alnum() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alnum(mixed $c)
- * Description: Checks for alphanumeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_alnum() to test which character codes are considered
* valid alphanumeric characters
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alnum(mixed $c)
- * Description: Checks for alphanumeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different strings to ctype_alnum to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alnum(mixed $c)
- * Description: Checks for alphanumeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass octal and hexadecimal values to ctype_alnum() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alpha(mixed $c)
- * Description: Checks for alphabetic character(s)
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_alpha() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alpha(mixed $c)
- * Description: Checks for alphabetic character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_alpha() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alpha(mixed $c)
- * Description: Checks for alphabetic character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_alpha() to test which character codes are considered
* valid alphabetic characters
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alpha(mixed $c)
- * Description: Checks for alphabetic character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_alpha() to test
* which are considered valid alphabetic character only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_alpha(mixed $c)
- * Description: Checks for alphabetic character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass octal and hexadecimal values to ctype_alpha() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_cntrl(mixed $c)
- * Description: Checks for control character(s)
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_cntrl() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_cntrl(mixed $c)
- * Description: Checks for control character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_cntrl() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_cntrl(mixed $c)
- * Description: Checks for control character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_cntrl() to test which character codes are considered
* valid control characters
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_cntrl(mixed $c)
- * Description: Checks for control character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_cntrl() to test
* which are considered valid control character only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_cntrl(mixed $c)
- * Description: Checks for control character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass hexadecimal and octal values to ctype_cntrl() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_digit(mixed $c)
- * Description: Checks for numeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_digit() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_digit(mixed $c)
- * Description: Checks for numeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_digit() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_digit(mixed $c)
- * Description: Checks for numeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_digit() to test which character codes are considered
* valid decimal digits
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_digit(mixed $c)
- * Description: Checks for numeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_digit() to test
* which are considered valid decimal digit only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_digit(mixed $c)
- * Description: Checks for numeric character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass octal and hexadecimal values as $c argument to ctype_digit() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_graph(mixed $c)
- * Description: Checks for any printable character(s) except space
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_graph() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_graph(mixed $c)
- * Description: Checks for any printable character(s) except space
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_graph() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_graph(mixed $c)
- * Description: Checks for any printable character(s) except space
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_graph() to test which character codes are considered
* valid visibly printable characters
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_graph(mixed $c)
- * Description: Checks for any printable character(s) except space
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_graph() to test
* which are considered valid printable character only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_graph(mixed $c)
- * Description: Checks for any printable character(s) except space
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass octal and hexadecimal values to ctype_graph() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_lower(mixed $c)
- * Description: Checks for lowercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_lower() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_lower(mixed $c)
- * Description: Checks for lowercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_lower() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_lower(mixed $c)
- * Description: Checks for lowercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_lower() to test which character codes are considered
* valid lowercase characters
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_lower(mixed $c)
- * Description: Checks for lowercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_lower() to test
* which are considered valid lowercase character only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_lower(mixed $c)
- * Description: Checks for lowercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass octal and hexadecimal values to ctype_lower() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_print(mixed $c)
- * Description: Checks for printable character(s)
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_print() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_print(mixed $c)
- * Description: Checks for printable character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_print() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_print(mixed $c)
- * Description: Checks for printable character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_print() to test which character codes are considered
* valid printable characters
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_print(mixed $c)
- * Description: Checks for printable character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_print() to test
* which are considered valid printable character only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_print(mixed $c)
- * Description: Checks for printable character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass octal and hexadecimal values to ctype_print() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_punct(mixed $c)
- * Description: Checks for any printable character which is not whitespace
- * or an alphanumeric character
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_punct() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_punct(mixed $c)
- * Description: Checks for any printable character which is not whitespace
- * or an alphanumeric character
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_punt() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_punct(mixed $c)
- * Description: Checks for any printable character which is not whitespace
- * or an alphanumeric character
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_punct() to test which character codes are considered
* valid punctuation characters
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_punct(mixed $c)
- * Description: Checks for any printable character which is not whitespace
- * or an alphanumeric character
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_punct() to test
* which are considered valid punctuation character only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_punct(mixed $c)
- * Description: Checks for any printable character which is not whitespace
- * or an alphanumeric character
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different octal and hexadecimal values to ctype_punct() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_space(mixed $c)
- * Description: Checks for whitespace character(s)
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_space() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_space(mixed $c)
- * Description: Checks for whitespace character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_space() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_space(mixed $c)
- * Description: Checks for whitespace character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_space() to test which character codes are considered
* valid whitespace characters
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_space(mixed $c)
- * Description: Checks for whitespace character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_space() to test
* which are considered valid whitespace character only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_space(mixed $c)
- * Description: Checks for whitespace character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass octal and hexadecimal values as $c to ctype_space() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_upper(mixed $c)
- * Description: Checks for uppercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_upper() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_upper(mixed $c)
- * Description: Checks for uppercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_upper() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_upper(mixed $c)
- * Description: Checks for uppercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_upper() to test which character codes are considered
* valid uppercase characters
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_upper(mixed $c)
- * Description: Checks for uppercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_upper() to test
* which are considered valid uppercase character only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_upper(mixed $c)
- * Description: Checks for uppercase character(s)
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass octal and hexadecimal values to ctype_upper() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_xdigit(mixed $c)
- * Description: Checks for character(s) representing a hexadecimal digit
- * Source code: ext/ctype/ctype.c
- */
-
echo "*** Testing ctype_xdigit() : basic functionality ***\n";
$orig = setlocale(LC_CTYPE, "C");
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_xdigit(mixed $c)
- * Description: Checks for character(s) representing a hexadecimal digit
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different data types as $c argument to ctype_xdigit() to test behaviour
*/
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_xdigit(mixed $c)
- * Description: Checks for character(s) representing a hexadecimal digit
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different integers to ctype_xdigit() to test which character codes are considered
* valid hexadecimal 'digits'
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_xdigit(mixed $c)
- * Description: Checks for character(s) representing a hexadecimal digit
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass strings containing different character types to ctype_xdigit() to test
* which are considered valid hexadecimal 'digit' only strings
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool ctype_xdigit(mixed $c)
- * Description: Checks for character(s) representing a hexadecimal digit
- * Source code: ext/ctype/ctype.c
- */
-
/*
* Pass different hexadecimal and octal values that:
* 1. contain hexadecimal digits
?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_exec(resource ch)
- * Description: Perform a cURL session
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
<?php include 'skipif.inc'; ?>
--FILE--
<?php
-/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
- * Description: Set an option for a cURL transfer
- * Source code: ext/curl/interface.c
- * Alias to functions:
- */
-
include 'server.inc';
$host = curl_cli_server_start();
--FILE--
<?php
/*
- * Prototype: string curl_error(resource $ch)
* Description: Returns a clear text error message for the last cURL operation.
* Source: ext/curl/interface.c
* Documentation: http://wiki.php.net/qa/temp/ext/curl
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : resource curl_multi_init(void)
- * Description : Returns a new cURL multi handle
- * Source code : ext/curl/multi.c
- * Test documentation: http://wiki.php.net/qa/temp/ext/curl
- */
// start testing
echo "*** Testing curl_multi_init(void); ***\n";
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : resource curl_multi_select($mh, $timeout=1.0])
- * Description : Get all the sockets associated with the cURL extension, which can then be
- * "selected"
- * Source code : ?
- * Test documentation: http://wiki.php.net/qa/temp/ext/curl
- */
-
//create the multiple cURL handle
$mh = curl_multi_init();
--FILE--
<?php
/*
- * Prototype: bool curl_setopt_array(resource $ch, array $options)
* Description: Sets multiple options for a cURL session.
* Source: ext/curl/interface.c
* Documentation: http://wiki.php.net/qa/temp/ext/curl
Test new DateTimeZone() : basic functionality
--FILE--
<?php
-/* Prototype : DateTimeZone::__construct ( string $timezone )
- * Description: Returns new DateTimeZone object
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test new DateTimeZone() : error conditions
--FILE--
<?php
-/* Prototype : DateTimeZone::__construct ( string $timezone )
- * Description: Returns new DateTimeZone object
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
//Set the default time zone
date_default_timezone_set("GMT");
Test DateTimeZone::getName() function : basic functionality
--FILE--
<?php
-/* Prototype : public string DateTimeZone::getName ( void )
- * Description: Returns the name of the timezone
- * Source code: ext/date/php_date.c
- * Alias to functions: timezone_name_get()
- */
-
echo "*** Testing DateTimeZone::getName() : basic functionality ***\n";
//Set the default time zone
Test DateTimeZone::getOffset() function : basic functionality
--FILE--
<?php
-/* Prototype : int DateTimeZone::getOffset ( DateTime $datetime )
- * Description: Returns the timezone offset from GMT
- * Source code: ext/date/php_date.c
- * Alias to functions: timezone_offset_get()
- */
-
echo "*** Testing DateTimeZone::getOffset() : basic functionality ***\n";
//Set the default time zone
Test DateTimeZone::getTransitions() function : basic functionality
--FILE--
<?php
-/* Prototype : array DateTimeZone::getTransitions ()
- * Description: Returns all transitions for the timezone
- * Source code: ext/date/php_date.c
- * Alias to functions: timezone_transitions_get()
- */
-
echo "*** Testing DateTimeZone::getTransitions() : basic functionality ***\n";
//Set the default time zone
Test DateTimeZone::listAbbreviations() function : basic functionality
--FILE--
<?php
-/* Prototype : array DateTimeZone::listAbbreviations ( void )
- * Description: Returns associative array containing dst, offset and the timezone name
- * Source code: ext/date/php_date.c
- * Alias to functions: timezone_abbreviations_list
- */
-
echo "*** Testing DateTimeZone::listAbbreviations() : basic functionality ***\n";
//Set the default time zone
Test DateTimeZone::listIdentifiers function : basic functionality
--FILE--
<?php
-/* Prototype : array DateTimeZone::listIdentifiers ( void )
- * Description: Returns numerically index array with all timezone identifiers
- * Source code: ext/date/php_date.c
- * Alias to functions: timezone_identifiers_list
- */
-
echo "*** Testing DateTimeZone::listIdentifiers() : basic functionality ***\n";
//Set the default time zone
Test new DateTime() : basic functionality
--FILE--
<?php
-/* Prototype : DateTime::__construct ([ string $time="now" [, DateTimeZone $timezone=NULL ]] )
- * Description: Returns new DateTime object
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test new DateTime() : error conditions
--FILE--
<?php
-/* Prototype : DateTime::__construct ([ string $time="now" [, DateTimeZone $timezone=NULL ]] )
- * Description: Returns new DateTime object
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
//Set the default time zone
date_default_timezone_set("GMT");
Test DateTime::format() function : basic functionality
--FILE--
<?php
-/* Prototype : public string DateTime::format ( string $format )
- * Description: Returns date formatted according to given format
- * Source code: ext/date/php_date.c
- * Alias to functions: date_format
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test date_format() function : basic functionality
--FILE--
<?php
-/* Prototype : public string DateTime::format ( string $format )
- * Description: Returns date formatted according to given format
- * Source code: ext/date/php_date.c
- * Alias to functions: date_format
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test DateTime::getOffset() function : basic functionality
--FILE--
<?php
-/* Prototype : public int DateTime::getOffset ( void )
- * Description: Returns the daylight saving time offset
- * Source code: ext/date/php_date.c
- * Alias to functions: date_offset_get
- */
-
//Set the default time zone
date_default_timezone_set('Europe/London');
Test DateTime::getTimezone() function : basic functionality
--FILE--
<?php
-/* Prototype : public DateTimeZone DateTime::getTimezone ( void )
- * Description: Return time zone relative to given DateTime
- * Source code: ext/date/php_date.c
- * Alias to functions: date_timezone_get
- */
-
echo "*** Testing DateTime::getTimezone() : basic functionality ***\n";
date_default_timezone_set("Europe/London");
Test DateTime::modify() function : basic functionality
--FILE--
<?php
-/* Prototype : public DateTime DateTime::modify ( string $modify )
- * Description: Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime().
- * Source code: ext/date/php_date.c
- * Alias to functions: public date_modify()
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test DateTime::setDate() function : basic functionality
--FILE--
<?php
-/* Prototype : public DateTime DateTime::setDate ( int $year , int $month , int $day )
- * Description: Resets the current date of the DateTime object to a different date.
- * Source code: ext/date/php_date.c
- * Alias to functions: date_date_set()
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test DateTime::setISODate() function : basic functionality
--FILE--
<?php
-/* Prototype : public DateTime DateTime::setISODate ( int $year , int $week [, int $day ] )
- * Description: Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
- * Source code: ext/date/php_date.c
- * Alias to functions: date_isodate_set
- */
-
echo "*** Testing DateTime::setISODate() : basic functionality ***\n";
//Set the default time zone
Test DateTime::setTime() function : basic functionality
--FILE--
<?php
-/* Prototype : public DateTime DateTime::setTime ( int $hour , int $minute [, int $second ] )
- * Description: Resets the current time of the DateTime object to a different time.
- * Source code: ext/date/php_date.c
- * Alias to functions: date_time_set
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test DateTime::setTimezone() function : basic functionality
--FILE--
<?php
-/* Prototype : public DateTime DateTime::setTimezone ( DateTimeZone $timezone )
- * Description: Sets the time zone for the DateTime object
- * Source code: ext/date/php_date.c
- * Alias to functions: date_timezone_set
- */
-
echo "*** Testing DateTime::setTimezone() : basic functionality ***\n";
//Set the default time zone
Test date_create() function : basic functionality
--FILE--
<?php
-/* Prototype : bool checkdate ( int $month , int $day , int $year )
- * Description: Checks the validity of the date formed by the arguments.
- * A date is considered valid if each parameter is properly defined.
- * Source code: ext/date/php_date.c
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
--FILE--
<?php
date_default_timezone_set('UTC');
-/* Prototype : void date_add(DateTime object, DateInterval interval)
- * Description: Adds an interval to the current date in object.
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing date_add() : basic functionality ***\n";
// Initialise all required variables
Test date() function : basic functionality
--FILE--
<?php
-/* Prototype : string date ( string $format [, int $timestamp ] )
- * Description: Format a local time/date.
- * Source code: ext/date/php_date.c
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test date_create() function : basic functionality
--FILE--
<?php
-/* Prototype : DateTime date_create ([ string $time [, DateTimeZone $timezone ]] )
- * Description: Returns new DateTime object
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTime::__construct
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test date_date_set() function : basic functionality
--FILE--
<?php
-/* Prototype : DateTime date_date_set ( DateTime $object , int $year , int $month , int $day )
- * Description: Resets the current date of the DateTime object to a different date.
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTime::setDate
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test date_default_timezone_set() function : error variations
--FILE--
<?php
-/* Prototype : bool date_default_timezone_set ( string $timezone_identifier )
- * Description: Sets the default timezone used by all date/time functions in a script.
- * Source code: ext/standard/data/php_date.c
- */
-
echo "*** Testing date_default_timezone_set() : error variations ***\n";
echo "\n-- Testing date_default_timezone_set() function with invalid timezone identifier --\n";
Test date_format() function : basic functionality
--FILE--
<?php
-/* Prototype : string date_format ( DateTime $object , string $format )
- * Description: Returns date formatted according to given format
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTime::format
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test date_isodate_set() function : basic functionality
--FILE--
<?php
-/* Prototype : DateTime date_isodate_set ( DateTime $object , int $year , int $week [, int $day ] )
- * Description: Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTime::setISODate
- */
-
echo "*** Testing date_isodate_set() : basic functionality ***\n";
//Set the default time zone
Test date_modify() function : basic functionality
--FILE--
<?php
-/* Prototype : DateTime date_modify ( DateTime $object , string $modify )
- * Description: Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime().
- * Source code: ext/date/php_date.c
- * Alias to functions: public DateTime DateTime::modify()
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test date_offset_get() function : basic functionality
--FILE--
<?php
-/* Prototype : int date_offset_get ( DateTime $object )
- * Description: Returns the daylight saving time offset
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTime::getOffset
- */
-
//Set the default time zone
date_default_timezone_set('Europe/London');
Test date_parse() function : basic functionality
--FILE--
<?php
-/* Prototype : array date_parse ( string $date )
- * Description: Returns associative array with detailed info about given date.
- * Source code: ext/date/php_date.c
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test date_parse() function : error conditions
--FILE--
<?php
-/* Prototype : array date_parse ( string $date )
- * Description: Returns associative array with detailed info about given date.
- * Source code: ext/date/php_date.c
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
--FILE--
<?php
date_default_timezone_set('UTC');
-/* Prototype : void date_sub(DateTime object, DateInterval interval)
- * Description: Subtracts an interval from the current date in object.
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing date_sub() : basic functionality ***\n";
// Initialise all required variables
Test date_sunrise() function : usage variation - Checking sunrise for consecutive days in specific timezone
--FILE--
<?php
-/* Prototype : mixed date_sunrise(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
- * Description: Returns time of sunrise for a given day and location
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing date_sunrise() : usage variation ***\n";
//Timezones with required data for date_sunrise
Test date_sunrise() function : usage variation - Checking with North and South poles when Sun is up and down all day
--FILE--
<?php
-/* Prototype : mixed date_sunrise(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
- * Description: Returns time of sunrise for a given day and location
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing date_sunrise() : usage variation ***\n";
// GMT is zero for the timezone
Test date_sunset() function : usage variation - Checking sunrise for consecutive days in specific timezone
--FILE--
<?php
-/* Prototype : mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
- * Description: Returns time of sunrise for a given day and location
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing date_sunset() : usage variation ***\n";
//Timezones with required data for date_sunrise
Test date_sunset() function : usage variation - Checking with North and South poles when Sun is up and down all day
--FILE--
<?php
-/* Prototype : mixed date_sunset(mixed time [, int format [, float latitude [, float longitude [, float zenith [, float gmt_offset]]]]])
- * Description: Returns time of sunrise for a given day and location
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing date_sunset() : usage variation ***\n";
// GMT is zero for the timezone
Test date_time_set() function : basic functionality
--FILE--
<?php
-/* Prototype : DateTime date_time_set ( DateTime $object , int $hour , int $minute [, int $second ] )
- * Description: Resets the current time of the DateTime object to a different time.
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTime::setTime
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test date_timezone_get() function : basic functionality
--FILE--
<?php
-/* Prototype : DateTimeZone date_timezone_get ( DateTime $object )
- * Description: Return time zone relative to given DateTime
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTime::setTimezone
- */
-
echo "*** Testing date_timezone_get() : basic functionality ***\n";
date_default_timezone_set("Europe/London");
Test date_timezone_set() function : basic functionality
--FILE--
<?php
-/* Prototype : DateTime date_timezone_set ( DateTime $object , DateTimeZone $timezone )
- * Description: Sets the time zone for the DateTime object
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTime::setTimezone
- */
-
echo "*** Testing date_timezone_set() : basic functionality ***\n";
//Set the default time zone
Test getdate() function : basic functionality
--FILE--
<?php
-/* Prototype : array getdate([int timestamp])
- * Description: Get date/time information
- * Source code: ext/date/php_date.c
- */
-
echo "*** Testing getdate() : basic functionality ***\n";
//Set the default time zone
Test getdate() function : usage variation - Passing octal timestamp values
--FILE--
<?php
-/* Prototype : array getdate([int timestamp])
- * Description: Get date/time information
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing getdate() : usage variation ***\n";
//Set the default time zone
Test getdate() function : usage variation - Passing hexadcimal timestamp values
--FILE--
<?php
-/* Prototype : array getdate([int timestamp])
- * Description: Get date/time information
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing getdate() : usage variation ***\n";
//Set the default time zone
Test getdate() function : usage variation - Verifyig by supplying year-wise sample time stamps since Unix epoch time
--FILE--
<?php
-/* Prototype : array getdate([int timestamp])
- * Description: Get date/time information
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing getdate() : usage variation ***\n";
//Set the default time zone
Test getdate() function : usage variation - Verifyig with different timezones on Unix epoch timestamp
--FILE--
<?php
-/* Prototype : array getdate([int timestamp])
- * Description: Get date/time information
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing getdate() : usage variation ***\n";
//Timezones with required data for date_sunrise
Test getdate() function : usage variation - Passing strings containing numbers
--FILE--
<?php
-/* Prototype : array getdate([int timestamp])
- * Description: Get date/time information
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing getdate() : usage variation ***\n";
date_default_timezone_set("Asia/Calcutta");
Test gettimeofday() function : basic functionality
--FILE--
<?php
-/* Prototype : array gettimeofday([bool get_as_float])
- * Description: Returns the current time as array
- * Source code: ext/standard/microtime.c
- * Alias to functions:
- */
-
echo "*** Testing gettimeofday() : basic functionality ***\n";
date_default_timezone_set("Asia/Calcutta");
Test gmdate() function : basic functionality
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : basic functionality ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Passing Timezone format options to format argument.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Passing Full Date/Time format options to format argument.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Valid and invalid range of timestamp.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Passing predefined constants to format argument.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Passing numeric representation of day formats.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Passing textual representation of day formats.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Passing Week representation to format.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Passing Month format options to format argument.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Passing Year format options to format argument.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmdate() function : usage variation - Passing Time format options to format argument.
--FILE--
<?php
-/* Prototype : string gmdate(string format [, long timestamp])
- * Description: Format a GMT date/time
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
Test gmmktime() function : basic functionality
--FILE--
<?php
-/* Prototype : int gmmktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])
- * Description: Get UNIX timestamp for a GMT date
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmmktime() : basic functionality ***\n";
// Initialise all required variables
Test gmmktime() function : usage variation - Checking with few optional arguments.
--FILE--
<?php
-/* Prototype : int gmmktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])
- * Description: Get UNIX timestamp for a GMT date
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmmktime() : usage variation ***\n";
// Initialise all required variables
Test gmmktime() function : usage variation - Passing octal and hexadecimal values to arguments.
--FILE--
<?php
-/* Prototype : int gmmktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])
- * Description: Get UNIX timestamp for a GMT date
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmmktime() : usage variation ***\n";
// Initialise all required variables
Test gmmktime() function : usage variation - Passing positive and negative float values to arguments.
--FILE--
<?php
-/* Prototype : int gmmktime([int hour [, int min [, int sec [, int mon [, int day [, int year]]]]]])
- * Description: Get UNIX timestamp for a GMT date
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmmktime() : usage variation ***\n";
//Initialise variables
Test gmstrftime() function : basic functionality
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : basic functionality ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Checking month related formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Checking date related formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Checking time related formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Checking day related formats which was not supported on Windows before vc14.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Checking newline and tab formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Checking Preferred date and time representation on Windows.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Passing week related format strings to format argument.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Passing month related format strings to format argument.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Passing date related format strings to format argument.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Passing time related format strings to format argument.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Passing day related format strings to format argument.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Passing literal related strings to format argument.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test gmstrftime() function : usage variation - Checking week related formats which was not supported on Windows before vc14.
--FILE--
<?php
-/* Prototype : string gmstrftime(string format [, int timestamp])
- * Description: Format a GMT/UCT time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing gmstrftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test idate() function : basic functionality
--FILE--
<?php
-/* Prototype : int idate(string format [, int timestamp])
- * Description: Format a local time/date as integer
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing idate() : basic functionality ***\n";
// Initialise all required variables
Test idate() function : usage variation - Passing supported Date format characters to format argument.
--FILE--
<?php
-/* Prototype : int idate(string format [, int timestamp])
- * Description: Format a local time/date as integer
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing idate() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test idate() function : usage variation - Passing supported Time format characters to format argument.
--FILE--
<?php
-/* Prototype : int idate(string format [, int timestamp])
- * Description: Format a local time/date as integer
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing idate() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test idate() function : usage variation - Checking return of year(1 or 2 digits) format starting with zero and nonzero.
--FILE--
<?php
-/* Prototype : int idate(string format [, int timestamp])
- * Description: Format a local time/date as integer
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing idate() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test localtime() function : basic functionality
--FILE--
<?php
-/* Prototype : array localtime([int timestamp [, bool associative_array]])
- * Description: Returns the results of the C system call localtime as an associative array
- * if the associative_array argument is set to 1 other wise it is a regular array
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing localtime() : basic functionality ***\n";
date_default_timezone_set("UTC");
Test localtime() function : usage variation - Passing octal values to timestamp.
--FILE--
<?php
-/* Prototype : array localtime([int timestamp [, bool associative_array]])
- * Description: Returns the results of the C system call localtime as an associative array
- * if the associative_array argument is set to 1 other wise it is a regular array
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing localtime() : usage variation ***\n";
date_default_timezone_set("UTC");
Test localtime() function : usage variation - Passing hexa decimal values to timestamp.
--FILE--
<?php
-/* Prototype : array localtime([int timestamp [, bool associative_array]])
- * Description: Returns the results of the C system call localtime as an associative array
- * if the associative_array argument is set to 1 other wise it is a regular array
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing localtime() : usage variation ***\n";
date_default_timezone_set("UTC");
--FILE--
<?php
/*
- * proto mixed microtime([bool get_as_float])
* Function is implemented in ext/standard/microtime.c
*/
--FILE--
<?php
/*
- * proto mixed microtime([bool get_as_float])
* Function is implemented in ext/standard/microtime.c
*/
Test mktime() function : basic functionality
--FILE--
<?php
-/* Prototype : int mktime ([ int $hour= date("H") [, int $minute= date("i") [, int $second= date("s") [, int $month= date("n") [, int $day= date("j") [, int $year= date("Y") [, int $is_dst= -1 ]]]]]]] )
- * Description: Get Unix timestamp for a date
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test mktime() function : error conditions
--FILE--
<?php
-/* Prototype : int mktime ([ int $hour= date("H") [, int $minute= date("i") [, int $second= date("s") [, int $month= date("n") [, int $day= date("j") [, int $year= date("Y") [, int $is_dst= -1 ]]]]]]] )
- * Description: Get Unix timestamp for a date
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
Test strftime() function : basic functionality
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : basic functionality ***\n";
date_default_timezone_set("Asia/Calcutta");
?>
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Checking month related formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Checking date related formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Checking time related formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Checking day related formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Checking newline and tab formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Checking Preferred date and time representation on Windows.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Passing week related format strings to format argument.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
date_default_timezone_set("Asia/Calcutta");
Test strftime() function : usage variation - Passing month related format strings to format argument.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
date_default_timezone_set("Asia/Calcutta");
Test strftime() function : usage variation - Passing date related format strings to format argument.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Passing time related format strings to format argument.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Passing day related format strings to format argument.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Passing literal related strings to format argument.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test strftime() function : usage variation - Checking week related formats which was not supported on Windows before VC14.
--FILE--
<?php
-/* Prototype : string strftime(string format [, int timestamp])
- * Description: Format a local time/date according to locale settings
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing strftime() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
--FILE--
<?php
/*
- * proto int time(void)
* Function is implemented in ext/date/php_date.c
*/
Test timezone_abbreviations_list() function : basic functionality
--FILE--
<?php
-/* Prototype : array timezone_abbreviations_list ( void )
- * Description: Returns associative array containing dst, offset and the timezone name
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTimeZone::listAbbreviations
- */
-
echo "*** Testing timezone_abbreviations_list() : basic functionality ***\n";
//Set the default time zone
Test timezone_identifiers_list() function : basic functionality
--FILE--
<?php
-/* Prototype : array timezone_identifiers_list ( void )
- * Description: Returns numerically index array with all timezone identifiers
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing timezone_identifiers_list() : basic functionality ***\n";
//Set the default time zone
Test timezone_name_from_abbr() function : basic functionality
--FILE--
<?php
-/* Prototype : string timezone_name_from_abbr ( string $abbr [, int $gmtOffset= -1 [, int $isdst= -1 ]] )
- * Description: Returns the timezone name from abbreviation
- * Source code: ext/date/php_date.c
- * Alias to functions:
- */
-
echo "*** Testing timezone_name_from_abbr() : basic functionality ***\n";
//Set the default time zone
Test timezone_offset_get() function : basic functionality
--FILE--
<?php
-/* Prototype : int timezone_offset_get ( DateTimeZone $object , DateTime $datetime )
- * Description: Returns the timezone offset from GMT
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTimeZone::getOffset
- */
-
echo "*** Testing timezone_offset_get() : basic functionality ***\n";
//Set the default time zone
Test timezone_offset_get() function : error conditions
--FILE--
<?php
-/* Prototype : int timezone_offset_get ( DateTimeZone $object , DateTime $datetime )
- * Description: Returns the timezone offset from GMT
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTimeZone::getOffset
- */
-
//Set the default time zone
date_default_timezone_set("GMT");
$tz = timezone_open("Europe/London");
Test timezone_open() function : basic functionality
--FILE--
<?php
-/* Prototype : DateTimeZone timezone_open ( string $timezone )
- * Description: Returns new DateTimeZone object
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTime::__construct()
- */
-
echo "*** Testing timezone_open() : basic functionality ***\n";
var_dump( timezone_open("GMT") );
Test timezone_transitions_get() function : basic functionality
--FILE--
<?php
-/* Prototype : array timezone_transitions_get ( DateTimeZone $object, [ int $timestamp_begin [, int $timestamp_end ]] )
- * Description: Returns all transitions for the timezone
- * Source code: ext/date/php_date.c
- * Alias to functions: DateTimeZone::getTransitions()
- */
-
echo "*** Testing timezone_transitions_get() : basic functionality ***\n";
//Set the default time zone
--FILE--
<?php
-/* Prototype : int exif_imagetype ( string $filename )
- * Description: Determine the type of an image
- * Source code: ext/exif/exif.c
-*/
echo "*** Testing exif_imagetype() : basic functionality ***\n";
var_dump(exif_imagetype(__DIR__.'/test2私はガラスを食べられます.jpg'));
--FILE--
<?php
-/* Prototype : int exif_imagetype ( string $filename )
- * Description: Determine the type of an image
- * Source code: ext/exif/exif.c
-*/
echo "*** Testing exif_imagetype() : basic functionality ***\n";
var_dump(exif_imagetype(__DIR__.'/test2.jpg'));
--FILE--
<?php
-/* Prototype : int exif_imagetype ( string $filename )
- * Description: Determine the type of an image
- * Source code: ext/exif/exif.c
-*/
-
echo "*** Testing exif_imagetype() : error conditions ***\n";
echo "\n-- Testing exif_imagetype() function with an unknown file --\n";
--FILE--
<?php
-/* Prototype :string exif_tagname ( string $index )
- * Description: Get the header name for an index
- * Source code: ext/exif/exif.c
-*/
-
echo "*** Testing exif_tagname() : basic functionality ***\n";
var_dump(exif_tagname(0x10E));
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : string finfo_buffer(resource finfo, char *string [, int options [, resource context]])
- * Description: Return information about a string buffer.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic私はガラスを食べられます';
$options = array(
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : string finfo_buffer(resource finfo, char *string [, int options [, resource context]])
- * Description: Return information about a string buffer.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic';
$options = array(
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : string finfo_buffer(resource finfo, char *string [, int options [, resource context]])
- * Description: Return information about a string buffer.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic私はガラスを食べられます';
$options = array(
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : string finfo_buffer(resource finfo, char *string [, int options [, resource context]])
- * Description: Return information about a string buffer.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic';
$options = array(
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : resource finfo_close(resource finfo)
- * Description: Close fileinfo resource.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
echo "*** Testing finfo_close() : basic functionality ***\n";
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic';
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : resource finfo_close(resource finfo)
- * Description: Close fileinfo resource.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
echo "*** Testing finfo_close() : error conditions ***\n";
echo "\n-- Testing finfo_close() function with wrong resource type --\n";
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : string finfo_file(resource finfo, char *file_name [, int options [, resource context]])
- * Description: Return information about a file.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic';
$finfo = finfo_open( FILEINFO_MIME );
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : resource finfo_open([int options [, string arg]])
- * Description: Create a new fileinfo resource.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic';
echo "*** Testing finfo_open() : basic functionality ***\n";
<?php require_once(__DIR__ . '/skipif.inc');
--FILE--
<?php
-/* Prototype : resource finfo_open([int options [, string arg]])
- * Description: Create a new fileinfo resource.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic';
echo "*** Testing finfo_open() : error functionality ***\n";
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : resource finfo_open([int options [, string arg]])
- * Description: Create a new fileinfo resource.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic';
echo "*** Testing finfo_open() : variations in opening ***\n";
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool finfo_set_flags(resource finfo, int options)
- * Description: Set libmagic configuration options.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic私はガラスを食べられます';
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
<?php require_once(__DIR__ . '/skipif.inc'); ?>
--FILE--
<?php
-/* Prototype : bool finfo_set_flags(resource finfo, int options)
- * Description: Set libmagic configuration options.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
$magicFile = __DIR__ . DIRECTORY_SEPARATOR . 'magic';
$finfo = finfo_open( FILEINFO_MIME, $magicFile );
--FILE--
<?php
-/* Prototype : array gd_info ( void )
- * Description: Retrieve information about the currently installed GD library
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
echo "basic test of gd_info() function\n";
var_dump(gd_info());
?>
--FILE--
<?php
-/* Prototype : array gd_info()
- * Description: Retrieve information about the currently installed GD library
- * Source code: ext/gd/gd.c
- */
-
echo "*** Testing gd_info() : variation ***\n";
var_dump(gd_info());
?>
--FILE--
<?php
-/* Prototype : int imagecolorallocate(resource im, int red, int green, int blue)
- * Description: Allocate a color for an image
- * Source code: ext/gd/gd.c
- */
-
echo "*** Testing imagecolorallocate() : basic functionality ***\n";
$im = imagecreatetruecolor(200, 200);
<?php
require __DIR__ . '/func.inc';
-/* Prototype : int imagecolorallocate(resource im, int red, int green, int blue)
- * Description: Allocate a color for an image
- * Source code: ext/gd/gd.c
- */
echo "*** Testing imagecolorallocate() : usage variations ***\n";
$im = imagecreatetruecolor(200, 200);
<?php
require __DIR__ . '/func.inc';
-/* Prototype : int imagecolorallocate(resource im, int red, int green, int blue)
- * Description: Allocate a color for an image
- * Source code: ext/gd/gd.c
- */
echo "*** Testing imagecolorallocate() : usage variations ***\n";
$values = array(
?>
--FILE--
<?php
-/* Prototype : int imagecolorstotal ( resource $image )
- * Description: Find out the number of colors in an image's palette
- * Source code: ext/gd/gd.c
- */
-
echo "*** Testing imagecolorstotal() : basic functionality ***\n";
// Get an image
?>
--FILE--
<?php
-/* Prototype : int imagecolorstotal(resource im)
- * Description: Find out the number of colors in an image's palette
- * Source code: ext/gd/gd.c
- * Alias to functions:
- */
-
echo "*** Testing imagecolorstotal() : basic functionality ***\n";
// Palette image
--FILE--
<?php
-/* Prototype : bool imagecopyresampled ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h )
- * Description: Copy and resize part of an image with resampling.
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
-
echo "Simple test of imagecopyresampled() function\n";
$dest_lge = dirname(realpath(__FILE__)) . '/imagelarge.png';
--FILE--
<?php
-/* Prototype : bool imagedashedline ( resource $image , int $x1 , int $y1 , int $x2 , int $y2 , int $color )
- * Description: Draws a dashed line.
- * This function is deprecated. Use combination of imagesetstyle() and imageline() instead.
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
-
-
echo "Simple test of imagedashedline() function\n";
$dest = dirname(realpath(__FILE__)) . '/imagedashedline.png';
--FILE--
<?php
-/* Prototype : bool imagefilledpolygon ( resource $image , array $points , int $num_points , int $color )
- * Description: Draws a filled polygon.
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
-
echo "Simple test of imagefilledpolygon() function\n";
$dest = dirname(realpath(__FILE__)) . '/imagefilledpolygon.png';
--FILE--
<?php
-/* Prototype : bool imagepolygon ( resource $image , array $points , int $num_points , int $color )
- * Description: Draws a polygon.
- * Source code: ext/gd/gd.c
- * Alias to functions:
- */
-
-
echo "Simple test of imagepolygon() function\n";
$dest = dirname(realpath(__FILE__)) . '/imagepolygon.png';
--FILE--
<?php
-/* Prototype : array hash_algos (void)
- * Description: Return a list of registered hashing algorithms
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_algos() : basic functionality ***\n";
var_dump(hash_algos());
--FILE--
<?php
-/* Prototype : string hash ( string $algo , string $data [, bool $raw_output ] )
- * Description: Generate a hash value (message digest)
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
echo "*** Testing hash() : error conditions ***\n";
echo "\n-- Testing hash() function with invalid hash algorithm --\n";
Felix De Vliegher <felix.devliegher@gmail.com>
--FILE--
<?php
-/* Prototype : string hash_file(string algo, string filename[, bool raw_output = false])
- * Description: Generate a hash of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
- */
-
echo "*** Testing hash_file() : basic functionality ***\n";
// Set up file
--FILE--
<?php
-/* Prototype : string hash_file ( string algo, string filename [, bool raw_output] )
- * Description: Generate a hash value using the contents of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_file() : basic functionality ***\n";
$file = __DIR__ . "hash_file.txt";
Felix De Vliegher <felix.devliegher@gmail.com>
--FILE--
<?php
-/* Prototype : string hash_file(string algo, string filename[, bool raw_output = false])
- * Description: Generate a hash of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
- */
-
echo "*** Testing hash_file() : error conditions ***\n";
// Set up file
--FILE--
<?php
-/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
- * Description: HMAC-based Key Derivation Function
- * Source code: ext/hash/hash.c
-*/
-
echo "*** Testing hash_hkdf(): basic functionality ***\n";
$ikm = 'input key material';
--FILE--
<?php
-/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
- * Description: HMAC-based Key Derivation Function
- * Source code: ext/hash/hash.c
-*/
-
echo "*** Testing hash_hkdf(): edge cases ***\n";
$ikm = 'input key material';
error_reporting(E_ALL);
-/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
- * Description: HMAC-based Key Derivation Function
- * Source code: ext/hash/hash.c
-*/
-
function trycatch_dump(...$tests) {
foreach ($tests as $test) {
try {
--FILE--
<?php
-/* Prototype : string hkdf ( string $algo , string $ikm [, int $length , string $info = '' , string $salt = '' ] )
- * Description: HMAC-based Key Derivation Function
- * Source code: ext/hash/hash.c
-*/
-
echo "*** Testing hash_hkdf(): RFC 5869 test vectors ***\n";
echo "Test case 1 (SHA-256): ",
bin2hex(hash_hkdf(
--FILE--
<?php
-/* Prototype : string hash_hmac ( string $algo , string $data , string $key [, bool $raw_output ] )
- * Description: Generate a keyed hash value using the HMAC method
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_hmac() : basic functionality ***\n";
$content = "This is a sample string used to test the hash_hmac function with various hashing algorithms";
--FILE--
<?php
/*
-* proto string hash_hmac ( string algo, string data, string key [, bool raw_output] )
* Function is implemented in ext/hash/hash.c
*/
<?php
-/* Prototype : string hash_hmac_file ( string algo, string filename, string key [, bool raw_output] )
- * Description: Generate a keyed hash value using the HMAC method and the contents of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_hmac_file() : basic functionality ***\n";
$file = __DIR__ . "hash_hmac_file.txt";
--FILE--
<?php
-/* Prototype : string hash_hmac_file ( string algo, string filename, string key [, bool raw_output] )
- * Description: Generate a keyed hash value using the HMAC method and the contents of a given file
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash() : error conditions ***\n";
$file = __DIR__ . "hash_file.txt";
--FILE--
<?php
-/* Prototype : string hash_hmac(string $algo, string $data, string $key [, int $length = 0 [, bool $raw_output = false]])
- * Description: Generate a keyed hash value using the HMAC method
- * Source code: ext/hash/hash.c
- * Alias to functions:
-*/
-
echo "*** Testing hash_pbkdf2() : basic functionality ***\n";
echo "sha1: " . hash_pbkdf2('sha1', 'password', 'salt', 1, 20)."\n";
--FILE--
<?php
-/* {{{ proto string hash_pbkdf2(string algo, string password, string salt, int iterations [, int length = 0, bool raw_output = false])
-Generate a PBKDF2 hash of the given password and salt
+/* Generate a PBKDF2 hash of the given password and salt
Returns lowercase hexbits by default */
echo "*** Testing hash_pbkdf2() : error conditions ***\n";
?>
--FILE--
<?php
-/* Prototype : string iconv(string in_charset, string out_charset, string str)
- * Description: Returns converted string in desired encoding
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Test basic functionality of iconv()
*/
iconv.output_encoding=ISO-8859-1
--FILE--
<?php
-/* Prototype : mixed iconv_get_encoding([string type])
- * Description: Get internal encoding and output encoding for ob_iconv_handler()
- * Prototype : bool iconv_set_encoding(string type, string charset)
- * Description: Sets internal encoding and output encoding for ob_iconv_handler()
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Test Basic functionality of iconv_get_encoding/iconv_set_encoding
*/
?>
--FILE--
<?php
-/* Prototype : int iconv_strlen(string str [, string charset])
- * Description: Get character numbers of a string
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Test basic functionality of iconv_strlen()
*/
?>
--FILE--
<?php
-/* Prototype : int iconv_strlen(string str [, string charset])
- * Description: Get character numbers of a string
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Test iconv_strlen when passed an unknown encoding
*/
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php
-/* Prototype : int iconv_strpos(string haystack, string needle [, int offset [, string charset]])
- * Description: Find position of first occurrence of a string within another
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Test basic functionality of iconv_strpos with ASCII and multibyte characters
*/
?>
--FILE--
<?php
-/* Prototype : int iconv_strpos(string haystack, string needle [, int offset [, string charset]])
- * Description: Find position of first occurrence of a string within another
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Pass an unknown encoding to iconv_strpos() to test behaviour
*/
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php
-/* Prototype : int iconv_strpos(string haystack, string needle [, int offset [, string charset]])
- * Description: Find position of first occurrence of a string within another
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Test how iconv_strpos() behaves when passed different integers as $offset argument
* The character length of $string_ascii and $string_mb is the same,
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php
-/* Prototype : proto int iconv_strrpos(string haystack, string needle [, string charset])
- * Description: Find position of last occurrence of a string within another
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Test basic functionality of iconv_strrpos()
*/
?>
--FILE--
<?php
-/* Prototype : proto int iconv_strrpos(string haystack, string needle [, string charset])
- * Description: Find position of last occurrence of a string within another
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Pass iconv_strrpos() an encoding that doesn't exist
*/
output_encoding=ISO-8859-1
--FILE--
<?php
-/* Prototype : string iconv_substr(string str, int offset, [int length, string charset])
- * Description: Returns part of a string
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Test Basic Functionality of iconv_substr with ASCII characters and multibyte strings.
*/
?>
--FILE--
<?php
-/* Prototype : string iconv_substr(string str, int offset, [int length, string charset])
- * Description: Returns part of a string
- * Source code: ext/iconv/iconv.c
- */
-
/*
* Pass an unknown encoding to iconv_substr() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : string imap_8bit ( string $string )
- * Description: Convert an 8bit string to a quoted-printable string.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_8bit() : basic functionality ***\n";
var_dump(imap_8bit("String with CRLF at end \r\n"));
?>
--FILE--
<?php
-/* Prototype : bool imap_append ( resource $imap_stream , string $mailbox , string $message [, string $options ] )
- * Description: Append a string message to a specified mailbox.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_append() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
?>
--FILE--
<?php
-/* Prototype : string imap_base64 ( string $text )
- * Description: Decode BASE64 encoded text.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_base64() : basic functionality ***\n";
$str = 'This is an example string to be base 64 encoded';
?>
--FILE--
<?php
-/* Prototype : string imap_binary ( string $string )
- * Description: Convert an 8bit string to a base64 string.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_binary() : basic functionality ***\n";
echo "Encode as short string\n";
?>
--FILE--
<?php
-/* Prototype : string imap_body ( resource $imap_stream , int $msg_number [, int $options ] )
- * Description: Read the message body.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_body() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
?>
--FILE--
<?php
-/* Prototype : object imap_bodystruct ( resource $imap_stream , int $msg_number , string $section )
- * Description: Read the structure of a specified body section of a specific message.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing string imap_bodystruct : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
?>
--FILE--
<?php
-/* Prototype : bool imap_clearflag_full ( resource $imap_stream , string $sequence , string $flag [, string $options ] )
- * Description: Clears flags on messages.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_clearflag_full() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
?>
--FILE--
<?php
-/* Prototype : bool imap_close(resource $stream_id [, int $options])
- * Description: Close an IMAP stream
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_close() : basic functionality ***\n";
// include file for required variables in imap_open()
?>
--FILE--
<?php
-/* Prototype : bool imap_close(resource $stream_id [, int $options])
- * Description: Close an IMAP stream
- * Source code: ext/imap/php_imap.c
- */
-
/*
* Pass different integers as $options arg to imap_close() to test which are
* recognised as CL_EXPUNGE option
?>
--FILE--
<?php
-/* Prototype : bool imap_createmailbox ( resource $imap_stream , string $mailbox )
- * Description: Creates a new mailbox specified by mailbox .
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_createmailbox() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
?>
--FILE--
<?php
-/* Prototype : array imap_errors ( void )
- * Description: Returns all of the IMAP errors that have occurred.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_errors() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
$password = "bogus"; // invalid password to use in this test
?>
--FILE--
<?php
-/* Prototype : array imap_fetch_overview(resource $stream_id, int $msg_no [, int $options])
- * Description: Read an overview of the information in the headers
- * of the given message sequence
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_fetch_overview() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
?>
--FILE--
<?php
-/* Prototype : array imap_fetch_overview(resource $stream_id, int $msg_no [, int $options])
- * Description: Read an overview of the information in the headers of the given message sequence
- * Source code: ext/imap/php_imap.c
- */
-
/*
* Test passing a range of values into the $options argument to imap_fetch_overview():
* 1. values that equate to 1
?>
--FILE--
<?php
-/* Prototype : array imap_fetch_overview(resource $stream_id, int $msg_no [, int $options])
- * Description: Read an overview of the information in the headers
- * of the given message sequence
- * Source code: ext/imap/php_imap.c
- */
-
/*
* Pass different sequences/msg numbers as $msg_no argument to test behaviour
* of imap_fetch_overview()
?>
--FILE--
<?php
-/* Prototype : array imap_fetch_overview(resource $stream_id, int $msg_no [, int $options])
- * Description: Read an overview of the information in the headers of the given message sequence
- * Source code: ext/imap/php_imap.c
- */
-
/*
* Pass a multipart message to imap_fetch_overview() to test the contents of returned array
*/
?>
--FILE--
<?php
-/* Prototype : string imap_fetchbody(resource $stream_id, int $msg_no, string $section
- * [, int $options])
+/* [, int $options])
* Description: Get a specific body section
* Source code: ext/imap/php_imap.c
*/
?>
--FILE--
<?php
-/* Prototype : string imap_fetchbody(resource $stream_id, int $msg_no, string $section [, int $options])
- * Description: Get a specific body section
- * Source code: ext/imap/php_imap.c
- */
-
/*
* Test if FT_UID is set by passing the following as $options argument to imap_fetchbody():
* 1. values that equate to 1
?>
--FILE--
<?php
-/* Prototype : string imap_fetchbody(resource $stream_id, int $msg_no, string $section [, int $options])
- * Description: Get a specific body section
- * Source code: ext/imap/php_imap.c
- */
-
/*
* Pass different integers, strings, msg sequences and msg UIDs as $msg_no argument
* to test behaviour of imap_fetchbody()
?>
--FILE--
<?php
-/* Prototype : string imap_fetchheader(resource $stream_id, int $msg_no [, int $options])
- * Description: Get the full unfiltered header for a message
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_fetchheader() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
?>
--FILE--
<?php
-/* Prototype : string imap_fetchheader(resource $stream_id, int $msg_no [, int $options])
- * Description: Get the full unfiltered header for a message
- * Source code: ext/imap/php_imap.c
- */
-
/*
* Test if FT_UID is set by passing the following as $options argument to imap_fetchheader():
* 1. values that equate to 1
?>
--FILE--
<?php
-/* Prototype : string imap_fetchheader(resource $stream_id, int $msg_no [, int $options])
- * Description: Get the full unfiltered header for a message
- * Source code: ext/imap/php_imap.c
- */
-
/*
* Pass different integers and strings as $msg_no argument
* to test behaviour of imap_fetchheader()
?>
--FILE--
<?php
-/* Prototype : bool imap_mail_copy ( resource $imap_stream , string $msglist , string $mailbox [, int $options = 0 ] )
- * Description: Copies mail messages specified by msglist to specified mailbox.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_mail_copy() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
?>
--FILE--
<?php
-/* Prototype : bool imap_mail_move ( resource $imap_stream , string $msglist , string $mailbox [, int $options = 0 ] )
- * Description: Copies mail messages specified by msglist to specified mailbox.
- * Source code: ext/imap/php_imap.c
- */
-
echo "*** Testing imap_mail_move() : basic functionality ***\n";
require_once(__DIR__.'/imap_include.inc');
?>
--FILE--
<?php
-/* Prototype : int mb_strpos(string $haystack, string $needle [, int $offset [, string $encoding]])
- * Description: Find position of first occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* mb_strpos bounds check is byte count rather than a character count:
* The multibyte string should be returning the same results as the ASCII string.
?>
--FILE--
<?php
-/* Prototype : int mb_strrpos(string $haystack, string $needle [, int $offset [, string $encoding]])
- * Description: Find position of last occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test that mb_strrpos offset is byte count for negative values (should be character count)
*/
?>
--FILE--
<?php
-/* Prototype : int mb_ereg(string $pattern, string $string [, array $registers])
- * Description: Regular expression match for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* mb_ereg 'successfully' matching incorrectly:
* Bug now seems to be fixed - error message is now generated when an 'empty'
?>
--FILE--
<?php
-/* Prototype : string mb_strto[lower|upper](string $sourcestring [, string $encoding])
- * Description: Returns a [lower|upper]cased version of $sourcestring
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Two error messages returned for incorrect encoding for mb_strto[upper|lower]
* Bug now appears to be fixed
?>
--FILE--
<?php
-/* Prototype : string mb_convert_encoding(string $str, string $to_encoding [, mixed $from_encoding])
- * Description: Returns converted string in desired encoding
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_convert_encoding()
*/
?>
--FILE--
<?php
-/* Prototype : string mb_convert_encoding(string $str, string $to_encoding [, mixed $from_encoding])
- * Description: Returns converted string in desired encoding
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_convert_encoding()
*/
?>
--FILE--
<?php
-/* Prototype : string mb_convert_encoding(string $str, string $to_encoding [, mixed $from_encoding])
- * Description: Returns converted string in desired encoding
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_convert_encoding()
*/
?>
--FILE--
<?php
-/* Prototype : string mb_decode_mimeheader(string string)
- * Description: Decodes the MIME "encoded-word" in the string
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_decode_mimeheader() : basic functionality ***\n";
mb_internal_encoding('utf-8');
?>
--FILE--
<?php
-/* Prototype : string mb_decode_mimeheader(string string)
- * Description: Decodes the MIME "encoded-word" in the string
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_decode_mimeheader() : variation ***\n";
mb_internal_encoding('utf-8');
?>
--FILE--
<?php
-/* Prototype : string mb_decode_mimeheader(string string)
- * Description: Decodes the MIME "encoded-word" in the string
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_decode_mimeheader() : variation ***\n";
mb_internal_encoding('iso-8859-7');
?>
--FILE--
<?php
-/* Prototype : string mb_encode_mimeheader
- * (string $str [, string $charset [, string $transfer-encoding [, string $linefeed [, int $indent]]]])
- * Description: Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?=
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_encode_mimeheader with different strings.
* For the below strings:
?>
--FILE--
<?php
-/* Prototype : string mb_encode_mimeheader(string $str [, string $charset
- * [, string $transfer-encoding [, string $linefeed [, int $indent]]]])
- * Description: Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?=
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test mb_encode_header() with different strings
*/
?>
--FILE--
<?php
-/* Prototype : string mb_encode_mimeheader(string $str [, string $charset
- * [, string $transfer-encoding [, string $linefeed [, int $indent]]]])
- * Description: Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?=
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test mb_encode_header() with different strings
*/
?>
--FILE--
<?php
-/* Prototype : string mb_encode_mimeheader
- * (string $str [, string $charset [, string $transfer_encoding [, string $linefeed [, int $indent]]]])
+/* (string $str [, string $charset [, string $transfer_encoding [, string $linefeed [, int $indent]]]])
* Description: Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?=
* Source code: ext/mbstring/mbstring.c
*/
?>
--FILE--
<?php
-/* Prototype : string mb_encode_mimeheader
- * (string $str [, string $charset [, string $transfer_encoding [, string $linefeed [, int $indent]]]])
+/* (string $str [, string $charset [, string $transfer_encoding [, string $linefeed [, int $indent]]]])
* Description: Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?=
* Source code: ext/mbstring/mbstring.c
*/
?>
--FILE--
<?php
-/* Prototype : int mb_ereg(string $pattern, string $string [, array $registers])
- * Description: Regular expression match for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Test basic functionality of mb_ereg
*/
?>
--FILE--
<?php
-/* Prototype : bool mb_ereg_match(string $pattern, string $string [,string $option])
- * Description: Regular expression match for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Test basic functionality of mb_ereg_match
*/
?>
--FILE--
<?php
-/* Prototype : string mb_ereg_replace(string $pattern, string $replacement,
- * string $string [, string o$ption])
- * Description: Replace regular expression for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Test Basic Functionality of mb_ereg_replace()
*/
?>
--FILE--
<?php
-/* Prototype : proto string mb_ereg_replace(string pattern, string replacement, string string [, string option])
- * Description: Replace regular expression for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- * Alias to functions:
- */
-
echo "*** Testing mb_ereg_replace() : usage variations ***\n";
// Initialise function arguments not being substituted (if any)
?>
--FILE--
<?php
-/* Prototype : int mb_ereg(string $pattern, string $string [, array $registers])
- * Description: Regular expression match for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* test that mb_ereg can match correctly when passed different character classes.
*/
?>
--FILE--
<?php
-/* Prototype : int mb_ereg(string $pattern, string $string [, array $registers])
- * Description: Regular expression match for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Test how character classes match a multibyte string
*/
?>
--FILE--
<?php
-/* Prototype : int mb_ereg(string $pattern, string $string [, array $registers])
- * Description: Regular expression match for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Test mb_ereg with anchors (start and end of string) in $pattern
*/
?>
--FILE--
<?php
-/* Prototype : int mb_ereg(string $pattern, string $string [, array $registers])
- * Description: Regular expression match for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Test how mb_ereg() matches special characters for $pattern
*/
?>
--FILE--
<?php
-/* Prototype : int mb_ereg(string $pattern, string $string [, array $registers])
- * Description: Regular expression match for multibyte string
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Testing the following regular expression features match correctly:
* 1. definite quantifiers
?>
--FILE--
<?php
-/* Prototype : string mb_internal_encoding([string $encoding])
- * Description: Sets the current internal encoding or Returns
- * the current internal encoding as a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_internal_encoding
*/
?>
--FILE--
<?php
-/* Prototype : string mb_internal_encoding([string $encoding])
- * Description: Sets the current internal encoding or Returns
- * the current internal encoding as a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_internal_encoding
*/
?>
--FILE--
<?php
-/* Prototype : string mb_internal_encoding([string $encoding])
- * Description: Sets the current internal encoding or
- * Returns the current internal encoding as a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass mb_internal_encoding an unknown encoding
*/
?>
--FILE--
<?php
-/* Prototype : string mb_internal_encoding([string $encoding])
- * Description: Sets the current internal encoding or Returns
- * the current internal encoding as a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test all listed encoding types from php.net to check all are known to function
* NB: The strings passed are *NOT* necessarily encoded in the encoding passed to the function.
?>
--FILE--
<?php
-/* Prototype : proto string mb_regex_encoding([string encoding])
- * Description: Returns the current encoding for regex as a string.
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Test Basic functionality of mb_regex_encoding
*/
?>
--FILE--
<?php
-/* Prototype : string mb_regex_encoding([string $encoding])
- * Description: Returns the current encoding for regex as a string.
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Pass mb_regex_encoding an unknown type of encoding
*/
?>
--FILE--
<?php
-/* Prototype : string mb_regex_encoding([string $encoding])
- * Description: Returns the current encoding for regex as a string.
- * Source code: ext/mbstring/php_mbregex.c
- */
-
/*
* Test all listed encoding types from php.net to check all are known to function
* NB: The strings passed are *NOT* necessarily encoded in the encoding passed to the function.
?>
--FILE--
<?php
-/* Prototype : int mb_stripos(string haystack, string needle [, int offset [, string encoding]])
- * Description: Finds position of first occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
/*
* Test basic functionality of mb_stripos with ASCII and multibyte characters
*/
?>
--FILE--
<?php
-/* Prototype : int mb_stripos(string haystack, string needle [, int offset [, string encoding]])
- * Description: Finds position of first occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
/*
* Test basic functionality of mb_stripos with ASCII and multibyte characters
*/
?>
--FILE--
<?php
-/* Prototype : int mb_stripos(string haystack, string needle [, int offset [, string encoding]])
- * Description: Finds position of first occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
/*
* Pass an unknown encoding to mb_stripos() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : int mb_stripos(string $haystack, string $needle [, int $offset [, string $encoding]])
- * Description: Find position of first occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test how mb_stripos() behaves when passed different integers as $offset argument
* The character length of $string_ascii and $string_mb is the same,
?>
--FILE--
<?php
-/* Prototype : string mb_stristr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds first occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_stristr() : basic functionality ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : string mb_stristr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds first occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_stristr() : error conditions ***\n";
?>
--FILE--
<?php
-/* Prototype : string mb_stristr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds first occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_stristr() : basic functionality ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : int mb_strlen(string $str [, string $encoding])
- * Description: Get character numbers of a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_strlen()
*/
?>
--FILE--
<?php
-/* Prototype : int mb_strlen(string $str [, string $encoding])
- * Description: Get character numbers of a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test mb_strlen when passed an unknown encoding
*/
?>
--FILE--
<?php
-/* Prototype : int mb_strlen(string $str [, string $encoding])
- * Description: Get character numbers of a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass all encodings listed on php.net to mb_strlen to test that function recognises them
* NB: The strings passed are *NOT* necessarily encoded in the encoding passed to the function.
?>
--FILE--
<?php
-/* Prototype : int mb_strpos(string $haystack, string $needle [, int $offset [, string $encoding]])
- * Description: Find position of first occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_strpos with ASCII and multibyte characters
*/
?>
--FILE--
<?php
-/* Prototype : int mb_strpos(string $haystack, string $needle [, int $offset [, string $encoding]])
- * Description: Find position of first occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass an unknown encoding to mb_strpos() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : int mb_strpos(string $haystack, string $needle [, int $offset [, string $encoding]])
- * Description: Find position of first occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test how mb_strpos() behaves when passed different integers as $offset argument
* The character length of $string_ascii and $string_mb is the same,
?>
--FILE--
<?php
-/* Prototype : string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds the last occurrence of a character in a string within another
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strrchr() : basic functionality ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds the last occurrence of a character in a string within another
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strrchr() : error conditions ***\n";
?>
--FILE--
<?php
-/* Prototype : string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds the last occurrence of a character in a string within another
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strrchr() : variation ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds the last occurrence of a character in a string within another
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strrchr() : variation ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : string mb_strrichr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds the last occurrence of a character in a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strrichr() : basic functionality ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : string mb_strrichr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds the last occurrence of a character in a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strrichr() : error conditions ***\n";
?>
--FILE--
<?php
-/* Prototype : string mb_strrichr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds the last occurrence of a character in a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strrichr() : basic functionality ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : int mb_strripos(string haystack, string needle [, int offset [, string encoding]])
- * Description: Finds position of last occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
/*
* Test basic functionality of mb_strripos with ASCII and multibyte characters
*/
?>
--FILE--
<?php
-/* Prototype : int mb_strripos(string haystack, string needle [, int offset [, string encoding]])
- * Description: Finds position of last occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
/*
* Test basic functionality of mb_strripos with ASCII and multibyte characters
*/
?>
--FILE--
<?php
-/* Prototype : int mb_strripos(string haystack, string needle [, int offset [, string encoding]])
- * Description: Finds position of last occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
/*
* Pass an unknown encoding to mb_strripos() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : int mb_strripos(string haystack, string needle [, int offset [, string encoding]])
- * Description: Finds position of last occurrence of a string within another, case insensitive
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
/*
* Test how mb_strripos() behaves when passed different integers as $offset argument
* The character length of $string_ascii and $string_mb is the same,
?>
--FILE--
<?php
-/* Prototype : int mb_strrpos(string $haystack, string $needle [, int $offset [, string $encoding]])
- * Description: Find position of last occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_strrpos()
*/
?>
--FILE--
<?php
-/* Prototype : int mb_strrpos(string $haystack, string $needle [, int $offset [, string $encoding]])
- * Description: Find position of last occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass mb_strrpos() an encoding that doesn't exist
*/
?>
--FILE--
<?php
-/* Prototype : string mb_strstr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds first occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strstr() : basic functionality ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : string mb_strstr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds first occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strstr() : error conditions ***\n";
?>
--FILE--
<?php
-/* Prototype : string mb_strstr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds first occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strstr() : variation ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : string mb_strstr(string haystack, string needle[, bool part[, string encoding]])
- * Description: Finds first occurrence of a string within another
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_strstr() : variation ***\n";
mb_internal_encoding('UTF-8');
?>
--FILE--
<?php
-/* Prototype : string mb_strtolower(string $sourcestring [, string $encoding])
- * Description: Returns a lowercased version of $sourcestring
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_strtolower
*/
?>
--FILE--
<?php
-/* Prototype : string mb_strtolower(string $sourcestring [, string $encoding])
- * Description: Returns a lowercased version of $sourcestring
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass an unknown encoding to mb_strtolower() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : string mb_strtolower(string $sourcestring [, string $encoding])
- * Description: Returns a lowercased version of $sourcestring
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass a Japanese string and a mixed Japanese and ASCII string to mb_strtolower
* to check correct conversion is occurring (Japanese characters should not be converted).
?>
--FILE--
<?php
-/* Prototype : string mb_strtolower(string $sourcestring [, string $encoding])
- * Description: Returns a lowercased version of $sourcestring
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass accented characters and Russian characters to check case conversion is correct
*/
?>
--FILE--
<?php
-/* Prototype : string mb_strtoupper(string $sourcestring [, string $encoding]
- * Description: Returns a uppercased version of $sourcestring
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test basic functionality of mb_strtoupper
*/
?>
--FILE--
<?php
-/* Prototype : string mb_strtoupper(string $sourcestring [, string $encoding]
- * Description: Returns a uppercased version of $sourcestring
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass an unknown encoding as $encoding argument to check behaviour of mbstrtoupper()
*/
?>
--FILE--
<?php
-/* Prototype : string mb_strtoupper(string $sourcestring [, string $encoding]
- * Description: Returns a uppercased version of $sourcestring
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass a Japanese string and a mixed Japanese and ASCII string to mb_strtolower
* to check correct conversion is occurring (Japanese characters should not be converted).
?>
--FILE--
<?php
-/* Prototype : string mb_strtoupper(string $sourcestring [, string $encoding]
- * Description: Returns a uppercased version of $sourcestring
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass characters from different languages to check that mb_strtoupper is
* doing a correct case conversion
?>
--FILE--
<?php
-/* Prototype : mixed mb_substitute_character([mixed substchar])
- * Description: Sets the current substitute_character or returns the current substitute_character
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_substitute_character() : basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype : mixed mb_substitute_character([mixed substchar])
- * Description: Sets the current substitute_character or returns the current substitute_character
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_substitute_character() : variation ***\n";
//japenese utf-8
$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI');
--FILE--
<?php
declare(strict_types=1);
-/* Prototype : string|int|true mb_substitute_character([string|int|null substitute_character])
- * Description: Sets the current substitute_character or returns the current substitute_character
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
echo "*** Testing mb_substitute_character(): various types in strict typing mode ***\n";
?>
--FILE--
<?php
-/* Prototype : string|int|true mb_substitute_character([string|int|null substitute_character])
- * Description: Sets the current substitute_character or returns the current substitute_character
- * Source code: ext/mbstring/mbstring.c
- * Alias to functions:
- */
-
echo "*** Testing mb_substitute_character(): various types in weak typing mode ***\n";
// Initialise function arguments not being substituted (if any)
internal_encoding=ISO-8859-1
--FILE--
<?php
-/* Prototype : string mb_substr(string $str, int $start [, int $length [, string $encoding]])
- * Description: Returns part of a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test Basic Functionality of mb_substr with ASCII characters and multibyte strings.
*/
?>
--FILE--
<?php
-/* Prototype : int mb_substr_count(string $haystack, string $needle [, string $encoding])
- * Description: Count the number of substring occurrences
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test Basic functionality of mb_substr_count
*/
?>
--FILE--
<?php
-/* Prototype : int mb_substr_count(string $haystack, string $needle [, string $encoding])
- * Description: Count the number of substring occurrences
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test behaviour of mb_substr_count() function when passed an unknown encoding
*/
?>
--FILE--
<?php
-/* Prototype : int mb_substr_count(string $haystack, string $needle [, string $encoding])
- * Description: Count the number of substring occurrences
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass mb_substr_count() a $needle that overlaps in $haystack and see whether
* it counts only the first occurrence or all other occurrences regardless whether they
?>
--FILE--
<?php
-/* Prototype : string mb_substr(string $str, int $start [, int $length [, string $encoding]])
- * Description: Returns part of a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Pass an unknown encoding to mb_substr() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : string mb_substr(string $str, int $start [, int $length [, string $encoding]])
- * Description: Returns part of a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test how mb_substr() behaves when passed a range of integers as $start argument
*/
?>
--FILE--
<?php
-/* Prototype : string mb_substr(string $str, int $start [, int $length [, string $encoding]])
- * Description: Returns part of a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test how mb_substr() behaves when passed a range of integers as $length argument
*/
?>
--FILE--
<?php
-/* Prototype : string mb_substr(string $str, int $start [, int $length [, string $encoding]])
- * Description: Returns part of a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test how mb_substr() behaves when passed a range of integers as $start argument
*/
?>
--FILE--
<?php
-/* Prototype : string mb_substr(string $str, int $start [, int $length [, string $encoding]])
- * Description: Returns part of a string
- * Source code: ext/mbstring/mbstring.c
- */
-
/*
* Test how mb_substr() behaves when passed a range of integers as $length argument
*/
--FILE--
<?php
require_once("connect.inc");
- /* {{{ proto bool mysqli_begin_transaction(object link, [int flags [, string name]]) */
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[004] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
--FILE--
<?php
require_once("connect.inc");
- /* {{{ proto bool mysqli_release_savepoint(object link, string name) */
$tmp = NULL;
$link = NULL;
--FILE--
<?php
require_once("connect.inc");
- /* {{{ proto bool mysqli_savepoint(object link, string name) */
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[003] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
--FILE--
<?php
/*
-* proto array preg_grep(string regex, array input [, int flags])
* Function is implemented in ext/pcre/php_pcre.c
*/
$array = array('HTTP://WWW.EXAMPLE.COM', '/index.html', '/info/stat/', 'http://test.uk.com/index/html', '/display/dept.php');
--FILE--
<?php
/*
-* proto array preg_grep(string regex, array input [, int flags])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
--FILE--
<?php
/*
-* proto int preg_match_all(string pattern, string subject, [array subpatterns [, int flags [, int offset]]])
* Function is implemented in ext/pcre/php_pcre.c
*/
$string = 'Hello, world! This is a test. This is another test. \[4]. 34534 string.';
Test preg_match_all() function : basic functionality
--FILE--
<?php
-/* Prototype : proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]])
- * Description: Perform a Perl-style global regular expression match
- * Source code: ext/pcre/php_pcre.c
- * Alias to functions:
-*/
-
$string = 'Hello, world! This is a test. This is another test. \[4]. 34534 string.';
var_dump(preg_match_all('/[0-35-9]/', $string, $match1, PREG_OFFSET_CAPTURE|PREG_PATTERN_ORDER, -10)); //finds any digit that's not 4 10 digits from the end(1 match)
--FILE--
<?php
/*
-* proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
--FILE--
<?php
/*
-* proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
--FILE--
<?php
/*
-* proto int preg_match_all(string pattern, string subject, array subpatterns [, int flags [, int offset]])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
Test preg_match() function : basic functionality
--FILE--
<?php
-/*
- * proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
- * Function is implemented in ext/pcre/php_pcre.c
-*/
+/* Function is implemented in ext/pcre/php_pcre.c */
$string = 'Hello, world. [*], this is \ a string';
var_dump(preg_match('/^[hH]ello,\s/', $string, $match1)); //finds "Hello, "
var_dump($match1);
preg_match() single line match with multi-line input
--FILE--
<?php
-/* Prototype : int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags [, int $offset ]]] )
- * Description: Perform a regular expression match
- * Source code: ext/pcre/php_pcre.c
- */
-
$string = "My\nName\nIs\nStrange";
preg_match("/M(.*)/", $string, $matches);
Test preg_match() function : basic functionality
--FILE--
<?php
-/* Prototype : proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
- * Description: Perform a Perl-style regular expression match
- * Source code: ext/pcre/php_pcre.c
- * Alias to functions:
-*/
-
-
$string = 'Hello, world. [*], this is \ a string';
var_dump(preg_match('/^[hH]ello,\s/', $string, $match1)); //finds "Hello, "
Test preg_match() function : error conditions - bad regular expressions
--FILE--
<?php
-/*
- * proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
- * Function is implemented in ext/pcre/php_pcre.c
-*/
+/* Function is implemented in ext/pcre/php_pcre.c */
/*
* Testing how preg_match reacts to being passed the wrong type of regex argument
*/
Test preg_match() function : error conditions - wrong arg types
--FILE--
<?php
-/*
- * proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
- * Function is implemented in ext/pcre/php_pcre.c
-*/
+/* Function is implemented in ext/pcre/php_pcre.c */
/*
* Testing how preg_match reacts to being passed the wrong type of subject argument
*/
preg_match() single line match with latin input
--FILE--
<?php
-/* Prototype : int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags [, int $offset ]]] )
- * Description: Perform a regular expression match
- * Source code: ext/pcre/php_pcre.c
- */
-
preg_match('/^[\w\p{Cyrillic}\s\-\']+$/u', 'latin', $test1);
preg_match('/^[\w\p{Cyrillic}\s\-\']+$/u', 'кириллица', $test2);
preg_match('/^[\w\s\-\']+$/u', 'latin', $test3);
Test preg_match() function : variation
--FILE--
<?php
-/*
- * proto int preg_match(string pattern, string subject [, array subpatterns [, int flags [, int offset]]])
- * Function is implemented in ext/pcre/php_pcre.c
-*/
+/* Function is implemented in ext/pcre/php_pcre.c */
//test passing in the same variable where 1 is by value, the other is a different
//type and by reference so should be updated to the new type.
--FILE--
<?php
/*
-* proto string preg_quote(string str [, string delim_char])
* Function is implemented in ext/pcre/php_pcre.c
*/
$string_before = '/this *-has \ metacharacters^ in $';
--FILE--
<?php
/*
-* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
$string = '123456789 - Hello, world - This is a string.';
--FILE--
<?php
/*
-* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
--FILE--
<?php
/*
-* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
Test preg_replace() function : basic
--FILE--
<?php
-/* Prototype : proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
- * Description: Perform Perl-style regular expression replacement.
- * Source code: ext/pcre/php_pcre.c
- * Alias to functions:
-*/
-
$string = '123456789 - Hello, world - This is a string.';
var_dump($string);
--FILE--
<?php
/*
-* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
--FILE--
<?php
/*
-* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
--FILE--
<?php
/*
-* proto string preg_replace(mixed regex, mixed replace, mixed subject [, int limit [, count]])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
--FILE--
<?php
/*
-* proto array preg_split(string pattern, string subject [, int limit [, int flags]])
* Function is implemented in ext/pcre/php_pcre.c
*/
$string = 'this is a_list: value1, Test__, string; Hello, world!_(parentheses)';
--FILE--
<?php
/*
-* proto array preg_split(string pattern, string subject [, int limit [, int flags]])
* Function is implemented in ext/pcre/php_pcre.c
*/
/*
?>
--FILE--
<?php
-/* Prototype : proto array posix_getgrgid(long gid)
- * Description: Group database access (POSIX.1, 9.2.1)
- * Source code: ext/posix/posix.c
- * Alias to functions:
- */
-
echo "*** Testing posix_getgrgid() : error conditions ***\n";
echo "\n-- Testing posix_getgrgid() function with a negative group id --\n";
?>
--FILE--
<?php
-/* Prototype : proto int posix_getpgid(void)
- * Description: Get the process group id of the specified process (This is not a POSIX function, but a SVR4ism, so we compile conditionally)
- * Source code: ext/posix/posix.c
- * Alias to functions:
- */
-
echo "*** Testing posix_getpgid() : error conditions ***\n";
echo "\n-- Testing posix_getpgid() with negative pid --\n";
?>
--FILE--
<?php
-/* Prototype : proto array posix_getpwuid(long uid)
- * Description: User database access (POSIX.1, 9.2.2)
- * Source code: ext/posix/posix.c
- * Alias to functions:
- */
-
echo "*** Testing posix_getpwuid() : error conditions ***\n";
echo "\n-- Testing posix_getpwuid() function negative uid --\n";
?>
--FILE--
<?php
-/* Prototype : proto bool posix_kill(int pid, int sig)
- * Description: Send a signal to a process (POSIX.1, 3.3.2)
- * Source code: ext/posix/posix.c
- * Alias to functions:
- */
-
-
echo "*** Testing posix_kill() : error conditions ***\n";
?>
--FILE--
<?php
-/* Prototype : proto string posix_strerror(int errno)
- * Description: Retrieve the system error message associated with the given errno.
- * Source code: ext/posix/posix.c
- * Alias to functions:
- */
-
echo "*** Testing posix_strerror() : error conditions ***\n";
echo "\n-- Testing posix_strerror() function with invalid error number --\n";
Test ReflectionFunction::getClosure() function : basic functionality
--FILE--
<?php
-/* Prototype : public mixed ReflectionFunction::getClosure()
- * Description: Returns a dynamically created closure for the function
- * Source code: ext/reflection/php_reflection.c
- * Alias to functions:
- */
-
echo "*** Testing ReflectionFunction::getClosure() : basic functionality ***\n";
function foo()
Test ReflectionMethod::getClosure() function : basic functionality
--FILE--
<?php
-/* Prototype : public mixed ReflectionFunction::getClosure()
- * Description: Returns a dynamically created closure for the method
- * Source code: ext/reflection/php_reflection.c
- * Alias to functions:
- */
-
echo "*** Testing ReflectionMethod::getClosure() : basic functionality ***\n";
class StaticExample
Test ReflectionMethod::getClosure() function : error functionality
--FILE--
<?php
-/* Prototype : public mixed ReflectionFunction::getClosure()
- * Description: Returns a dynamically created closure for the method
- * Source code: ext/reflection/php_reflection.c
- * Alias to functions:
- */
-
echo "*** Testing ReflectionMethod::getClosure() : error conditions ***\n";
class StaticExample
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Test session_set_save_handler() : session_gc() returns the number of deleted records. ***\n";
class MySession implements SessionHandlerInterface {
ob_start();
-/*
- * Prototype : void session_abort(void)
- * Description : Should abort session. Session data should not be written.
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_abort() : basic functionality ***\n";
session_start();
ob_start();
-/*
- * Prototype : session.use_strict_mode=0
- * Description : Test basic functionality.
- * Source code : ext/session/session.c, ext/session/mod_files.c
- */
-
echo "*** Testing basic session functionality : variation1 ***\n";
$session_id = 'testid';
ob_start();
-/*
- * Prototype : session.use_strict_mode=1
- * Description : Test basic functionality.
- * Source code : ext/session/session.c, ext/session/mod_files.c
- */
-
echo "*** Testing basic session functionality : variation2 ***\n";
$session_id = 'testid';
ob_start();
-/*
- * Prototype : session.use_trans_sid=1
- * Description : Test basic functionality.
- * Source code : ext/session/session.c
- */
-
echo "*** Testing basic session functionality : variation3 use_trans_sid ***\n";
/*
ob_start();
-/*
- * Prototype : session.use_trans_sid=1
- * Description : Test basic functionality.
- * Source code : ext/session/session.c
- */
-
echo "*** Testing basic session functionality : variation4 use_trans_sid ***\n";
echo "*** Test trans sid ***\n";
$_SERVER['HTTP_HOST'] = 'php.net';
ini_set('session.trans_sid_hosts','php.net,example.com');
-/*
- * Prototype : session.use_trans_sid=1
- * Description : Test basic functionality.
- * Source code : ext/session/session.c
- */
-
echo "*** Testing basic session functionality : variation5 use_trans_sid ***\n";
echo "*** Test trans sid ***\n";
ob_start();
-/*
- * Prototype : int session_cache_expire([int $new_cache_expire])
- * Description : Return current cache expire
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_cache_expire() : basic functionality ***\n";
var_dump(session_cache_expire());
ob_start();
-/*
- * Prototype : int session_cache_expire([int $new_cache_expire])
- * Description : Return current cache expire
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_cache_expire() : variation ***\n";
var_dump(session_cache_expire());
ob_start();
-/*
- * Prototype : int session_cache_expire([int $new_cache_expire])
- * Description : Return current cache expire
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_cache_expire() : variation ***\n";
ini_set("session.cache_expire", 360);
ob_start();
-/*
- * Prototype : int session_cache_expire([int $new_cache_expire])
- * Description : Return current cache expire
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_cache_expire() : variation ***\n";
var_dump(ini_get("session.cache_expire"));
ob_start();
-/*
- * Prototype : string session_cache_limiter([string $cache_limiter])
- * Description : Get and/or set the current cache limiter
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_cache_limiter() : basic functionality ***\n";
var_dump(session_cache_limiter());
ob_start();
-/*
- * Prototype : string session_cache_limiter([string $cache_limiter])
- * Description : Get and/or set the current cache limiter
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_cache_limiter() : variation ***\n";
var_dump(session_cache_limiter());
bool(true)
string(7) "nocache"
-Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 16
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line %d
bool(false)
string(7) "nocache"
bool(true)
ob_start();
-/*
- * Prototype : string session_cache_limiter([string $cache_limiter])
- * Description : Get and/or set the current cache limiter
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_cache_limiter() : variation ***\n";
ini_set("session.cache_limiter", "nocache");
bool(true)
string(7) "nocache"
-Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 17
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line %d
bool(false)
string(7) "nocache"
bool(true)
ob_start();
-/*
- * Prototype : string session_cache_limiter([string $cache_limiter])
- * Description : Get and/or set the current cache limiter
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_cache_limiter() : variation ***\n";
var_dump(ini_get("session.cache_limiter"));
bool(true)
string(7) "nocache"
-Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line 16
+Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line %d
bool(false)
string(7) "nocache"
bool(true)
ob_start();
-/*
- * Prototype : bool session_commit(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_commit() : basic functionality ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_commit(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_commit() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_commit(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_commit() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_commit(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_commit() : variation ***\n";
var_dump($_SESSION);
ob_start();
-/*
- * Prototype : bool session_commit(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_commit() : variation ***\n";
var_dump(ini_get('session.use_strict_mode'));
ob_start();
-/*
- * Prototype : bool session_commit(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_commit() : variation ***\n";
$id = md5(uniqid());
ob_start();
-/*
- * Prototype : string session_create_id([string $prefix])
- * Description : Create new session ID with prefix optionally.
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_create_id() : basic functionality ***\n";
// No session
ob_start();
-/*
- * Prototype : string session_decode(void)
- * Description : Decodes session data from a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_decode() : basic functionality ***\n";
// Get an unset variable
ob_start();
-/*
- * Prototype : string session_decode(void)
- * Description : Decodes session data from a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_decode() : basic functionality ***\n";
// Get an unset variable
ob_start();
-/*
- * Prototype : string session_decode(void)
- * Description : Decodes session data from a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_decode() : error functionality ***\n";
$data = "foo|a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}guff|R:1;blah|R:1;";
ob_start();
-/*
- * Prototype : string session_decode(void)
- * Description : Decodes session data from a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_decode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_decode(void)
- * Description : Decodes session data from a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_decode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_decode(void)
- * Description : Decodes session data from a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_decode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_decode(void)
- * Description : Decodes session data from a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_decode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_destroy(void)
- * Description : Destroys all data registered to a session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_destroy() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_destroy(void)
- * Description : Destroys all data registered to a session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_destroy() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_destroy(void)
- * Description : Destroys all data registered to a session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_destroy() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : basic functionality ***\n";
// Get an unset variable
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : error functionality ***\n";
// Get an unset variable
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : variation ***\n";
var_dump(session_encode());
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : variation ***\n";
var_dump(session_encode());
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_encode(void)
- * Description : Encodes the current session data as a string
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_encode() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : int session_gc(void)
- * Description : Perform GC
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_gc() : basic functionality ***\n";
var_dump(session_gc());
ob_start();
-/*
- * Prototype : array session_get_cookie_params(void)
- * Description : Get the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_get_cookie_params() : basic functionality ***\n";
var_dump(session_get_cookie_params());
ob_start();
-/*
- * Prototype : array session_get_cookie_params(void)
- * Description : Get the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_get_cookie_params() : variation ***\n";
var_dump(session_get_cookie_params());
ob_start();
-/*
- * Prototype : string session_id([string $id])
- * Description : Get and/or set the current session id
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_id() : basic functionality ***\n";
var_dump(session_id());
ob_start();
-/*
- * Prototype : string session_id([string $id])
- * Description : Get and/or set the current session id
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_id() : basic functionality ***\n";
ini_set('session.sid_bits_per_chracter', 6);
ob_start();
-/*
- * Prototype : string session_id([string $id])
- * Description : Get and/or set the current session id
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_id() : error functionality ***\n";
var_dump(session_id("test"));
ob_start();
-/*
- * Prototype : string session_id([string $id])
- * Description : Get and/or set the current session id
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_id() : error functionality ***\n";
var_dump(session_id());
ob_start();
-/*
- * Prototype : string session_module_name([string $module])
- * Description : Get and/or set the current session module
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_module_name() : basic functionality ***\n";
var_dump(session_module_name("files"));
var_dump(session_module_name());
ob_start();
-/*
- * Prototype : string session_module_name([string $module])
- * Description : Get and/or set the current session module
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_module_name() : variation ***\n";
var_dump(session_module_name("blah"));
var_dump(session_start());
ob_start();
-/*
- * Prototype : string session_module_name([string $module])
- * Description : Get and/or set the current session module
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_module_name() : variation ***\n";
function open($save_path, $session_name) { }
ob_start();
-/*
- * Prototype : string session_module_name([string $module])
- * Description : Get and/or set the current session module
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_module_name() : variation ***\n";
function open($save_path, $session_name) {
throw new Exception("Stop...!");
string(5) "files"
string(4) "user"
-Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line 25
+Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d
-Fatal error: Uncaught Exception: Stop...! in %s:13
+Fatal error: Uncaught Exception: Stop...! in %s:%d
Stack trace:
#0 [internal function]: open('', 'PHPSESSID')
-#1 %s(25): session_start()
+#1 %s(%d): session_start()
#2 {main}
- thrown in %s on line 13
+ thrown in %s on line %d
ob_start();
-/*
- * Prototype : string session_module_name([string $module])
- * Description : Get and/or set the current session module
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_module_name() : variation ***\n";
require_once "save_handler.inc";
ob_start();
-/*
- * Prototype : string session_name([string $name])
- * Description : Get and/or set the current session name
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_name() : error functionality ***\n";
var_dump(session_name());
ob_start();
-/*
- * Prototype : string session_name([string $name])
- * Description : Get and/or set the current session name
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_name() : variation ***\n";
var_dump(session_name("\0"));
ob_start();
-/*
- * Prototype : string session_name([string $name])
- * Description : Get and/or set the current session name
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_name() : variation ***\n";
var_dump(session_name());
ob_start();
-/*
- * Prototype : bool session_regenerate_id([bool $delete_old_session])
- * Description : Update the current session id with a newly generated one
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_regenerate_id() : basic functionality ***\n";
var_dump(session_id());
--FILE--
<?php
-/*
- * Prototype : bool session_regenerate_id([bool $delete_old_session])
- * Description : Update the current session id with a newly generated one
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_regenerate_id() : basic functionality for cookie ***\n";
require __DIR__.'/../../../sapi/cgi/tests/include.inc';
ob_start();
-/*
- * Prototype : bool session_regenerate_id([bool $delete_old_session])
- * Description : Update the current session id with a newly generated one
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_regenerate_id() : variation ***\n";
var_dump(session_id());
ob_start();
-/*
- * Prototype : void session_reset(void)
- * Description : Should abort session. Session data should not be written.
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_abort() : basic functionality ***\n";
session_start();
ob_start();
-/*
- * Prototype : string session_save_path([string $path])
- * Description : Get and/or set the current session save path
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_save_path() : error functionality ***\n";
$directory = __DIR__;
ob_start();
-/*
- * Prototype : string session_save_path([string $path])
- * Description : Get and/or set the current session save path
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_save_path() : variation ***\n";
$directory = __DIR__;
bool(true)
string(%d) "%stests"
-Warning: session_save_path(): Cannot change save path when session is active in %s on line 20
+Warning: session_save_path(): Cannot change save path when session is active in %s on line %d
bool(false)
string(%d) "%stests"
bool(true)
ob_start();
-/*
- * Prototype : string session_save_path([string $path])
- * Description : Get and/or set the current session save path
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_save_path() : variation ***\n";
ini_set("session.save_path", "/blah");
ob_start();
-/*
- * Prototype : string session_save_path([string $path])
- * Description : Get and/or set the current session save path
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_save_path() : variation ***\n";
ini_set("session.save_path", "/blah");
ob_start();
-/*
- * Prototype : string session_save_path([string $path])
- * Description : Get and/or set the current session save path
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_save_path() : variation ***\n";
$initdir = __DIR__;
$sessions = ($initdir."/sessions");
bool(true)
bool(true)
-Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line 24
+Warning: ini_set(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
string(0) ""
-Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line 26
+Warning: session_start(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d
-Warning: session_start(): Failed to initialize storage module: files (path: ) in %s on line 26
+Warning: session_start(): Failed to initialize storage module: files (path: ) in %s on line %d
bool(false)
string(0) ""
-Warning: session_destroy(): Trying to destroy uninitialized session in %s on line 28
+Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d
bool(false)
string(0) ""
Done
<?php
ob_start();
-/*
- * Prototype : string session_save_path([string $path])
- * Description : Get and/or set the current session save path
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_save_path() : variation ***\n";
$directory = __DIR__;
$sessions = ($directory."/sessions");
ob_start();
-/*
- * Prototype : void session_set_cookie_params(int $lifetime [, string $path [, string $domain [, bool $secure [, bool $httponly]]]])
- * Description : Set the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_cookie_params() : basic functionality ***\n";
var_dump(session_set_cookie_params(3600));
bool(true)
bool(true)
-Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 15
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d
bool(false)
bool(true)
bool(true)
ob_start();
-/*
- * Prototype : void session_set_cookie_params(int $lifetime [, string $path [, string $domain [, bool $secure [, bool $httponly]]]])
- * Description : Set the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_cookie_params() : variation ***\n";
var_dump(ini_get("session.cookie_lifetime"));
bool(true)
string(4) "3600"
-Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 19
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d
bool(false)
string(4) "3600"
bool(true)
ob_start();
-/*
- * Prototype : void session_set_cookie_params(int $lifetime [, string $path [, string $domain [, bool $secure [, bool $httponly]]]])
- * Description : Set the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_cookie_params() : variation ***\n";
var_dump(ini_get("session.cookie_path"));
bool(true)
string(4) "/foo"
-Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 18
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d
bool(false)
string(4) "/foo"
bool(true)
ob_start();
-/*
- * Prototype : void session_set_cookie_params(int $lifetime [, string $path [, string $domain [, bool $secure [, bool $httponly]]]])
- * Description : Set the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_cookie_params() : variation ***\n";
var_dump(ini_get("session.cookie_domain"));
bool(true)
string(4) "blah"
-Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 18
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d
bool(false)
string(4) "blah"
bool(true)
ob_start();
-/*
- * Prototype : void session_set_cookie_params(int $lifetime [, string $path [, string $domain [, bool $secure [, bool $httponly]]]])
- * Description : Set the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_cookie_params() : variation ***\n";
var_dump(ini_get("session.cookie_secure"));
bool(true)
string(1) "0"
-Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 18
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d
bool(false)
string(1) "0"
bool(true)
ob_start();
-/*
- * Prototype : void session_set_cookie_params(int $lifetime [, string $path [, string $domain [, bool $secure [, bool $httponly]]]])
- * Description : Set the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_cookie_params() : variation ***\n";
var_dump(ini_get("session.cookie_httponly"));
bool(true)
string(1) "0"
-Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 18
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d
bool(false)
string(1) "0"
bool(true)
ob_start();
-/*
- * Prototype : void session_set_cookie_params(array $options)
- * Description : Set the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_cookie_params() : variation ***\n";
var_dump(ini_get("session.cookie_samesite"));
bool(true)
string(7) "nothing"
-Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line 18
+Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d
bool(false)
string(7) "nothing"
bool(true)
ob_start();
-/*
- * Prototype : void session_set_cookie_params(array $options)
- * Description : Set the session cookie parameters
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_cookie_params() : array parameter variation ***\n";
// Invalid cases
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : basic functionality ***\n";
require_once "save_handler.inc";
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : basic class wrapping existing handler ***\n";
class MySession extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : full handler implementation ***\n";
class MySession2 extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : inheritance ***\n";
class MySession3 extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : default object ***\n";
session_set_save_handler(new SessionHandler);
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : incomplete implementation ***\n";
class MySession6 extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : using objects in close ***\n";
class MySession7_Foo {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : manual shutdown, reopen ***\n";
class MySession extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : manual shutdown ***\n";
class MySession extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : implicit shutdown ***\n";
class MySession extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : manual shutdown function ***\n";
class MySession extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : shutdown failure ***\n";
class MySession extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : incorrect arguments for existing handler open ***\n";
class MySession extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : incorrect arguments for existing handler close ***\n";
class MySession extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : calling default handler when save_handler=user ***\n";
$oldHandler = ini_get('session.save_handler');
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : register session handler but don't start ***\n";
session_set_save_handler(new SessionHandler);
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandlerInterface $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() function: class with create_sid ***\n";
class MySession2 extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandlerInterface $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() function: class with create_sid ***\n";
class MySession2 extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandlerInterface $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() function: class with validate_sid ***\n";
class MySession2 extends SessionHandler {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : using closures as callbacks ***\n";
require_once "save_handler_closures.inc";
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : error functionality ***\n";
// Get an unset variable
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : error functionality ***\n";
function open($save_path, $session_name) { return true; }
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : error functionality ***\n";
function open($save_path, $session_name) {
throw new Exception("Do something bad..!");
--EXPECTF--
*** Testing session_set_save_handler() : error functionality ***
-Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line 23
+Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d
-Fatal error: Uncaught Exception: Do something bad..! in %s:13
+Fatal error: Uncaught Exception: Do something bad..! in %s:%d
Stack trace:
#0 [internal function]: open('', 'PHPSESSID')
-#1 %s(23): session_start()
+#1 %s(%d): session_start()
#2 {main}
- thrown in %s on line 13
+ thrown in %s on line %d
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : error functionality ***\n";
function callback() { return true; }
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandlerInterface $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() function: interface ***\n";
class MySession2 implements SessionHandlerInterface {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandlerInterface $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() function: interface wrong ***\n";
interface MySessionHandlerInterface {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(SessionHandlerInterface $handler [, bool $register_shutdown_function = true])
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() function: id interface ***\n";
class MySession2 implements SessionHandlerInterface, SessionIdInterface {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : variation ***\n";
var_dump(session_module_name());
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : variation ***\n";
require_once "save_handler.inc";
*** Testing session_set_save_handler() : variation ***
bool(true)
-Warning: session_set_save_handler(): Cannot change save handler when session is active in %s on line 17
+Warning: session_set_save_handler(): Cannot change save handler when session is active in %s on line %d
bool(false)
bool(true)
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : variation ***\n";
require_once "save_handler.inc";
*** Testing session_set_save_handler() : variation ***
int(2)
-Warning: session_save_path(): Cannot change save path when session is active in %s on line 16
+Warning: session_save_path(): Cannot change save path when session is active in %s on line %d
-Warning: session_set_save_handler(): Cannot change save handler when session is active in %s on line 17
+Warning: session_set_save_handler(): Cannot change save handler when session is active in %s on line %d
bool(false)
bool(true)
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : variation ***\n";
function noisy_gc($maxlifetime) {
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions with validate_id() and update()
- * Source code : ext/session/session.c
- */
-
function noisy_gc($maxlifetime) {
echo("GC [".$maxlifetime."]\n");
echo gc($maxlifetime)." deleted\n";
ob_start();
-/*
- * Prototype : bool session_set_save_handler(callback $open, callback $close, callback $read, callback $write, callback $destroy, callback $gc)
- * Description : Sets user-level session storage functions
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_set_save_handler() : test write short circuit ***\n";
require_once "save_handler.inc";
ob_start();
-/*
- * Prototype : bool session_start(void)
- * Description : Initialize session data
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_start() : variation ***\n";
var_dump(session_start());
*** Testing session_start() : variation ***
bool(true)
-Notice: session_start(): A session had already been started - ignoring in %s on line 14
+Notice: session_start(): A session had already been started - ignoring in %s on line %d
bool(true)
-Notice: session_start(): A session had already been started - ignoring in %s on line 15
+Notice: session_start(): A session had already been started - ignoring in %s on line %d
bool(true)
-Notice: session_start(): A session had already been started - ignoring in %s on line 16
+Notice: session_start(): A session had already been started - ignoring in %s on line %d
bool(true)
-Notice: session_start(): A session had already been started - ignoring in %s on line 17
+Notice: session_start(): A session had already been started - ignoring in %s on line %d
bool(true)
Done
ob_start();
-/*
- * Prototype : bool session_start(void)
- * Description : Initialize session data
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_start() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_start(void)
- * Description : Initialize session data
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_start() : variation ***\n";
var_dump(session_start());
bool(true)
bool(true)
-Warning: session_destroy(): Trying to destroy uninitialized session in %s on line 23
+Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d
bool(false)
Done
ob_start();
-/*
- * Prototype : bool session_start(void)
- * Description : Initialize session data
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_start() : variation ***\n";
$_SESSION['blah'] = 'foo';
ob_start();
-/*
- * Prototype : bool session_start(void)
- * Description : Initialize session data
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_start() : variation ***\n";
session_start();
ob_start();
-/*
- * Prototype : bool session_start(void)
- * Description : Initialize session data
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_start() : variation ***\n";
session_start();
ob_start();
-/*
- * Prototype : bool session_start(void)
- * Description : Initialize session data
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_start() : variation ***\n";
session_start();
ob_start();
-/*
- * Prototype : bool session_start(void)
- * Description : Initialize session data
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_start() : variation ***\n";
var_dump(session_id());
ob_start();
-/*
- * Prototype : bool session_start(void)
- * Description : Initialize session data
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_start() : variation ***\n";
var_dump(session_id());
*** Testing session_start() : variation ***
string(%d) "%s"
-Notice: session_start(): A session had already been started - ignoring in %s on line 14
+Notice: session_start(): A session had already been started - ignoring in %s on line %d
bool(true)
string(%d) "%s"
bool(true)
ob_start();
-/*
- * Prototype : void session_unset(void)
- * Description : Free all session variables
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_unset() : basic functionality ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : void session_unset(void)
- * Description : Free all session variables
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_unset() : variation ***\n";
var_dump(session_unset());
ob_start();
-/*
- * Prototype : bool session_write_close(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_write_close() : basic functionality ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_write_close(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_write_close() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_write_close(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_write_close() : variation ***\n";
var_dump(session_start());
ob_start();
-/*
- * Prototype : bool session_write_close(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_write_close() : variation ***\n";
var_dump($_SESSION);
ob_start();
-/*
- * Prototype : bool session_write_close(void)
- * Description : Write session data and end session
- * Source code : ext/session/session.c
- */
-
echo "*** Testing session_write_close() : variation ***\n";
var_dump(session_id("test"));
SPL: Test ArrayObject::asort() function : basic functionality with array based store
--FILE--
<?php
-/* Prototype : int ArrayObject::asort()
- * Description: proto int ArrayIterator::asort()
- * Sort the entries by values.
+/* Sort the entries by values.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
SPL: Test ArrayObject::asort() function : basic functionality with object based store
--FILE--
<?php
-/* Prototype : int ArrayObject::asort()
- * Description: proto int ArrayIterator::asort()
- * Sort the entries by values.
+/* Sort the entries by values.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
SPL: Test ArrayObject::ksort() function : basic functionality with array based store
--FILE--
<?php
-/* Prototype : int ArrayObject::ksort()
- * Description: proto int ArrayIterator::ksort()
- * Sort the entries by key.
+/* Sort the entries by key.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
SPL: Test ArrayObject::ksort() function : basic functionality with object base store
--FILE--
<?php
-/* Prototype : int ArrayObject::ksort()
- * Description: proto int ArrayIterator::ksort()
- * Sort the entries by key.
+/* Sort the entries by key.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
SPL: Test ArrayObject::natcasesort() function : basic functionality
--FILE--
<?php
-/* Prototype : int ArrayObject::natcasesort()
- * Description: proto int ArrayIterator::natcasesort()
- Sort the entries by values using case insensitive "natural order" algorithm.
+/* Sort the entries by values using case insensitive "natural order" algorithm.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
SPL: Test ArrayObject::natsort() function : basic functionality
--FILE--
<?php
-/* Prototype : int ArrayObject::natsort()
- * Description: proto int ArrayIterator::natsort()
- Sort the entries by values using "natural order" algorithm.
+/* Sort the entries by values using "natural order" algorithm.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
SPL: Test ArrayObject::uasort() function : basic functionality
--FILE--
<?php
-/* Prototype : int ArrayObject::uasort(callback cmp_function)
- * Description: proto int ArrayIterator::uasort(callback cmp_function)
- Sort the entries by values user defined function.
+/* Sort the entries by values user defined function.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
Test ArrayObject::uasort() function : wrong arg count
--FILE--
<?php
-/* Prototype : int ArrayObject::uasort(callback cmp_function)
- * Description: proto int ArrayIterator::uasort(callback cmp_function)
- Sort the entries by values user defined function.
+/* Sort the entries by values user defined function.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
Test ArrayObject::uksort() function : basic functionality
--FILE--
<?php
-/* Prototype : int ArrayObject::uksort(callback cmp_function)
- * Description: proto int ArrayIterator::uksort(callback cmp_function)
- * Sort the entries by key using user defined function.
+/* Sort the entries by key using user defined function.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
Test ArrayObject::uksort() function : wrong arg count
--FILE--
<?php
-/* Prototype : int ArrayObject::uksort(callback cmp_function)
- * Description: proto int ArrayIterator::uksort(callback cmp_function)
- Sort the entries by key using user defined function.
+/* Sort the entries by key using user defined function.
* Source code: ext/spl/spl_array.c
* Alias to functions:
*/
SPL: Test class_implements() function : basic
--FILE--
<?php
-/* Prototype : array class_implements(mixed what [, bool autoload ])
- * Description: Return all classes and interfaces implemented by SPL
- * Source code: ext/spl/php_spl.c
- * Alias to functions:
- */
-
echo "*** Testing class_implements() : basic ***\n";
SPL: Test class_implements() function : basic
--FILE--
<?php
-/* Prototype : array class_implements(mixed what [, bool autoload ])
- * Description: Return all classes and interfaces implemented by SPL
- * Source code: ext/spl/php_spl.c
- * Alias to functions:
- */
-
echo "*** Testing class_implements() : basic ***\n";
SPL: Test class_implements() function : variation - no interfaces and autoload
--FILE--
<?php
-/* Prototype : array class_implements(mixed what [, bool autoload ])
- * Description: Return all classes and interfaces implemented by SPL
- * Source code: ext/spl/php_spl.c
- * Alias to functions:
- */
-
echo "*** Testing class_implements() : variation ***\n";
echo "--- testing no interfaces ---\n";
SPL: Test class_implements() function : variation
--FILE--
<?php
-/* Prototype : array class_implements(mixed what [, bool autoload ])
- * Description: Return all classes and interfaces implemented by SPL
- * Source code: ext/spl/php_spl.c
- * Alias to functions:
- */
-
echo "*** Testing class_implements() : variation ***\n";
SPL: Test class_implements() function : basic
--FILE--
<?php
-/* Prototype : array class_uses(mixed what [, bool autoload ])
- * Description: Return all traits used by a class
- * Source code: ext/spl/php_spl.c
- * Alias to functions:
- */
-
echo "*** Testing class_uses() : basic ***\n";
SPL: Test class_uses() function : basic
--FILE--
<?php
-/* Prototype : array class_uses(mixed what [, bool autoload ])
- * Description: Return all traits used by a class
- * Source code: ext/spl/php_spl.c
- * Alias to functions:
- */
-
echo "*** Testing class_uses() : basic ***\n";
SPL: Test class_uses() function : variation - no interfaces and autoload
--FILE--
<?php
-/* Prototype : array class_uses(mixed what [, bool autoload ])
- * Description: Return all traits used by a class
- * Source code: ext/spl/php_spl.c
- * Alias to functions:
- */
-
echo "*** Testing class_uses() : variation ***\n";
echo "--- testing no traits ---\n";
SPL: Test class_uses() function : variation
--FILE--
<?php
-/* Prototype : array class_uses(mixed what [, bool autoload ])
- * Description: Return all traits used by a class
- * Source code: ext/spl/php_spl.c
- * Alias to functions:
- */
-
echo "*** Testing class_uses() : variation ***\n";
Test array_shift() function
--FILE--
<?php
-/* Prototype: mixed array_shift( array &array );
- * Description: Shifts the first value of the array off and returns it.
- */
-
array_shift($GLOBALS);
$empty_array = array();
Test key(), current(), next() & reset() functions
--FILE--
<?php
-/* Prototype & Usage:
- mixed key ( array &$array ) -> returns the index element of the current array position
- mixed current ( array &$array ) -> returns the current element in the array
- mixed next ( array &$array ) -> similar to current() but advances the internal pointer to next element
- mixed reset ( array &$array ) -> Reset the internal pointer to first element
-*/
$basic_arrays = array (
array(0), // array with element as 0
Test array_change_key_case() function
--FILE--
<?php
-/* Prototype: array array_change_key_case ( array $input [, int $case] )
- Description: Changes the keys in the input array to be all lowercase
- or uppercase. The change depends on the last optional case parameter.
- You can pass two constants there, CASE_UPPER and CASE_LOWER(default).
- The function will leave number indices as is.
-*/
$arrays = array (
array (),
array (0),
Test array_change_key_case() function : usage variations - different data types as keys
--FILE--
<?php
-/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Returns an array with all string keys lowercased [or uppercased]
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays with different data types as keys to array_change_key_case()
* to test conversion
Test array_change_key_case() function : usage variations - different int values for $case
--FILE--
<?php
-/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Returns an array with all string keys lowercased [or uppercased]
- * Source code: ext/standard/array.c
- */
-
/*
* Pass different integer values as $case argument to array_change_key_case() to test behaviour
*/
Test array_change_key_case() function : usage variations - position of internal pointer
--FILE--
<?php
-/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Returns an array with all string keys lowercased [or uppercased]
- * Source code: ext/standard/array.c
- */
-
/*
* Check the position of the internal array pointer after calling the function
*/
Test array_change_key_case() function : usage variations - multidimensional arrays
--FILE--
<?php
-/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Returns an array with all string keys lowercased [or uppercased]
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_change_key_case() converts keys in multi-dimensional arrays
*/
Test array_change_key_case() function : usage variations - referenced variables
--FILE--
<?php
-/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Returns an array with all string keys lowercased [or uppercased]
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_change_key_case() when:
* 1. Passed a referenced variable
Test array_change_key_case() function : usage variations - Different strings as keys
--FILE--
<?php
-/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Returns an array with all string keys lowercased [or uppercased]
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_change_key_case() behaves with different strings
*/
Test array_chunk() function : basic functionality - default 'preserve_keys'
--FILE--
<?php
-/* Prototype : array array_chunk(array $array, int $size [, bool $preserve_keys])
- * Description: Split array into chunks
- * Chunks an array into size large chunks.
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_chunk() : basic functionality ***\n";
$size = 2;
Test array_chunk() function : basic functionality - 'preserve_keys' as true/false
--FILE--
<?php
-/* Prototype : array array_chunk(array $array, int $size [, bool $preserve_keys])
- * Description: Split array into chunks
- * Chunks an array into size large chunks.
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_chunk() : basic functionality ***\n";
$size = 2;
Test array_chunk() function : usage variations - array with diff. sub arrays
--FILE--
<?php
-/* Prototype : array array_chunk(array $array, int $size [, bool $preserve_keys])
- * Description: Split array into chunks
- * : Chunks an array into size large chunks
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_chunk() function - input array containing different sub arrays
*/
Test array_chunk() function : usage variations - different 'size' values
--FILE--
<?php
-/* Prototype : array array_chunk(array $array, int $size [, bool $preserve_keys])
- * Description: Split array into chunks
- * : Chunks an array into size large chunks
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_chunk() function with following conditions
* 1. -ve size value
Test array_chunk() function : usage variations - different arrays
--FILE--
<?php
-/* Prototype : array array_chunk(array $array, int $size [, bool $preserve_keys])
- * Description: Split array into chunks
- * : Chunks an array into size large chunks
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_chunk() function with following conditions
* 1. array without elements
Test array_chunk() function : usage variations - references
--FILE--
<?php
-/* Prototype : array array_chunk(array $array, int $size [, bool $preserve_keys])
- * Description: Split array into chunks
- * : Chunks an array into size large chunks
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_chunk() function with following conditions
* 1. input array containing references
Test array_column() function: basic functionality
--FILE--
<?php
-/* Prototype:
- * array array_column(array $input, mixed $column_key[, mixed $index_key]);
- * Description:
- * Returns an array containing all the values from
- * the specified "column" in a two-dimensional array.
- */
echo "*** Testing array_column() : basic functionality ***\n";
/* Array representing a possible record set returned from a database */
--FILE--
<?php
declare(strict_types=1);
-/* Prototype:
- * array array_column(array $input, mixed $column_key[, mixed $index_key]);
- * Description:
- * Returns an array containing all the values from
- * the specified "column" in a two-dimensional array.
- */
echo "\n-- Testing array_column() column key parameter should be a string or an integer (testing bool) --\n";
try {
Test array_column(): Index argument with various types in weak type mode
--FILE--
<?php
-/* Prototype:
- * array array_column(array $input, mixed $column_key[, mixed $index_key]);
- * Description:
- * Returns an array containing all the values from
- * the specified "column" in a two-dimensional array.
- */
-
echo "\n-- Testing array_column() column key parameter should be a string or an integer (testing bool) --\n";
try {
var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], false));
Test array_combine() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_combine(array $keys, array $values)
- * Description: Creates an array by using the elements of the first parameter as keys
- * and the elements of the second as the corresponding values
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_combine() : basic functionality ***\n";
/* Different arrays for $keys and $values arguments */
Test array_combine() function : error conditions - empty array
--FILE--
<?php
-/* Prototype : array array_combine(array $keys, array $values)
- * Description: Creates an array by using the elements of the first parameter as keys
- * and the elements of the second as the corresponding values
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_combine() : error conditions specific to array_combine() ***\n";
// Testing array_combine by passing empty arrays to $keys and $values arguments
Test array_combine() function : usage variations - different arrays(Bug#43424)
--FILE--
<?php
-/* Prototype : array array_combine(array $keys, array $values)
- * Description: Creates an array by using the elements of the first parameter as keys
- * and the elements of the second as the corresponding values
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different types of arrays to both $keys and $values arguments and testing whether
* array_combine() behaves in an expected way with the arguments passed to the function
Test array_combine() function : usage variations - associative array with different keys(Bug#43424)
--FILE--
<?php
-/* Prototype : array array_combine(array $keys, array $values)
- * Description: Creates an array by using the elements of the first parameter as keys
- * and the elements of the second as the corresponding values
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_combine() by passing different
* associative arrays having different possible keys to $keys argument and
Test array_combine() function : usage variations - associative array with different values(Bug#43424)
--FILE--
<?php
-/* Prototype : array array_combine(array $keys, array $values)
- * Description: Creates an array by using the elements of the first parameter as keys
- * and the elements of the second as the corresponding values
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_combine() by passing various
* associative arrays having different possible values to $keys argument and
Test array_combine() function : usage variations - binary safe checking
--FILE--
<?php
-/* Prototype : array array_combine(array $keys, array $values)
- * Description: Creates an array by using the elements of the first parameter as keys
- * and the elements of the second as the corresponding values
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the behavior of array_combine() by passing array with
* binary values for $keys and $values argument.
Test array_count_values() function : Test all normal parameter variations
--FILE--
<?php
-/* Prototype : proto array array_count_values(array input)
- * Description: Return the value as key and the frequency of that value in input as value
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
/*
* Test behaviour with parameter variations
*/
Test array_diff_assoc() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments but do additional checks whether the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of array_diff_assoc
*/
Test array_diff_assoc() function : error conditions - pass array_diff_assoc() too few/zero arguments
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of arr1 that have values which are not present
- * in any of the others arguments but do additional checks whether the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Test errors for array_diff with too few\zero arguments
*/
Test array_diff_assoc() function : usage variations - unexpected values for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not present
- * in any of the others arguments but do additional checks whether the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Pass array_diff_assoc arguments that are not arrays in place of $arr1
*/
Test array_diff_assoc() function : usage variations - binary safe check
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of arr1 that have values which are not
- * present in any of the others arguments but do additional checks whether
- * the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff_assoc() compares binary data
*/
Test array_diff_assoc() function : usage variations - unexpected values for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of arr1 that have values which are not present
- * in any of the others arguments but do additional checks whether the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* pass array_diff_assoc arguments which are not arrays in place of $arr2
*/
Test array_diff_assoc() function : variation - array containing different data types
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of arr1 that have values which are not present
- * in any of the others arguments but do additional checks whether the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff_assoc() compares indexed arrays containing different data types
*/
Test array_diff_assoc() function : usage variations - arrays with different data types as keys
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of arr1 that have values which are not present
- * in any of the others arguments but do additional checks whether the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff_assoc() compares arrays containing different data types
* as keys
Test array_diff_assoc() function : usage variations - compare integers, floats and strings
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of arr1 that have values which are not present
- * in any of the others arguments but do additional checks whether the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff_assoc compares integers, floats and string
*/
Test array_diff_assoc() function : usage variations - strict string comparison check
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments but do additional checks whether the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff_assoc behaves
* 1. When comparing an array that has similar elements
Test array_diff_assoc() function : usage variations - arrays containing referenced variables
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments but do additional checks whether the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Tests how array_diff_assoc compares
* 1. Referenced variables
Test array_diff_assoc() function : usage variations - array containing duplicate keys and values
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments but do additional checks whether
- * the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff_assoc() behaves when comparing:
* 1. the order of the array
Test array_diff_assoc() function : usage variations - compare multidimensional arrays
--FILE--
<?php
-/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments but do additional checks whether
- * the keys are equal
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff_assoc behaves when comparing
* multi-dimensional arrays
Test array_diff() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not present
- * in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of array_diff
*/
Test array_diff() function : error conditions - too few arguments passed to function
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are
- * not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_diff with less than the expected number of arguments
*/
--FILE--
<?php
/*
-* proto array array_diff_key(array arr1, array arr2 [, array ...])
* Function is implemented in ext/standard/array.c
*/
$array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
Test array_diff_key() function : error conditions
--FILE--
<?php
-/* Prototype : array array_diff_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_key() : error conditions ***\n";
// Initialise the variables
Test array_diff_key() function : usage variation - Passing unexpected values to first argument
--FILE--
<?php
-/* Prototype : array array_diff_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_key() function : usage variation - Passing unexpected values to second argument
--FILE--
<?php
-/* Prototype : array array_diff_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_key() function : usage variation - Passing integer indexed array
--FILE--
<?php
-/* Prototype : array array_diff_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_key() function : usage variation - Passing float indexed array
--FILE--
<?php
-/* Prototype : array array_diff_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_key() function : usage variation - Passing boolean indexed array
--FILE--
<?php
-/* Prototype : array array_diff_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_key() function : usage variation - Passing null,unset and undefined variable indexed array
--FILE--
<?php
-/* Prototype : array array_diff_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_key() function : usage variation - Passing multi-dimensional array
--FILE--
<?php
-/* Prototype : array array_diff_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_uassoc() function : error conditions
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : error conditions ***\n";
//Initialize array
Test array_diff_uassoc() function : usage variation - Passing unexpected values to first argument
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
//Initialize variables
Test array_diff_uassoc() function : usage variation - Passing float indexed array
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_uassoc() function : usage variation - Passing boolean indexed array
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_uassoc() function : usage variation - Passing null,unset and undefined variable indexed array
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_uassoc() function : usage variations - arrays containing referenced variables
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
//Initialize variables
Test array_diff_uassoc() function : usage variation -Passing unexpected values to second argument
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
//Initialize variables
Test array_diff_uassoc() function : usage variation - Comparing integers and floating point numbers
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
//Initialize variables
Test array_diff_uassoc() function : usage variation - Comparing floating points with strings having integers and float
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
//Initialize variables
Test array_diff_uassoc() function : usage variation - Comparing strings containing integers and float
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
//Initialize variables
Test array_diff_uassoc() function : usage variation - Comparing integers with strings containing integers and float
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
//Initialize variables
Test array_diff_uassoc() function : usage variation - Passing integer indexed array
--FILE--
<?php
-/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Computes the difference of arrays with additional index check which is performed by a
- * user supplied callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_uassoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
--FILE--
<?php
/*
-* proto array array_diff_ukey ( array $array1, array $array2 [, array $ ..., callback $key_compare_func] )
* Function is implemented in ext/standard/array.c
*/
function key_compare_func($key1, $key2) {
Test array_diff_ukey() function : usage variation - Passing unexpected values to first argument
--FILE--
<?php
-/* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_ukey() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_ukey() function : usage variation - Passing non-existing function name to callback
--FILE--
<?php
-/* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_ukey() : usage variation ***\n";
//Initialize variables
Test array_diff_ukey() function : usage variation - Passing unexpected values to second argument
--FILE--
<?php
-/* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_ukey() : usage variation ***\n";
// Initialize function arguments not being substituted (if any)
Test array_diff_ukey() function : usage variation - Passing multi-dimensional array
--FILE--
<?php
-/* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments. User supplied function is used for comparing the keys. This function is like array_udiff() but works on the keys instead of the values. The associativity is preserved.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_ukey() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_ukey() function : usage variation - Passing integer indexed array
--FILE--
<?php
-/* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_ukey() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_ukey() function : usage variation - Passing float indexed array
--FILE--
<?php
-/* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_ukey() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_ukey() function : usage variation - Passing boolean indexed array
--FILE--
<?php
-/* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_ukey() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff_ukey() function : usage variation - Passing null,unset and undefined variable indexed array
--FILE--
<?php
-/* Prototype : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_diff_ukey() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_diff() function : usage variations - unexpected values for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_diff by passing non array values in place of $arr1
*/
Test array_diff() function : usage variations - binary safe checking
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are
- * not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test behaviour of array_diff() function with binary input
*/
Test array_diff() function : usage variations - unexpected values for 'arr2' argument
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are
- * not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_diff by passing non array values in place of $arr2
*/
Test array_diff() function : usage variations - array with different data types as values
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff() compares indexed arrays containing different
* data types as values in place of $arr1
Test array_diff() function : usage variations - array with different data types as values
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff() compares indexed arrays containing different
* data types as values in place of $arr2
and string array values
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff compares integers, floats and strings
*/
Test array_diff() function : usage variations - array containing duplicate keys and values
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test that array_diff behaves as expected for comparing:
* 1. the order of the array
Test array_diff() function : usage variations - arrays containing referenced variables
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are not
- * present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff compares arrays that
* 1. Contain referenced variables
Test array_diff() function : usage variations - associative arrays containing different data types
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of $arr1 that have values which are
- * not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_diff() with associative arrays containing different data types as values
*/
Test array_diff() function : usage variations - multidimensional arrays
--FILE--
<?php
-/* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
- * Description: Returns the entries of arr1 that have values which are
- * not present in any of the others arguments.
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_diff() compares multidimensional arrays
*/
Test array_fill() function : basic functionality
--FILE--
<?php
-/* Prototype : proto array array_fill(int start_key, int num, mixed val)
- * Description: Create an array containing num elements starting with index start_key each initialized to val
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_fill() : basic functionality ***\n";
// calling the array_fill with all possible valid values for 'val' argument
Test array_fill() function : error conditions
--FILE--
<?php
-/* Prototype : proto array array_fill(int start_key, int num, mixed val)
- * Description: Create an array containing num elements starting with index start_key each initialized to val
- * Source code: ext/standard/array.c
-*/
-
-
echo "*** Testing array_fill() : error conditions ***\n";
// calling array_fill with negative values for 'num' parameter
Test array_fill_keys() function : variation of parameter
--FILE--
<?php
-/* Prototype : proto array array_fill_keys(array keys, mixed val)
- * Description: Create an array using the elements of the first parameter as keys each initialized to val
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
-
echo "*** Testing array_fill_keys() : parameter variations ***\n";
$nullVal = null;
Test array_fill_keys() function : variation of parameter
--FILE--
<?php
-/* Prototype : proto array array_fill_keys(array keys, mixed val)
- * Description: Create an array using the elements of the first parameter as keys each initialized to val
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
/* Testing with reference types for the arguments */
echo "*** Testing array_fill_keys() : parameter variations ***\n";
Test array_fill_keys() function : variation of parameter
--FILE--
<?php
-/* Prototype : proto array array_fill_keys(array keys, mixed val)
- * Description: Create an array using the elements of the first parameter as keys each initialized to val
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
/* Testing with unexpected argument types */
echo "*** Testing array_fill_keys() : parameter variations ***\n";
Test array_fill_keys() function : variation of parameter
--FILE--
<?php
-/* Prototype : proto array array_fill_keys(array keys, mixed val)
- * Description: Create an array using the elements of the first parameter as keys each initialized to val
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
/* Testing with unexpected argument types */
echo "*** Testing array_fill_keys() : parameter variations ***\n";
Test array_fill() function : usage variations - various object values for 'val' argument
--FILE--
<?php
-/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
- * Description: Create an array containing num elements starting with index start_key each initialized to val
- * Source code: ext/standard/array.c
- */
-
/*
* testing array_fill() by passing various object values for 'val' argument
*/
Test array_fill() function : usage variations - unexpected values for 'val' argument
--FILE--
<?php
-/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
- * Description: Create an array containing num elements starting with index start_key each initialized to val
- * Source code: ext/standard/array.c
- */
-
/*
* testing array_fill() by passing different unexpected values for 'val' argument
*/
Test array_fill() function : usage variations - using return value of array_fill for 'val' argument
--FILE--
<?php
-/* Prototype : proto array array_fill(int start_key, int num, mixed val)
- * Description: Create an array containing num elements starting with index start_key each initialized to val
- * Source code: ext/standard/array.c
- */
-
/* passing array_fill() as the 'val' argument in array_fill() function */
echo "*** Testing array_fill() : variation ***\n";
Test array_fill() function : usage variations - different types of array values for 'val' argument
--FILE--
<?php
-/* Prototype : array array_fill(int $start_key, int $num, mixed $val)
- * Description: Create an array containing num elements starting with index start_key each initialized to val
- * Source code: ext/standard/array.c
- */
-
/*
* testing array_fill() by passing different types of array values for 'val' argument
*/
Test array_filter() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
-
echo "*** Testing array_filter() : basic functionality ***\n";
// Initialise all required variables
$input = array(1, 2, 3, 0, -1); // 0 will be considered as FALSE and removed in default callback
-/* Callback function
- * Prototype : bool even(array $input)
- * Parameters : $input - input array each element of which will be checked in function even()
- * Return type : boolean - true if element is even and false otherwise
- * Description : This function takes array as parameter and checks for each element of array.
- * It returns true if the element is even number else returns false
- */
function even($input)
{
return ($input % 2 == 0);
Test array_filter() function : object functionality
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
/* This file uses 'input' array with different types of objects and passes
* it to array_filter() to test object functionality
* i.e. object of simple class with members and functions
}
}
-// Callback function which returns always true
function always_true($input)
{
return true;
Test array_filter() function : usage variations - using the array keys inside 'callback'
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback [, bool $use_type = ARRAY_FILTER_USE_VALUE]])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
/*
* Using array keys as an argument to the 'callback'
*/
Test array_filter() function : usage variations - Different types of array for 'input' argument
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different types of array as 'input' argument.
*/
-// callback function returning always false
function always_false($input)
{
return false;
Test array_filter() function : usage variations - Different types of 'callback' function
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different types of callback functions to array_filter()
* with parameters and return
// Initialize variables
$input = array(0, -1, 2, 3.4E-3, 'hello', "value", "key" => 4, 'null' => NULL);
-// callback function without parameters and with return value
function callback1()
{
return 1;
echo "-- Callback function with parameter and without return --\n";
var_dump( array_filter($input, "callback2") );
-
-// callback function without parameter and without return value
function callback3()
{
}
Test array_filter() function : usage variations - 'input' argument with different false entries
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
/*
* With default callback function argument, array_filter() removes elements which are interpreted as false
* Here Testing all the false array element possibilities
*/
-// callback function always_true
function always_true($input)
{
return true;
Test array_filter() function : usage variations - 'input' array containing references
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing 'input' array which contains elements as reference to other data
*/
echo "*** Testing array_filter() : usage variations - 'input' containing references ***\n";
-// Callback function
-/* Prototype : bool callback(array $input)
- * Parameter : $input - array of which each element need to be checked in function
- * Return Type : returns true or false
- * Description : This function checks each element of an input array if element > 5 then
- * returns true else returns false
- */
function callback($input)
{
if($input > 5) {
Test array_filter() function : usage variations - anonymous callback functions
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different anonymous callback functions with passed by value and reference arguments
*/
Test array_filter() function : usage variations - Callback function with different return values
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
/*
* callback functions are expected to return bool value for array_filter()
* here testing callback functions for return values other than bool
$input = array(0, 1, -1, 10, 100, 1000, 'Hello', null, true);
-// callback functions
-// int as return value
function callback1($input)
{
return 5;
Test array_filter() function : usage variations - built-in functions as 'callback' argument
--FILE--
<?php
-/* Prototype : array array_filter(array $input [, callback $callback])
- * Description: Filters elements from the array via the callback.
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing built-in functions and different language constructs as 'callback' argument
*/
Test array_flip() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_flip(array $input)
- * Description: Return array with key <-> value flipped
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_flip() : basic functionality ***\n";
// array with default keys - numeric values
Test array_flip() function : usage variations - 'input' argument with different invalid values for keys
--FILE--
<?php
-/* Prototype : array array_flip(array $input)
- * Description: Return array with key <-> value flipped
- * Source code: ext/standard/array.c
-*/
-
/*
* Trying different invalid values for 'input' array argument
*/
Test array_flip() function : usage variations - 'input' argument with repeatitive keys and values
--FILE--
<?php
-/* Prototype : array array_flip(array $input)
- * Description: Return array with key <-> value flipped
- * Source code: ext/standard/array.c
-*/
-
/*
* Using different types of repeatitive keys as well as values for 'input' array
*/
Test array_intersect_assoc() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the behavior of array_intersect_assoc() by passing different arrays for the arguments.
* Function is tested by passing associative array as well as array with default keys.
Test array_intersect_assoc() function : error conditions(Bug#43197)
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_intersect_assoc() : error conditions ***\n";
// Zero arguments
Test array_intersect_assoc() function : usage variations - unexpected values for 'arr1' argument(Bug#43196)
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_intersect_assoc() function by passing values to $arr1 argument other than arrays
* and see that function emits proper warning messages wherever expected.
Test array_intersect_assoc() function : usage variations - binary safe checking
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the behavior of array_intersect_assoc() by passing array with
* binary values for $arr1 and $arr2 argument.
Test array_intersect_assoc() function : usage variations - unexpected values for 'arr2' argument(Bug#43196)
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_intersect_assoc() function by passing values to $arr2 argument other than arrays
* and see that function emits proper warning messages wherever expected.
Test array_intersect_assoc() function : usage variations - different arrays for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different types of arrays to $arr1 argument and testing whether
* array_intersect_assoc() behaves in an expected way with the other arguments passed to the function
Test array_intersect_assoc() function : usage variations - different arrays for 'arr2' argument
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different types of arrays to $arr2 argument and testing whether
* array_intersect_assoc() behaves in an expected way with the other arguments passed to the function.
Test array_intersect_assoc() function : usage variations - assoc array with diff keys for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_intersect_assoc() by passing different
* associative arrays having different possible keys to $arr1 argument.
Test array_intersect_assoc() function : usage variations - assoc array with diff keys for 'arr2' argument
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_intersect_assoc() by passing different
* associative arrays having different possible keys to $arr2 argument.
Test array_intersect_assoc() function : usage variations - assoc array with diff values for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_intersect_assoc() by passing different
* associative arrays having different possible values to $arr1 argument.
Test array_intersect_assoc() function : usage variations - assoc array with diff values for 'arr2' argument
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_intersect_assoc() by passing different
* associative arrays having different possible values to $arr2 argument.
Test array_intersect_assoc() function : usage variations - two dimensional arrays for $arr1 and $arr2 arguments
--FILE--
<?php
-/* Prototype : array array_intersect_assoc(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments.
- * Keys are used to do more restrictive check
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the behavior of array_intersect_assoc() by passing 2-D arrays
* to both $arr1 and $arr2 argument.
Test array_intersect() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the behavior of array_intersect() by passing different arrays for the arguments.
* Function is tested by passing associative array as well as array with default keys.
Test array_intersect() function : error conditions
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_intersect() : error conditions ***\n";
// Testing array_intersect() with zero arguments
--FILE--
<?php
/*
-* proto array array_intersect_key(array arr1, array arr2 [, array ...])
* Function is implemented in ext/standard/array.c
*/
$array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
Test array_intersect_key() function : error conditions
--FILE--
<?php
-/* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_key() : error conditions ***\n";
//Initialise function arguments
Test array_intersect_key() function : usage variation - Passing unexpected values to first argument
--FILE--
<?php
-/* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_intersect_key() function : usage variation - Passing unexpected values to second argument
--FILE--
<?php
-/* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_intersect_key() function : usage variation - Passing integer indexed array
--FILE--
<?php
-/* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_intersect_key() function : usage variation - Passing float indexed array
--FILE--
<?php
-/* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_intersect_key() function : usage variation - Passing boolean indexed array
--FILE--
<?php
-/* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_intersect_key() function : usage variation - Passing null,unset and undefeined variable indexed array
--FILE--
<?php
-/* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_key() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_intersect_key() function : usage variation - Passing Multi dimensional array
--FILE--
<?php
-/* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
- * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_key() : usage variation ***\n";
/// Initialise function arguments not being substituted (if any)
Test array_intersect_uassoc() function : usage variation - Passing unexpected values to first argument
--FILE--
<?php
-/* Prototype : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_uassoc() : usage variation ***\n";
// Initialise function arguments
Test array_intersect_uassoc() function : usage variation - Passing class/object methods to callback
--FILE--
<?php
-/* Prototype : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_uassoc() : usage variation ***\n";
//Initialize variables
Test array_intersect_uassoc() function : usage variation - Passing unexpected values to second argument
--FILE--
<?php
-/* Prototype : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_uassoc() : usage variation ***\n";
// Initialise function arguments
Test array_intersect_uassoc() function : usage variation - Intersection of integers with floats and strings.
--FILE--
<?php
-/* Prototype : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_uassoc() : usage variation ***\n";
//Initialize variables
Test array_intersect_uassoc() function : usage variation - Intersection of floating points with strings.
--FILE--
<?php
-/* Prototype : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_uassoc() : usage variation ***\n";
//Initialize variables
Test array_intersect_uassoc() function : usage variation - Intersection of strings containing integers, float
--FILE--
<?php
-/* Prototype : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_uassoc() : usage variation ***\n";
//Initialize variables
Test array_intersect_uassoc() function : usage variation - arrays containing referenced variables
--FILE--
<?php
-/* Prototype : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_uassoc() : usage variation ***\n";
//Initialize variables
--FILE--
<?php
/*
-* proto array array_intersect_ukey ( array $array1, array $array2 [, array $ ..., callback $key_compare_func] )
* Function is implemented in ext/standard/array.c
*/
function key_compare_func($key1, $key2) {
Test array_intersect_ukey() function : usage variation - Passing unexpected values to first argument
--FILE--
<?php
-/* Prototype : array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays using a callback function on the keys for comparison.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_ukey() : usage variation ***\n";
//Initialise arguments
Test array_intersect_ukey() function : usage variation - Passing unexpected values to second argument
--FILE--
<?php
-/* Prototype : array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays using a callback function on the keys for comparison.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_ukey() : usage variation ***\n";
//Initialise arguments
Test array_intersect_ukey() function : usage variation - Intersection of integers with floats and strings.
--FILE--
<?php
-/* Prototype : array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays using a callback function on the keys for comparison.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_ukey() : usage variation ***\n";
//Initialize variables
Test array_intersect_ukey() function : usage variation - Intersection of floating points with strings.
--FILE--
<?php
-/* Prototype : array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays using a callback function on the keys for comparison.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_ukey() : usage variation ***\n";
//Initialize variables
Test array_intersect_ukey() function : usage variation - Intersection of strings containing integer and float
--FILE--
<?php
-/* Prototype : array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays using a callback function on the keys for comparison.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_ukey() : usage variation ***\n";
//Initialize variables
Test array_intersect_ukey() function : usage variation - Passing non-existing function name to callback
--FILE--
<?php
-/* Prototype : array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays using a callback function on the keys for comparison.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_ukey() : usage variation ***\n";
//Initialise arguments
Test array_intersect_ukey() function : usage variation - Passing class/object methods to callback
--FILE--
<?php
-/* Prototype : array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
- * Description: Computes the intersection of arrays using a callback function on the keys for comparison.
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_intersect_ukey() : usage variation ***\n";
//Initialise arguments
Test array_intersect() function : usage variations - unexpected values for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_intersect() function by passing values to $arr1 argument other than arrays
* and see that function emits proper warning messages wherever expected.
Test array_intersect() function : usage variations - binary safe checking
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the behavior of array_intersect() by passing array with
* binary values for $arr1 and $arr2 argument.
Test array_intersect() function : usage variations - unexpected values for 'arr2' argument
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_intersect() function by passing values to $arr2 argument other than arrays
* and see that function emits proper warning messages wherever expected.
Test array_intersect() function : usage variations - different arrays for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different types of arrays to $arr1 argument and testing whether
* array_intersect() behaves in expected way with the other arguments passed to the function
Test array_intersect() function : usage variations - different arrays for 'arr2' argument
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different types of arrays to $arr2 argument and testing whether
* array_intersect() behaves in expected way with the other arguments passed to the function.
Test array_intersect() function : usage variations - assoc array with diff keys for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_intersect() by passing different
* associative arrays having different possible keys to $arr1 argument.
Test array_intersect() function : usage variations - assoc array with diff keys for 'arr2' argument
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_intersect() by passing different
* associative arrays having different possible keys to $arr2 argument.
Test array_intersect() function : usage variations - assoc array with diff values for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_intersect() by passing different
* associative arrays having different possible values to $arr1 argument.
Test array_intersect() function : usage variations - assoc array with diff values for 'arr2' argument
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_intersect() by passing different
* associative arrays having different possible values to $arr2 argument.
Test array_intersect() function : usage variations - two dimensional arrays for $arr1 and $arr2 arguments(Bug#43109)
--FILE--
<?php
-/* Prototype : array array_intersect(array $arr1, array $arr2 [, array $...])
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the behavior of array_intersect() by passing 2-D arrays
* to both $arr1 and $arr2 argument.
Test array_key_exists() function
--FILE--
<?php
-/* Prototype:
- * bool array_key_exists ( mixed $key, array $search );
- * Description:
- * Returns TRUE if the given key is set in the array.
- * key can be any value possible for an array index.
- * Also also works on objects.
- */
-
echo "*** Testing basic functionalities ***\n";
/* Arrays with regular values */
$search_arrays = array(
Test array_key_exists() function : basic functionality
--FILE--
<?php
-/* Prototype : bool array_key_exists(mixed $key, array $search)
- * Description: Checks if the given key or index exists in the array
- * Source code: ext/standard/array.c
- * Alias to functions: key_exists
- */
-
/*
* Test basic functionality of array_key_exists()
*/
Test array_key_exists() function : usage variations - Pass different data types as $key arg
--FILE--
<?php
-/* Prototype : bool array_key_exists(mixed $key, array $search)
- * Description: Checks if the given key or index exists in the array
- * Source code: ext/standard/array.c
- * Alias to functions: key_exists
- */
-
/*
* Pass different data types as $key argument to array_key_exists() to test behaviour
*/
Test array_key_exists() function : usage variations - floats and casting to ints
--FILE--
<?php
-/* Prototype : bool array_key_exists(mixed $key, array $search)
- * Description: Checks if the given key or index exists in the array
- * Source code: ext/standard/array.c
- * Alias to functions: key_exists
- */
-
/*
* Pass floats as $key argument, then cast float values
* to integers and pass as $key argument
Test array_key_exists() function : usage variations - referenced variables
--FILE--
<?php
-/* Prototype : bool array_key_exists(mixed $key, array $search)
- * Description: Checks if the given key or index exists in the array
- * Source code: ext/standard/array.c
- * Alias to functions: key_exists
- */
-
/*
* Pass referenced variables as arguments to array_key_exists() to test behaviour
*/
Test array_key_exists() function : usage variations - multidimensional arrays
--FILE--
<?php
-/* Prototype : bool array_key_exists(mixed $key, array $search)
- * Description: Checks if the given key or index exists in the array
- * Source code: ext/standard/array.c
- * Alias to functions: key_exists
- */
-
/*
* Test how array_key_exists() behaves with multi-dimensional arrays
*/
Test array_key_exists() function : usage variations - equality test for certain data types
--FILE--
<?php
-/* Prototype : bool array_key_exists(mixed $key, array $search)
- * Description: Checks if the given key or index exists in the array
- * Source code: ext/standard/array.c
- * Alias to functions: key_exists
- */
-
/*
* Pass certain data types that can be taken as a key in an array
* and test whether array_key_exists(() thinks they are equal and therefore
Test array_key_exists() function : usage variations - position of internal array pointer
--FILE--
<?php
-/* Prototype : bool array_key_exists(mixed $key, array $search)
- * Description: Checks if the given key or index exists in the array
- * Source code: ext/standard/array.c
- * Alias to functions: key_exists
- */
-
/*
* Check the position of the internal array pointer after calling array_key_exists()
*/
Test array_key_exists() function : usage variations - array keys are different data types
--FILE--
<?php
-/* Prototype : bool array_key_exists(mixed $key, array $search)
- * Description: Checks if the given key or index exists in the array
- * Source code: ext/standard/array.c
- * Alias to functions: key_exists
- */
-
/*
* Pass an array where the keys are different data types as the $search argument
* then pass many different data types as $key argument to test where array_key_exist()
Test array_map() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_map() : basic functionality ***\n";
function multiply($p, $q) {
Test array_map() function : error conditions
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
echo "*** Testing array_map() : error conditions ***\n";
// Testing array_map with one less than the expected number of arguments
Test array_map() function : usage variations - object functionality
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Testing array_map() for object functionalities:
* 1) simple class with variable and method
Test array_map() function : object functionality - with non-existent class and method
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Testing array_map() for following object functionalities:
* 1) non-existent class
Test array_map() function : object functionality - class methods as callback function
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Testing array_map() for object functionality with following callback function variations:
* 1) child class method using parent object
--FILE--
<?php
-/* Prototype : array array_map(mixed callback, array input1 [, array input2 ,...])
- * Description: Applies the callback to the elements in given arrays.
- * Source code: ext/standard/array.c
-*/
-
-
-
echo "*** Testing array_map() : string keys ***\n";
$arr = array("stringkey" => "value");
Test array_map() function : usage variations - anonymous callback function
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing anonymous callback function with following variations
*/
Test array_map() function : usage variations - with recursive callback
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing subarrays and recursive callback function
*/
echo "*** Testing array_map() : recursive callback function ***\n";
-// callback function
function square_recur_single_array($var) {
if (is_array($var))
return array_map('square_recur_single_array', $var);
Test array_map() function : usage variations - built-in function as callback
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing buit-in function as callback function
*/
Test array_map() function : usage variations - callback function with different return types
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing different callback function returning:
* int, string, bool, null values
Test array_map() function : usage variations - null value for 'callback' argument
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing null values for $callback argument and testing whether shortest
* array will be extended with empty elements
Test array_map() function : usage variations - non existent 'callback' function
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing non existent function for $callback argument
*/
Test array_map() function : usage variations - failing built-in functions & language constructs
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing non-permmited built-in functions and language constructs i.e.
* echo(), array(), empty(), eval(), exit(), isset(), list(), print()
Test array_map() function : usage variations - unexpected values for 'callback' argument
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing different scalar/nonscalar values in place of $callback
*/
Test array_map() function : usage variations - callback pass semantics
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() with a pass-by-value callback forced to behave as a pass-by-reference function.
*/
--FILE--
<?php
-/* Prototype : array array_map(mixed callback, array input1 [, array input2 ,...])
- * Description: Applies the callback to the elements in given arrays.
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_map() : references ***\n";
$arr = array("k1" => "v1","k2"=>"v2");
$arr[]=&$arr["k1"];
Test array_map() function : usage variations - different arrays for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing different arrays for $arr1 argument
*/
Test array_map() function : usage variations - associative array with different keys
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing associative array with different keys for $arr1 argument
*/
Test array_map() function : usage variations - associative array with different values
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing associative array with different values for $arr1 argument
*/
Test array_map() function : usage variations - array having subarrays
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing array having different subarrays
*/
Test array_map() function : usage variations - arrays of different size
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing array having different size
* 1) first array as empty array
Test array_map() function : usage variations - array with references
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing array having reference values for $arr1 argument
*/
Test array_map() function : usage variations - binary safe checking
--FILE--
<?php
-/* Prototype : array array_map ( callback $callback , array $arr1 [, array $... ] )
- * Description: Applies the callback to the elements of the given arrays
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_map() by passing array having binary values for $arr1 argument
*/
precision=14
--FILE--
<?php
-/* Prototype: array array_merge(array $array1 [, array $array2 [, array $...]]);
- Description: Merge one or more arrays
-*/
-
echo "\n*** Testing array_merge() basic functionality ***";
$begin_array = array(
array(),
Test array_merge() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of array_merge()
*/
Test array_merge_recursive() function : basic functionality - array with default keys
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_merge_recursive() : array with default keys ***\n";
// Initialise the arrays
Test array_merge_recursive() function : basic functionality - associative arrays
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_merge_recursive() : associative arrays ***\n";
// Initialise the arrays
Test array_merge_recursive() function : usage variations - unexpected values for $arr1 argument
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing non array values to 'arr1' argument of array_merge_recursive() and see
* that the function outputs proper warning messages wherever expected.
Test array_merge_recursive() function : usage variations - two dimensional arrays
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_merge_recursive() by passing
* two dimensional arrays for $arr1 argument.
Test array_merge_recursive() function : usage variations - unexpected values for $arr2 argument
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing non array values to 'arr2' argument of array_merge_recursive() and see
* that the function outputs proper warning messages wherever expected.
Test array_merge_recursive() function : usage variations - different arrays for 'arr1' argument
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different arrays to $arr1 argument and testing whether
* array_merge_recursive() behaves in an expected way.
Test array_merge_recursive() function : usage variations - associative array with different keys
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_merge_recursive() by passing different
* associative arrays having different keys to $arr1 argument.
Test array_merge_recursive() function : usage variations - associative array with different values
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_merge_recursive() by passing different
* associative arrays having different values to $arr1 argument.
Test array_merge_recursive() function : usage variations - array with duplicate keys
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_merge_recursive() by passing
* array having duplicate keys.
Test array_merge_recursive() function : usage variations - array with reference variables
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_merge_recursive() by passing
* array having reference variables.
Test array_merge_recursive() function : usage variations - binary safe checking
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_merge_recursive() by passing an array having binary values.
*/
Test array_merge_recursive() function : usage variations - common key and value(Bug#43559)
--FILE--
<?php
-/* Prototype : array array_merge_recursive(array $arr1[, array $...])
- * Description: Recursively merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_merge_recursive() by passing
* arrays having common key and value.
Test array_merge() function : usage variations - Pass different data types to $arr1 arg
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass different data types as $arr1 argument to test behaviour
*/
Test array_merge() function : usage variations - position of internal array pointer
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Check the position of the internal array pointer after calling array_merge().
* This test is also passing more than two arguments to array_merge().
Test array_merge() function : usage variations - Pass different data types as $arr2 arg
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass different data types as $arr2 argument to array_merge() to test behaviour
*/
Test array_merge() function : usage variations - arrays of diff. data types
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays of different data types to test how array_merge adds them
* onto an existing array
Test array_merge() function : usage variations - Diff. data types as array keys
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an array with different data types as keys to test how array_merge
* adds it onto an existing array
Test array_merge() function : usage variations - numeric keys
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass array_merge() arrays with only numeric keys to test behaviour.
* $arr2 contains a duplicate element to $arr1.
Test array_merge() function : usage variations - string keys
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass array_merge arrays with string keys to test behaviour.
* $arr2 has a duplicate key to $arr1
Test array_merge() function : usage variations - Mixed keys
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass array_merge() arrays with mixed keys to test how it attaches them to
* existing arrays
Test array_merge() function : usage variations - multi-dimensional arrays
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_merge() with multi-dimensional arrays
*/
Test array_merge() function : usage variations - referenced variables
--FILE--
<?php
-/* Prototype : array array_merge(array $arr1, array $arr2 [, array $...])
- * Description: Merges elements from passed arrays into one array
- * Source code: ext/standard/array.c
- */
-
/* Test array_merge() when:
* 1. Passed an array made up of referenced variables
* 2. Passed an array as the first argument and a reference to that array as the second.
Test array_multisort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : basic functionality ***\n";
// Initialise all required variables
Test array_multisort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : basic functionality - renumbering of numeric keys ***\n";
// Initialise all required variables
Test array_multisort() function : case-sensitive
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : case-sensitive\n";
$a = array(
Test array_multisort() function : error conditions
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : error conditions ***\n";
echo "\n-- Testing array_multisort() function with repeated flags --\n";
Test array_multisort() function : case-insensitive
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : case-insensitive\n";
$a = array(
Test array_multisort() function : natural sorting
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : natural sorting\n";
$a = array(
Test array_multisort() function : natural sorting case-sensitive
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : natural sorting case-sensitive\n";
$a = array(
Test array_multisort() function : natural sorting case-insensitive
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : natural sorting case-insensitive\n";
$a = array(
Test array_multisort() function : usage variation
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : usage variation ***\n";
// Define error handler
Test array_multisort() function : usage variation - testing with anonymous array arguments
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : Testing with anonymous arguments ***\n";
var_dump(array_multisort(array(1,3,2,4)));
Test array_multisort() function : usage variation - testing with empty array
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : Testing with empty array ***\n";
var_dump(array_multisort(array()));
Test array_multisort() function : usage variation
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : usage variation ***\n";
// Define error handler
Test array_multisort() function : usage variation
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : usage variation ***\n";
// Define error handler
Test array_multisort() function : usage variation - testing with multiple array arguments
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : Testing with multiple array arguments ***\n";
$arr1 = array (4,3,3,3);
Test array_multisort() function : usage variation - testing with multiple array arguments
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : Testing all array sort specifiers ***\n";
$ar = array( 2, "aa" , "1");
Test array_multisort() function : usage variation - testing with multiple array arguments
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : Testing all array sort specifiers ***\n";
$ar = array( 2, "aa" , "1");
Test array_multisort() function : usage variation - test sort order of all types
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : usage variation - test sort order of all types***\n";
// define some classes
Test array_multisort() function : usage variation - test sort order of all types
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : usage variation - test sort order of all types***\n";
// Define error handler
Test array_multisort() function : usage variation - test sort order of all types
--FILE--
<?php
-/* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
- * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_multisort() : usage variation - test sort order of all types***\n";
// define some classes
Test array_pad() function : usage variations - possible values for 'pad_value' argument
--FILE--
<?php
-/* Prototype : array array_pad(array $input, int $pad_size, mixed $pad_value)
- * Description: Returns a copy of input array padded with pad_value to size pad_size
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_pad() function for expected behavior by passing
* different possible values for $pad_value argument.
Test array_pad() function : usage variations - binary safe checking
--FILE--
<?php
-/* Prototype : array array_pad(array $input, int $pad_size, mixed $pad_value)
- * Description: Returns a copy of input array padded with pad_value to size pad_size
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing binary values to $pad_value argument and testing whether
* array_pad() behaves in an expected way with the other arguments passed to the function.
Test array_pad() function : usage variations - two dimensional array for 'pad_value' argument
--FILE--
<?php
-/* Prototype : array array_pad(array $input, int $pad_size, mixed $pad_value)
- * Description: Returns a copy of input array padded with pad_value to size pad_size
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing two dimensional array to $pad_value argument and testing whether
* array_pad() behaves in an expected way with the other arguments passed to the function.
Test array_pad() function : usage variations - different arrays for 'input' argument
--FILE--
<?php
-/* Prototype : array array_pad(array $input, int $pad_size, mixed $pad_value)
- * Description: Returns a copy of input array padded with pad_value to size pad_size
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different arrays to $input argument and testing whether
* array_pad() behaves in an expected way with the other arguments passed to the function.
Test array_pad() function : usage variations - two dimensional array for 'input' argument
--FILE--
<?php
-/* Prototype : array array_pad(array $input, int $pad_size, mixed $pad_value)
- * Description: Returns a copy of input array padded with pad_value to size pad_size
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing two dimensional array to $input argument and testing whether
* array_pad() behaves in an expected way with the other arguments passed to the function.
Test array_product() function : variation
--FILE--
<?php
-/* Prototype : mixed array_product(array input)
- * Description: Returns the product of the array entries
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_product() : variation - using non numeric values ***\n";
class A {
Test array_product() function : variation
--FILE--
<?php
-/* Prototype : mixed array_product(array input)
- * Description: Returns the product of the array entries
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_product() : variations ***\n";
echo "\n-- Testing array_product() function with a keyed array array --\n";
Test array_product() function : variation
--FILE--
<?php
-/* Prototype : mixed array_product(array input)
- * Description: Returns the product of the array entries
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_product() : variations - negative numbers***\n";
echo "\n-- Testing array_product() function with one negative number --\n";
Test array_product() function : variation
--FILE--
<?php
-/* Prototype : mixed array_product(array input)
- * Description: Returns the product of the array entries
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_product() : variations ***\n";
echo "\n-- Testing array_product() function with a very large array --\n";
--FILE--
<?php
-/* Prototype: int array_push( array &array );
- * Description: Push one or more elements onto the end of array
- and returns the new number of elements in the array.
- */
-
$empty_array = array();
$number = 5;
$str = "abc";
Test array_push() function : basic functionality
--FILE--
<?php
-/* Prototype : int array_push(array $stack, mixed $var [, mixed $...])
- * Description: Pushes elements onto the end of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of array_push with indexed and associative arrays
*/
Test array_push() function : push empty set to the array
--FILE--
<?php
-/* Prototype : int array_push(array $stack[, mixed $...])
- * Description: Pushes elements onto the end of the array
- * Source code: ext/standard/array.c
- */
-
$array = [1,2,3];
$values = [];
Test array_push() function : error conditions - max int value as key
--FILE--
<?php
-/* Prototype : int array_push(array $stack, mixed $var [, mixed $...])
- * Description: Pushes elements onto the end of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Use PHP's maximum integer value as array key
* then try and push new elements onto the array
Test array_push() function : usage variations - Pass different data types as $var arg
--FILE--
<?php
-/* Prototype : int array_push(array $stack, mixed $var [, mixed $...])
- * Description: Pushes elements onto the end of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass different data types as $var argument to array_push to test behaviour
*/
Test array_push() function : usage variations - multidimensional arrays
--FILE--
<?php
-/* Prototype : int array_push(array $stack, mixed $var [, mixed $...])
- * Description: Pushes elements onto the end of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_push when passed:
* 1. an array as $var arg
Test array_push() function : usage variations - position of internal array pointer
--FILE--
<?php
-/* Prototype : int array_push(array $stack, mixed $var [, mixed $...])
- * Description: Pushes elements onto the end of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Check the position of the internal array pointer after calling array_push()
*/
Test array_push() function : usage variations - array keys are different data types
--FILE--
<?php
-/* Prototype : int array_push(array $stack, mixed $var [, mixed $...])
- * Description: Pushes elements onto the end of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass array_push arrays where the keys are different data types.
*/
Test array_rand() function : basic functionality - array with default keys
--FILE--
<?php
-/* Prototype : mixed array_rand(array $input [, int $num_req])
- * Description: Return key/keys for random entry/entries in the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test array_rand() when array with default keys is passed to 'input' argument
*/
Test array_rand() function : basic functionality - with associative array for 'input' argument
--FILE--
<?php
-/* Prototype : mixed array_rand(array $input [, int $num_req])
- * Description: Return key/keys for random entry/entries in the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test array_rand() when associative array is passed to 'input' argument
*/
Test array_rand() function : usage variation - with MultiDimensional array
--FILE--
<?php
-/* Prototype : mixed array_rand(array $input [, int $num_req])
- * Description: Return key/keys for random entry/entries in the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of array_rand() function when multi-dimensional array
* is passed to 'input' argument
Test array_rand() function : usage variation - with associative arrays for 'input' parameter
--FILE--
<?php
-/* Prototype : mixed array_rand(array $input [, int $num_req])
- * Description: Return key/keys for random entry/entries in the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of array_rand() function when associative array is passed to
* the 'input' parameter in the function call
Test array_rand() function : usage variation - invalid values for 'req_num' parameter
--FILE--
<?php
-/* Prototype : mixed array_rand(array $input [, int $num_req])
- * Description: Return key/keys for random entry/entries in the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of array_rand() function when associative array and
* various invalid values are passed to the 'input' and 'req_num'
Test array_rand() function : usage variation - with heredoc string as key in the 'input' array
--FILE--
<?php
-/* Prototype : mixed array_rand(array $input [, int $num_req])
- * Description: Return key/keys for random entry/entries in the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of array_rand() when keys of the 'input' array is heredoc string
*/
precision=14
--FILE--
<?php
-/* Prototype: array array_reduce(array $array, mixed $callback, mixed $initial);
- Description: Iteratively reduce the array to a single value via the callback
-*/
-
$array = array('foo', 'foo', 'bar', 'qux', 'qux', 'quux');
echo "\n*** Testing array_reduce() to integer ***\n";
Test array_reduce() function : variation
--FILE--
<?php
-/* Prototype : mixed array_reduce(array input, mixed callback [, int initial])
- * Description: Iteratively reduce the array to a single value via the callback.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_reduce() : variation ***\n";
Test array_reduce() function : variation - object callbacks
--FILE--
<?php
-/* Prototype : mixed array_reduce(array input, mixed callback [, int initial])
- * Description: Iteratively reduce the array to a single value via the callback.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_reduce() : variation - object callbacks ***\n";
class A {
Test array_reverse() function : basic functionality - simple array for 'array' argument
--FILE--
<?php
-/* Prototype : array array_reverse(array $array [, bool $preserve_keys])
- * Description: Return input as a new array with the order of the entries reversed
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_reverse() by giving a simple array for $array argument
*/
Test array_reverse() function : basic functionality - associative array for 'array' argument
--FILE--
<?php
-/* Prototype : array array_reverse(array $array [, bool $preserve_keys])
- * Description: Return input as a new array with the order of the entries reversed
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_reverse() with associative array for $array argument
*/
Test array_reverse() function : usage variations - different array values for 'array' argument
--FILE--
<?php
-/* Prototype : array array_reverse(array $array [, bool $preserve_keys])
- * Description: Return input as a new array with the order of the entries reversed
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_reverse() by giving
* different array values for $array argument
Test array_reverse() function : usage variations - assoc. array with diff. keys for 'array' argument
--FILE--
<?php
-/* Prototype : array array_reverse(array $array [, bool $preserve_keys])
- * Description: Return input as a new array with the order of the entries reversed
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_reverse() by giving associative arrays with different
* keys for $array argument
precision=12
--FILE--
<?php
-/* Prototype : array array_reverse(array $array [, bool $preserve_keys])
- * Description: Return input as a new array with the order of the entries reversed
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_reverse() by giving associative arrays with different
* values for $array argument
Test array_reverse() function : usage variations - two dimensional arrays for 'array' argument
--FILE--
<?php
-/* Prototype : array array_reverse(array $array [, bool $preserve_keys])
- * Description: Return input as a new array with the order of the entries reversed
- * Source code: ext/standard/array.c
-*/
-
/*
* testing the functionality of array_reverse() by giving 2-D arrays for $array argument
*/
Test array_search() function : usage variations - different needle values
--FILE--
<?php
-/*
- * Prototype : mixed array_search ( mixed $needle, array $haystack [, bool $strict] )
- * Description: Searches haystack for needle and returns the key if it is found in the array, FALSE otherwise
- * Source Code: ext/standard/array.c
-*/
-
/* Test array_search() with different possible needle values */
echo "*** Testing array_search() with different needle values ***\n";
Test array_search() function : usage variations - different haystack values
--FILE--
<?php
-/*
- * Prototype : mixed array_search ( mixed $needle, array $haystack [, bool $strict] )
- * Description: Searches haystack for needle and returns the key if it is found in the array, FALSE otherwise
- * Source Code: ext/standard/array.c
-*/
-
/* Test array_search() with different possible haystack values */
echo "*** Testing array_search() with different haystack values ***\n";
Test array_search() function : usage variations - haystack as sub-array/object
--FILE--
<?php
-/*
- * Prototype : mixed array_search ( mixed $needle, array $haystack [, bool $strict] )
- * Description: Searches haystack for needle and returns the key if it is found in the array, FALSE otherwise
- * Source Code: ext/standard/array.c
-*/
-
/* checking for sub-arrays with array_search() */
echo "*** Testing sub-arrays with array_search() ***\n";
$sub_array = array (
Test array_search() function : usage variations - haystack as resource/multi dimensional array
--FILE--
<?php
-/*
- * Prototype : mixed array_search ( mixed $needle, array $haystack [, bool $strict] )
- * Description: Searches haystack for needle and returns the key if it is found in the array, FALSE otherwise
- * Source Code: ext/standard/array.c
-*/
-
/* checking for Resources */
echo "*** Testing resource type with array_search() ***\n";
//file type resource
Test array_shift() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed array_shift(array &$stack)
- * Description: Pops an element off the beginning of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of array_shift()
*/
Test array_shift() function : usage variations - Pass arrays of different data types
--FILE--
<?php
-/* Prototype : mixed array_shift(array &$stack)
- * Description: Pops an element off the beginning of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays where values are of one data type to test behaviour of array_shift()
*/
Test array_shift() function : usage variations - Pass array with different data types as keys
--FILE--
<?php
-/* Prototype : mixed array_shift(array &$stack)
- * Description: Pops an element off the beginning of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays with different data types as keys to test how array_shift() re-assigns keys
*/
Test array_shift() function : usage variations - multi-dimensional arrays
--FILE--
<?php
-/* Prototype : mixed array_shift(array &$stack)
- * Description: Pops an element off the beginning of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Test popping elements from a sub-array and popping an array from an array
*/
Test array_shift() function : usage variations - call recursively
--FILE--
<?php
-/* Prototype : mixed array_shift(array &$stack)
- * Description: Pops an element off the beginning of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Use the result of one call to array_shift
* as the $stack argument of another call to array_shift()
Test array_shift() function : usage variations - Referenced arrays
--FILE--
<?php
-/* Prototype : mixed array_shift(array &$stack)
- * Description: Pops an element off the beginning of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Test how array_shift when passed:
* 1. a variable that is referenced to an array
Test array_shift() function : usage variations - position of internal pointer
--FILE--
<?php
-/* Prototype : mixed array_shift(array &$stack)
- * Description: Pops an element off the beginning of the array
- * Source code: ext/standard/array.c
- */
-
/*
* Test that the internal pointer is reset after calling array_shift()
*/
Test array_shift() function : usage variations - maintaining referenced elements
--FILE--
<?php
-/* Prototype : mixed array_shift(array &$stack)
- * Description: Pops an element off the beginning of the array
- * Source code: ext/standard/array.c
- */
-
/*
* From a comment left by Traps on 09-Jul-2007 on the array_shift documentation page:
* For those that may be trying to use array_shift() with an array containing references
--FILE--
<?php
/*
-* proto bool shuffle ( array &$array )
* Function is implemented in ext/standard/array.c
*/
$numbers = range(1, 20);
Test array_slice() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
- * Description: Returns elements specified by offset and length
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of array_slice()
*/
Test array_slice() function : usage variations - position of internal array pointer
--FILE--
<?php
-/* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
- * Description: Returns elements specified by offset and length
- * Source code: ext/standard/array.c
- */
-
/*
* Check position of internal array pointer after calling array_slice()
*/
Test array_slice() function : usage variations - array has holes in buckets
--FILE--
<?php
-/* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
- * Description: Returns elements specified by offset and length
- * Source code: ext/standard/array.c
- */
-
/*
* Check that results of array_slice are correct when there are holes in buckets caused by unset()
*/
Test array_slice() function : usage variations - Pass different integers as $offset argument
--FILE--
<?php
-/* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
- * Description: Returns elements specified by offset and length
- * Source code: ext/standard/array.c
- */
-
/*
* Pass different integers as $offset argument to test how array_slice() behaves
*/
Test array_slice() function : usage variations - pass different int values as $length arg
--FILE--
<?php
-/* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
- * Description: Returns elements specified by offset and length
- * Source code: ext/standard/array.c
- */
-
/*
* Pass different integer values as $length argument to array_slice() to test behaviour
*/
Test array_slice() function : usage variations - different data types as keys in an array
--FILE--
<?php
-/* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
- * Description: Returns elements specified by offset and length
- * Source code: ext/standard/array.c
- */
-
/*
* Pass different data types as keys in an array to array_slice()
* to test how $preserve_keys treats them
Test array_slice() function : usage variations - multidimensional arrays
--FILE--
<?php
-/* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
- * Description: Returns elements specified by offset and length
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_slice when passed
* 1. a two-dimensional array as $input argument
Test array_slice() function : usage variations - referenced variables
--FILE--
<?php
-/* Prototype : array array_slice(array $input, int $offset [, int $length [, bool $preserve_keys]])
- * Description: Returns elements specified by offset and length
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_slice() when:
* 1. Passed an array of referenced variables
--FILE--
<?php
/*
- * proto array array_splice(array input, int offset [, int length [, array replacement]])
* Function is implemented in ext/standard/array.c
*/
--FILE--
<?php
/*
- * proto array array_splice(array input, int offset [, int length [, array replacement]])
* Function is implemented in ext/standard/array.c
*/
--FILE--
<?php
/*
- * proto array array_splice(array input, int offset [, int length [, array replacement]])
* Function is implemented in ext/standard/array.c
*/
--FILE--
<?php
/*
- * proto array array_splice(array input, int offset [, int length [, array replacement]])
* Function is implemented in ext/standard/array.c
*/
Test array_sum() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed array_sum(array &input)
- * Description: Returns the sum of the array entries
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_sum() : basic functionality ***\n";
// array with integer values
Test array_sum() function : usage variations - array with different integer value
--FILE--
<?php
-/* Prototype : mixed array_sum(array &input)
- * Description: Returns the sum of the array entries
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_sum() with different types of integer arrays containing data of following type:
* integer, octal, hexadecimal, maximum and minimum integer values & mixed of all integers
Test array_sum() function : usage variations - array with different float values
--FILE--
<?php
-/* Prototype : mixed array_sum(array $input)
- * Description: Returns the sum of the array entries
- * Source code: ext/standard/array.c
-*/
-
/*
* sum of array containing different float values
*/
Test array_sum() function : usage variations - array with duplicate values
--FILE--
<?php
-/* Prototype : mixed array_sum(array $input)
- * Description: Returns the sum of the array entries
- * Source code: ext/standard/array.c
-*/
-
/*
* Checking array_sum() with integer and float array containing duplicate values
*/
Test array_sum() function : usage variations - array with reference variables as elements
--FILE--
<?php
-/* Prototype : mixed array_sum(array $input)
- * Description: Returns the sum of the array entries
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_sum() with 'input' having reference variables as elements
*/
Test array_sum() function : usage variations - associative array
--FILE--
<?php
-/* Prototype : mixed array_sum(array $input)
- * Description: Returns the sum of the array entries
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_sum() with associative array as 'input' argument
*/
Test array_sum() function : usage variations - 'input' array with unexpected values as array element
--FILE--
<?php
-/* Prototype : mixed array_sum(array $input)
- * Description: Returns the sum of the array entries
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_sum() with array having other than numeric entries
* strings, bool, null, subarrays & objects
--FILE--
<?php
/*
-* proto array array_udiff_assoc ( array $array1, array $array2 [, array $ ..., callback $data_compare_func] )
* Function is implemented in ext/standard/array.c
*/
class cr {
Test array_udiff_assoc() function : variation
--FILE--
<?php
-/* Prototype : array array_udiff_assoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys are compared by user supplied function.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_udiff_assoc() : variation - testing with multiple array arguments ***\n";
include('compare_function.inc');
Test array_udiff_assoc() function : usage variation
--FILE--
<?php
-/* Prototype : array array_udiff_assoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys are compared by user supplied function.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_udiff_assoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_udiff_assoc() function : usage variation
--FILE--
<?php
-/* Prototype : array array_udiff_assoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys are compared by user supplied function.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_udiff_assoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_udiff_assoc() function : usage variation - incorrect comparison functions
--FILE--
<?php
-/* Prototype : array array_udiff_assoc(array arr1, array arr2 [, array ...], callback key_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys are compared by user supplied function.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
-
echo "*** Testing array_udiff_assoc() : usage variation - differing comparison functions***\n";
$arr1 = array(1);
--FILE--
<?php
/*
-* proto array array_udiff ( array $array1, array $array2 [, array $ ..., callback $data_compare_func] )
* Function is implemented in ext/standard/array.c
*/
class cr {
--FILE--
<?php
/*
-* proto array array_udiff_assoc ( array $array1, array $array2 [, array $ ..., callback $data_compare_func] )
* Function is implemented in ext/standard/array.c
*/
class cr {
Test array_udiff_uassoc() function : usage variation
--FILE--
<?php
-/* Prototype : array array_udiff_uassoc(array arr1, array arr2 [, array ...], callback data_comp_func, callback key_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys and elements are compared by user supplied functions.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_udiff_uassoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_udiff_uassoc() function : usage variation
--FILE--
<?php
-/* Prototype : array array_udiff_uassoc(array arr1, array arr2 [, array ...], callback data_comp_func, callback key_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys and elements are compared by user supplied functions.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_udiff_uassoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_udiff_uassoc() function : usage variation
--FILE--
<?php
-/* Prototype : array array_udiff_uassoc(array arr1, array arr2 [, array ...], callback data_comp_func, callback key_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments but do additional checks whether the keys are equal. Keys and elements are compared by user supplied functions.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_udiff_uassoc() : usage variation - differing comparison functions***\n";
$arr1 = array(1);
Test array_udiff() function : usage variation
--FILE--
<?php
-/* Prototype : array array_udiff(array arr1, array arr2 [, array ...], callback data_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments. Elements are compared by user supplied function.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_udiff() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_udiff() function : usage variation
--FILE--
<?php
-/* Prototype : array array_udiff(array arr1, array arr2 [, array ...], callback data_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments. Elements are compared by user supplied function.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_udiff() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_udiff() function : usage variation
--FILE--
<?php
-/* Prototype : array array_udiff(array arr1, array arr2 [, array ...], callback data_comp_func)
- * Description: Returns the entries of arr1 that have values which are not present in any of the others arguments. Elements are compared by user supplied function.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_udiff() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
--FILE--
<?php
/*
-* proto array array_uintersect_assoc ( array $array1, array $array2 [, array $ ..., callback $data_compare_func] )
* Function is implemented in ext/standard/array.c
*/
class cr {
Test array_uintersect_assoc() function : basic functionality - testing with multiple array arguments
--FILE--
<?php
-/* Prototype : array array_uintersect_assoc(array arr1, array arr2 [, array ...], callback data_compare_func)
- * Description: U
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect_assoc() : basic functionality - testing with multiple array arguments ***\n";
include('compare_function.inc');
Test array_uintersect_assoc() function : usage variation
--FILE--
<?php
-/* Prototype : array array_uintersect_assoc(array arr1, array arr2 [, array ...], callback data_compare_func)
- * Description: U
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect_assoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_uintersect_assoc() function : usage variation
--FILE--
<?php
-/* Prototype : array array_uintersect_assoc(array arr1, array arr2 [, array ...], callback data_compare_func)
- * Description: U
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect_assoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_uintersect_assoc() function : usage variation - differing comparison functions
--FILE--
<?php
-/* Prototype : array array_uintersect_assoc(array arr1, array arr2 [, array ...], callback data_compare_func)
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments. Data is compared by using an user-supplied callback.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect_assoc() : usage variation - differing comparison functions***\n";
$arr1 = array(1);
--FILE--
<?php
/*
-* proto array array_uintersect ( array $array1, array $array2 [, array $ ..., callback $data_compare_func] )
* Function is implemented in ext/standard/array.c
*/
class cr {
--FILE--
<?php
/*
-* proto array array_uintersect_assoc ( array $array1, array $array2 [, array $ ..., callback $data_compare_func] )
* Function is implemented in ext/standard/array.c
*/
class cr {
Test array_uintersect_uassoc() function : usage variation
--FILE--
<?php
-/* Prototype : array array_uintersect_uassoc(array arr1, array arr2 [, array ...], callback data_compare_func, callback key_compare_func)
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments. Keys are used to do more restrictive check. Both data and keys are compared by using user-supplied callbacks.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect_uassoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_uintersect_uassoc() function : usage variation
--FILE--
<?php
-/* Prototype : array array_uintersect_uassoc(array arr1, array arr2 [, array ...], callback data_compare_func, callback key_compare_func)
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments. Keys are used to do more restrictive check. Both data and keys are compared by using user-supplied callbacks.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect_uassoc() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_uintersect_uassoc() function : usage variation - incorrect callbacks
--FILE--
<?php
-/* Prototype : array array_uintersect_uassoc(array arr1, array arr2 [, array ...], callback data_compare_func, callback key_compare_func)
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments. Keys are used to do more restrictive check. Both data and keys are compared by using user-supplied callbacks.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect_uassoc() : usage variation - incorrect callbacks ***\n";
$arr1 = array(1);
Test array_uintersect() function : usage variation
--FILE--
<?php
-/* Prototype : array array_uintersect(array arr1, array arr2 [, array ...], callback data_compare_func)
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments. Data is compared by using an user-supplied callback.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_uintersect() function : usage variation
--FILE--
<?php
-/* Prototype : array array_uintersect(array arr1, array arr2 [, array ...], callback data_compare_func)
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments. Data is compared by using an user-supplied callback.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect() : usage variation ***\n";
// Initialise function arguments not being substituted (if any)
Test array_uintersect() function : usage variation - differing comparison functions
--FILE--
<?php
-/* Prototype : array array_uintersect(array arr1, array arr2 [, array ...], callback data_compare_func)
- * Description: Returns the entries of arr1 that have values which are present in all the other arguments. Data is compared by using an user-supplied callback.
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
echo "*** Testing array_uintersect() : usage variation - differing comparison functions***\n";
$arr1 = array(1);
Test array_unique() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_unique() : basic functionality ***\n";
// array with default keys
Test array_unique() function : usage variations - different arrays for 'input' argument
--FILE--
<?php
-/* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different arrays to $input argument and testing whether
* array_unique() behaves in an expected way.
Test array_unique() function : usage variations - associative array with different keys
--FILE--
<?php
-/* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unique() by passing different
* associative arrays having different keys to $input argument.
Test array_unique() function : usage variations - associative array with different values
--FILE--
<?php
-/* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unique() by passing different
* associative arrays having different values to $input argument.
Test array_unique() function : usage variations - array with duplicate keys
--FILE--
<?php
-/* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unique() by passing
* array having duplicate keys as values.
Test array_unique() function : usage variations - array with reference variables
--FILE--
<?php
-/* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unique() by passing
* array having reference variables as values.
Test array_unique() function : usage variations - binary safe checking
--FILE--
<?php
-/* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unique() by passing an array having binary values.
*/
Test array_unique() function : usage variations - two dimensional arrays
--FILE--
<?php
-/* Prototype : array array_unique(array $input)
- * Description: Removes duplicate values from array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unique() by passing
* two dimensional arrays for $input argument.
Test array_unshift() function : basic functionality - array with default keys for 'array' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_unshift() by giving array with default keys for $array argument
*/
Test array_unshift() function : basic functionality - associative arrays for 'array' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_unshift() by giving associative arrays for $array argument
*/
Test array_unshift() function : prepend array with empty set
--FILE--
<?php
-/* Prototype : int array_unshift(array $array[, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
$array = [1,2,3];
$values = [];
Test array_unshift() function : passing object for 'var' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unshift() by passing
* an object to the $var argument
Test array_unshift() function : usage variations - all possible values for 'var' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_unshift() by giving all the possible values for $var argument
*/
Test array_unshift() function : usage variations - different array values for 'array' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the behavior of array_unshift() by passing different types of arrays
* to $array argument to which the $var arguments will be prepended
Test array_unshift() function : usage variations - assoc. array with diff. keys for 'array' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unshift() by passing different
* associative arrays having different possible keys to $array argument.
precision=12
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unshift() by passing different
* associative arrays having different possible values to $array argument.
Test array_unshift() function : usage variations - two dimensional arrays for 'array' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unshift() by giving two-dimensional
* arrays and also sub-arrays within the two-dimensional array for $array argument.
Test array_unshift() function : usage variations - double quoted strings for 'var' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unshift() by passing different
* double quoted strings for $var argument that is prepended to the array
Test array_unshift() function : usage variations - single quoted strings for 'var' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unshift() by passing different
* single quoted strings for $var argument that is prepended to the array
Test array_unshift() function : usage variations - heredoc strings for 'var' argument
--FILE--
<?php
-/* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
- * Description: Pushes elements onto the beginning of the array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing the functionality of array_unshift() by passing different
* heredoc strings for $var argument that is prepended to the array
Test array_values() function : basic functionality
--FILE--
<?php
-/* Prototype : array array_values(array $input)
- * Description: Return just the values from the input array
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of array_values()
*/
Test array_values() function : usage variations - arrays of different data types
--FILE--
<?php
-/* Prototype : array array_values(array $input)
- * Description: Return just the values from the input array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays of different data types as $input argument to array_values() to test behaviour
*/
Test array_values() function : usage variations - array keys different data types
--FILE--
<?php
-/* Prototype : array array_values(array $input)
- * Description: Return just the values from the input array
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays where the keys are different data types as $input argument
* to array_values() to test behaviour
Test array_values() function : usage variations - multi-dimensional arrays
--FILE--
<?php
-/* Prototype : array array_values(array $input)
- * Description: Return just the values from the input array
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_values when:
* 1. Passed a two-dimensional array as $input argument
Test array_values() function : usage variations - internal array pointer
--FILE--
<?php
-/* Prototype : array array_values(array $input)
- * Description: Return just the values from the input array
- * Source code: ext/standard/array.c
- */
-
/*
* Test the position of the internal array pointer after a call to array_values
*/
Test array_values() function : usage variations - Referenced variables
--FILE--
<?php
-/* Prototype : array array_values(array $input)
- * Description: Return just the values from the input array
- * Source code: ext/standard/array.c
- */
-
/*
* Test array_values() when:
* 1. Passed an array made up of referenced variables
Test array_values() function : usage variations - Internal order check
--FILE--
<?php
-/* Prototype : array array_values(array $input)
- * Description: Return just the values from the input array
- * Source code: ext/standard/array.c
- */
-
/*
* Check that array_values is re-assigning keys according to the internal order of the array,
* and is not dependent on the \$input argument's keys
Test array_walk() function : basic functionality - regular array
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_walk() : basic functionality ***\n";
// regular array
$fruits = array("lemon", "orange", "banana", "apple");
-/* Prototype : test_print(mixed $item, mixed $key)
- * Parameters : item - item in key/item pair
- * key - key in key/item pair
- * Description : prints the array values with keys
- */
function test_print($item, $key)
{
// dump the arguments to check that they are passed
Test array_walk() function : basic functionality - associative array
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_walk() : basic functionality ***\n";
// associative array
$fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple");
-// User defined callback functions
-/* Prototype : test_alter(mixed $item, mixed $key, string $prefix)
- * Parameters : item - value in key/value pair
- * key - key in key/value pair
- * prefix - string to be added
- * Description : alters the array values by appending prefix string
- */
function test_alter(&$item, $key, $prefix)
{
// dump the arguments to check that they are passed
echo "\n"; // new line to separate the output between each element
}
-/* Prototype : test_print(mixed $item, mixed $key)
- * Parameters : item - value in key/value pair
- * key - key in key/value pair
- * Description : prints the array values with keys
- */
function test_print($item, $key)
{
// dump the arguments to check that they are passed
Test array_walk() function : error conditions - callback parameters
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk() by passing more number of parameters to callback function
*/
Test array_walk() function : object functionality
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing object in place of 'input' argument to test object functionality
*/
echo "*** Testing array_walk() : object functionality ***\n";
-/*
- * Prototype : callback(mixed $value, mixed $key, int $addvalue
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * $addvalue - value to be added
- * Description : Function adds the addvalue to each element of an array
-*/
-
function callback($value, $key, $user_data)
{
var_dump($key);
Test array_walk() function : object functionality - array of objects
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk() with an array of objects
*/
echo "*** Testing array_walk() : array of objects ***\n";
-/*
- * Prototype : callback(mixed $value, mixed $key, int $addvalue
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * $addvalue - value to be added
- * Description : Function adds the addvalue to each element of an array
-*/
function callback_private($value, $key, $addValue)
{
echo "value : ";
Test array_walk_recursive() function : basic functionality - regular array
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_walk_recursive() : basic functionality ***\n";
// regular array
$fruits = array("lemon", array("orange", "banana"), array("apple"));
-/* Prototype : test_print(mixed $item, mixed $key)
- * Parameters : item - item in key/item pair
- * key - key in key/item pair
- * Description : prints the array values with keys
- */
function test_print($item, $key)
{
// dump the arguments to check that they are passed
Test array_walk_recursive() function : basic functionality - associative array
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing array_walk_recursive() : basic functionality ***\n";
// associative array
$fruits = array("a" => "lemon", "b" => array( "c" => "orange", "d" => "banana"), "e" => array("f" => "apple"));
-// User defined callback functions
-/* Prototype : test_alter(mixed $item, mixed $key, string $prefix)
- * Parameters : item - value in key/value pair
- * key - key in key/value pair
- * prefix - string to be added
- * Description : alters the array values by appending prefix string
- */
function test_alter(&$item, $key, $prefix)
{
// dump the arguments to check that they are passed
echo "\n"; // new line to separate the output between each element
}
-/* Prototype : test_print(mixed $item, mixed $key)
- * Parameters : item - value in key/value pair
- * key - key in key/value pair
- * Description : prints the array values with keys
- */
function test_print($item, $key)
{
// dump the arguments to check that they are passed
Test array_walk_recursive() function : error conditions - callback parameters
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk_recursive() by passing more number of parameters to callback function
*/
Test array_walk_recursive() function : object functionality
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/* Passing object in place of an 'input' argument to test object functionality
*/
echo "*** Testing array_walk_recursive() : object functionality ***\n";
-/*
- * Prototype : callback(mixed $value, mixed $key, int $addvalue
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * $addvalue - value to be added
- * Description : Function adds the addvalue to each element of an array
-*/
-
function callback($value, $key, $user_data)
{
var_dump($key);
Test array_walk_recursive() function : object functionality - array of objects
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk_recursive() with an array of objects
*/
echo "*** Testing array_walk_recursive() : array of objects ***\n";
-/*
- * Prototype : callback(mixed $value, mixed $key, int $addvalue
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * $addvalue - value to be added
- * Description : Function adds the addvalue to each element of an array
-*/
function callback_private($value, $key, $addValue)
{
echo "value : ";
Test array_walk_recursive() function : usage variations - 'input' array with different values
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk_recursive() with following types of 'input' arrays:
* integer, float, string, bool, null, empty & mixed
*/
-// callback function
-/*
- * Prototype : print_value(mixed $value, int $key, int $count)
- * Parameters : $value - array entries(values)
- * $key - keys in given input array
- * $count - extra parameter used as an index
- * Description : prints the array values with keys and count value
- */
function print_value($value, $key, $count)
{
echo $count." : ".$key." ".$value."\n";
Test array_walk_recursive() function : usage variations - 'input' array with subarray
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk_recursive() with an array having subarrays as elements
*/
echo "*** Testing array_walk_recursive() : array with subarray ***\n";
-// callback function
-/* Prototype : callback(mixed $value, mixed $key)
- * Parameters : $value - values in given 'input' array
- * $key - keys in given 'input' array
- * Description : It prints the count of an array elements, passed as argument
- */
function callback($value, $key)
{
// dump the arguments to check that they are passed
Test array_walk_recursive() function : usage variations - 'input' argument containing reference variables
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk_recursive() with an array having reference variables
*/
// 'input' array containing references to above variables
$input = array(&$value1, array(&$value2, -35), array(&$value3, 0), array(&$value4));
-// callback function
-/* Prototype : callback(int $value, mixed $key)
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * Description : function checks for the value whether positive or negative and displays according to that
- */
function callback($value, $key)
{
// dump the arguments to check that they are passed
Test array_walk_recursive() function : usage variations - 'input' argument as diff. associative arrays
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing 'input' argument as an associative array
* with Numeric & string keys
echo "*** Testing array_walk_recursive() : 'input' as an associative array ***\n";
-// callback functions
-/* Prototype : for_numeric( int $value, int $key, int $user_data)
- * Parameters : $value - value from key/value pair of the array
- * $key - key from key/value pair of the array
- * $user_data - data to be added to 'value'
- * Description : Function adds values with keys & user_data
- */
function for_numeric($value, $key, $user_data)
{
// dump the input values to see if they are
echo "\n"; // new line to separate the output between each element
}
-/* Prototype : for_string( string $value, string $key)
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * Description : Function appends key to the value
- */
function for_string($value, $key)
{
// dump the input values to see if they are
echo "\n"; // new line to separate the output between each element
}
-/* Prototype : for_mixed( mixed $value, mixed $key)
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * Description : Function displays each element of an array with keys
- */
function for_mixed($value, $key)
{
// dump the input values to see if they are
Test array_walk_recursive() function : usage variations - anonymous callback function
--FILE--
<?php
-/* Prototype : proto bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing anonymous(run-time) callback function with following variations:
* with one parameter
Test array_walk_recursive() function : usage variations - buit-in function as callback
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different buit-in functionns as callback function
* pow function
Test array_walk_recursive() function : usage variations - different callback functions
--FILE--
<?php
-/* Prototype : bool array_walk_recursive(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different types of callback functions to array_walk_recursive()
* without parameters
Test array_walk() function : usage variations - 'input' array with different values
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk() with following types of 'input' arrays:
* integer, float, string, bool, null, empty & mixed
*/
-// callback function
-/*
- * Prototype : print_value(mixed $value, int $key, int $count)
- * Parameters : $value - array entries(values)
- * $key - keys in given input array
- * $count - extra parameter used as an index
- * Description : prints the array values with keys and count value
- */
function print_value($value, $key, $count)
{
echo $count." : ".$key." ".$value."\n";
Test array_walk() function : usage variations - 'input' array with subarray
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk() with an array having subarrays as elements
*/
echo "*** Testing array_walk() : array with subarray ***\n";
-// callback function
-/* Prototype : callback(mixed $value, mixed $key)
- * Parameters : $value - values in given 'input' array
- * $key - keys in given 'input' array
- * Description : It prints the count of an array elements, passed as argument
- */
function callback($value, $key)
{
// dump the arguments to check that they are passed
Test array_walk() function : usage variations - 'input' argument containing reference variables
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing array_walk() with an array having reference variables
*/
// 'input' array containing references to above variables
$input = array(&$value1, &$value2, -35, &$value3, 0, &$value4);
-// callback function
-/* Prototype : callback(int $value, mixed $key)
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * Description : function checks for the value whether positive or negative and displays according to that
- */
function callback($value, $key)
{
// dump the arguments to check that they are passed
Test array_walk() function : usage variations - 'input' argument as diff. associative arrays
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing 'input' argument as an associative array
* with Numeric & string keys
echo "*** Testing array_walk() : 'input' as an associative array ***\n";
-// callback functions
-/* Prototype : for_numeric( int $value, int $key, int $user_data)
- * Parameters : $value - value from key/value pair of the array
- * $key - key from key/value pair of the array
- * $user_data - data to be added to 'value'
- * Description : Function adds values with keys & user_data
- */
function for_numeric($value, $key, $user_data)
{
// dump the input values to see if they are
echo "\n"; // new line to separate the output between each element
}
-/* Prototype : for_string( string $value, string $key)
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * Description : Function appends key to the value
- */
function for_string($value, $key)
{
// dump the input values to see if they are
echo "\n"; // new line to separate the output between each element
}
-/* Prototype : for_mixed( mixed $value, mixed $key)
- * Parameters : $value - values in given input array
- * $key - keys in given input array
- * Description : Function displays each element of an array with keys
- */
function for_mixed($value, $key)
{
// dump the input values to see if they are
Test array_walk() function : usage variations - anonymous callback function
--FILE--
<?php
-/* Prototype : proto bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing anonymous(run-time) callback function with following variations:
* with one parameter
Test array_walk() function : usage variations - buit-in function as callback
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different buit-in functionns as callback function
* pow function
Test array_walk() function : usage variations - different callback functions
--FILE--
<?php
-/* Prototype : bool array_walk(array $input, string $funcname [, mixed $userdata])
- * Description: Apply a user function to every member of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different types of callback functions to array_walk()
* without parameters
Test arsort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing arsort() by providing integer/string arrays to check the basic functionality
* with following flag values.
Test arsort() function : object functionality - sort objects
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $asort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing arsort() by providing integer/string object arrays with following flag values
* 1. Default flag value
Test arsort() function : object functionality - sorting objects with diff. accessibility of member vars
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $asort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing arsort() by providing integer/string object arrays with following flag values
* 1. Default flag value
Test arsort() function : usage variations - sort octal values
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing arsort() by providing different octal array for $array argument with following flag values
* 1.flag value as default
Test arsort() function : usage variations - sort integer/float values
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing arsort() by providing different integer/float value arrays for $array argument with following values
* 1. flag value as default
Test arsort() function : usage variations - sort reference variables
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing arsort() by providing reference variable array with following flag values
* flag value as default
Test arsort() function : usage variations - sort strings
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $asort_flags] )
- * Description: Sort an array and maintain index association
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing arsort() by providing different string arrays for $array argument with following flag values
* flag value as default
Test arsort() function : usage variations - sort hexadecimal values
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $asort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing arsort() by providing different hexa-decimal array for $array argument with following flag values
* flag value as default
Test arsort() function : usage variations - sort bool values
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $sort_flags] )
- * Description: This function arsorts an array.
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing arsort() by providing bool value array for $array argument with following flag values.
* flag value as default
Test arsort() function : usage variations - sort array with diff. sub arrays, 'sort_flags' as default/SORT_REGULAR
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing arsort() by providing arrays contains sub arrays for $array argument with flowing flag values
* flag value as default
Test arsort() function : usage variations - sorting arrays with/without keys, 'sort_flags' as default/SORT_REGULAR
--FILE--
<?php
-/* Prototype : bool arsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from highest to lowest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing arsort() by providing arrays with key values for $array argument with following flag values.
* 1.flag value as default
Test asort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing asort() by providing integer/string arrays to check the basic functionality
* with following flag values.
Test asort() function : object functionality - sort objects
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $asort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing asort() by providing integer/string object arrays with following flag values
* 1. Default flag value
Test asort() function : object functionality - sorting objects with diff. accessibility of member vars
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $asort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing asort() by providing integer/string object arrays with following flag values
* 1. Default flag value
Test asort() function : usage variations - sort octal values
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing asort() by providing different octal array for $array argument with following flag values
* 1.flag value as default
Test asort() function : usage variations - sort integer/float values
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing asort() by providing different integer/float value arrays for $array argument with following values
* 1. flag value as default
Test asort() function : usage variations - sort reference variables
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing asort() by providing reference variable array with following flag values
* flag value as default
Test asort() function : usage variations - sort strings
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $asort_flags] )
- * Description: Sort an array and maintain index association
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing asort() by providing different string arrays for $array argument with following flag values
* flag value as default
Test asort() function : usage variations - sort hexadecimal values
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $asort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing asort() by providing different hexa-decimal array for $array argument with following flag values
* flag value as default
Test asort() function : usage variations - sort bool values
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $sort_flags] )
- * Description: This function asorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing asort() by providing bool value array for $array argument with following flag values.
* flag value as default
Test asort() function : usage variations - sort array with diff. sub arrays, 'sort_flags' as default/SORT_REGULAR
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing asort() by providing arrays contains sub arrays for $array argument with flowing flag values
* flag value as default
Test asort() function : usage variations - sorting arrays with/without keys, 'sort_flags' as default/SORT_REGULAR
--FILE--
<?php
-/* Prototype : bool asort ( array &$array [, int $sort_flags] )
- * Description: Sort an array and maintain index association.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing asort() by providing arrays with key values for $array argument with following flag values.
* 1.flag value as default
Test compact() function : basic functionality
--FILE--
<?php
-/* Prototype : proto array compact(mixed var_names [, mixed ...])
- * Description: Creates a hash containing variables and their values
- * Source code: ext/standard/array.c
- * Alias to functions:
- */
-
/*
* Test basic functionality
*/
Test compact() function : usage variations - arrays containing references.
--FILE--
<?php
-/* Prototype : proto array compact(mixed var_names [, mixed ...])
-* Description: Creates a hash containing variables and their values
-* Source code: ext/standard/array.c
-* Alias to functions:
-*/
/*
* compact variations - arrays with references
*/
Test compact() function: ensure compact() doesn't pick up variables declared outside of current scope.
--FILE--
<?php
-/* Prototype : proto array compact(mixed var_names [, mixed ...])
-* Description: Creates a hash containing variables and their values
-* Source code: ext/standard/array.c
-* Alias to functions:
-*/
echo "*** Testing compact() : usage variations - variables outside of current scope ***\n";
$a = 'main.a';
Test count() function : basic functionality
--FILE--
<?php
-/* Prototype : int count(mixed $var [, int $mode])
- * Description: Count the number of elements in a variable (usually an array)
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of count() using an array as $var argument
* and different values as $mode argument.
Test count() function
--FILE--
<?php
-/* Prototype: int count ( mixed $var [, int $mode] );
- Description: Count elements in an array, or properties in an object
-*/
-
echo "*** Testing basic functionality of count() function ***\n";
print "-- Testing NULL --\n";
$arr = NULL;
Test count() function : usage variations - Infinitely recursive array
--FILE--
<?php
-/* Prototype : int count(mixed $var [, int $mode])
- * Description: Count the number of elements in a variable (usually an array)
- * Source code: ext/standard/array.c
- */
-
/*
* Pass count() an infinitely recursive array as $var argument
* This will stop the script before it reaches the end.
Test current() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed current(array $array_arg)
- * Description: Return the element currently pointed to by the internal array pointer
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of current()
*/
Test current() function : usage variations - arrays containing different data types
--FILE--
<?php
-/* Prototype : mixed current(array $array_arg)
- * Description: Return the element currently pointed to by the internal array pointer
- * Source code: ext/standard/array.c
- * Alias to functions: pos
- */
-
/*
* Pass arrays of different data types as $array_arg to current() to test behaviour
*/
Test current() function : usage variations - referenced variables
--FILE--
<?php
-/* Prototype : mixed current(array $array_arg)
- * Description: Return the element currently pointed to by the internal array pointer
- * Source code: ext/standard/array.c
- * Alias to functions: pos
- */
-
/*
* Test how the internal pointer is affected when two variables are referenced to each other
*/
Test current() function : usage variations - multi-dimensional arrays
--FILE--
<?php
-/* Prototype : mixed current(array $array_arg)
- * Description: Return the element currently pointed to by the internal array pointer
- * Source code: ext/standard/array.c
- * Alias to functions: pos
- */
-
/*
* Test how current() behaves with muti-dimensional and recursive arrays
*/
Test current() function : usage variations - reference & normal parameters
--FILE--
<?php
-/* Prototype : mixed current(array $array_arg)
- * Description: Return the element currently pointed to by the internal array pointer
- * Source code: ext/standard/array.c
- * Alias to functions: pos
- */
-
echo "*** Testing current() : usage variations ***\n";
echo "\n-- Function: reference parameter --\n";
precision=14
--FILE--
<?php
-/* Prototype: mixed end ( array &$array );
- Description: Advances internal pointer of array to last element, and returns its value.
-*/
-
$arrays = array (
array( 0 ),
range(1, 100 ),
precision=14
--FILE--
<?php
-/* Prototype: mixed end ( array &$array );
- Description: Advances internal pointer of array to last element, and returns its value.
-*/
-
$arrays = array (
array( 0 ),
range(1, 100 ),
Test end() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed end(array $array_arg)
- * Description: Advances array argument's internal pointer to the last element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of end()
*/
Test end() function : usage variations - Multi-dimensional arrays
--FILE--
<?php
-/* Prototype : mixed end(array $array_arg)
- * Description: Advances array argument's internal pointer to the last element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Test end() when passed:
* 1. a two-dimensional array
Test end() function : usage variations - Referenced variables
--FILE--
<?php
-/* Prototype : mixed end(array $array_arg)
- * Description: Advances array argument's internal pointer to the last element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Test how the internal pointer is affected when two variables are referenced to each other
*/
Test in_array() function : usage variations - different needdle values
--FILE--
<?php
-/*
- * Prototype : bool in_array ( mixed $needle, array $haystack [, bool $strict] )
- * Description: Searches haystack for needle and returns TRUE
- * if it is found in the array, FALSE otherwise.
- * Source Code: ext/standard/array.c
-*/
-
/* Test in_array() with different possible needle values */
echo "*** Testing in_array() with different needle values ***\n";
Test in_array() function : usage variations - different haystack values
--FILE--
<?php
-/*
- * Prototype : bool in_array ( mixed $needle, array $haystack [, bool $strict] )
- * Description: Searches haystack for needle and returns TRUE
- * if it is found in the array, FALSE otherwise.
- * Source Code: ext/standard/array.c
-*/
-
/* Test in_array() with different possible haystack values */
echo "*** Testing in_array() with different haystack values ***\n";
Test in_array() function : usage variations - haystack as sub-array/object
--FILE--
<?php
-/*
- * Prototype : bool in_array ( mixed $needle, array $haystack [, bool $strict] )
- * Description: Searches haystack for needle and returns TRUE
- * if it is found in the array, FALSE otherwise.
- * Source Code: ext/standard/array.c
-*/
-
/* Test in_array() with haystack as sub-array and object */
/* checking for sub-arrays with in_array() */
Test in_array() function : usage variations - haystack as resource/multi dimensional array
--FILE--
<?php
-/*
- * Prototype : bool in_array ( mixed $needle, array $haystack [, bool $strict] )
- * Description: Searches haystack for needle and returns TRUE
- * if it is found in the array, FALSE otherwise.
- * Source Code: ext/standard/array.c
-*/
-
/* Test in_array() with haystack as resource and multidimensional arrays */
/* checking for Resources */
Test key() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed key(array $array_arg)
- * Description: Return the key of the element currently pointed to by the internal array pointer
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of key()
*/
Test key() function : usage variations
--FILE--
<?php
-/* Prototype : mixed key(array $array_arg)
- * Description: Return the key of the element currently pointed to by the internal array pointer
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays where keys are different data types as $array_arg to key() to test behaviour
*/
Test key() function : usage variations
--FILE--
<?php
-/* Prototype : mixed key(array $array_arg)
- * Description: Return the key of the element currently pointed to by the internal array pointer
- * Source code: ext/standard/array.c
- */
-
/*
* Test how the internal pointer is affected when two variables are referenced to each other
*/
Test key() function : usage variations
--FILE--
<?php
-/* Prototype : mixed key(array $array_arg)
- * Description: Return the key of the element currently pointed to by the internal array pointer
- * Source code: ext/standard/array.c
- */
-
/*
* Test how key() behaves with muti-dimensional and recursive arrays
*/
Test krsort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key in reverse order, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing krsort() by providing array of integer/string values to check the basic functionality
* with following flag values :
Test krsort() function : object functionality - sort objects
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key in reverse order, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
/*
* testing krsort() by providing array of integer/string objects with following flag values:
* 1.Default flag value
Test krsort() function : usage variations - sort heredoc strings
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key in reverse order, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* testing krsort() by providing array of heredoc strings for $array argument with
* following flag values:
Test krsort() function : usage variations - sort bool values
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key in reverse order, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* testing krsort() by providing array of boolean values for $array argument with following flag values:
* 1.flag value as default
Test krsort() function : usage variations - sort integer/float values
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key in reverse order, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing krsort() by providing array of integer/float/mixed values for $array argument
* with following flag values:
Test krsort() function : usage variations - sort octal values
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key in reverse order, maintaining key to data correlation.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing krsort() by providing array of octal values for $array argument
* with following flag values:
Test krsort() function : usage variations - sort strings
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key in reverse order, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* testing krsort() by providing array of string values for $array argument with
* following flag values:
Test krsort() function : usage variations - sort hexadecimal values
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key in reverse order, maintaining key to data correlation.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing krsort() by providing array of hexa-decimal values for $array argument
* with following flag values:
Test krsort() function : usage variations - sort array with diff. sub arrays
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* testing krsort() by providing arrays contains sub arrays for $array argument
* with flowing flag values
Test krsort() function : usage variations - sort array with/without key values
--FILE--
<?php
-/* Prototype : bool krsort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key in reverse order, maintaining key to data correlation.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing krsort() by providing arrays with/without key values for $array argument
* with following flag values:
Test ksort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing ksort() by providing array of integer/string values to check the basic functionality with following flag values :
* 1.flag value as default
Test ksort() function : object functionality - sort objects
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation.
- * Source code: ext/standard/array.c
-*/
/*
* testing ksort() by providing array ofinteger/string objects with following flag values:
* 1.SORT_NUMERIC - compare items numerically
Test ksort() function : usage variations - sort octal values
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing ksort() by providing array of octal values for $array argument with following flag values:
* 1.flag value as default
Test ksort() function : usage variations - sort heredoc strings
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* testing ksort() by providing array of heredoc strings for $array argument with
* following flag values:
Test ksort() function : usage variations - sort integer/float values
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing ksort() by providing array of integer/float/mixed values for $array argument
* with following flag values:
Test ksort() function : usage variations - sort bool values
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* testing ksort() by providing array of boolean values for $array argument with following flag values:
* 1.flag value as default
Test ksort() function : usage variations - sort strings
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* testing ksort() by providing array of string values for $array argument with
* following flag values:
Test ksort() function : usage variations - sort hexadecimal values
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing ksort() by providing array of hexa-decimal values for $array argument with following flag values:
* 1.flag value as default
Test ksort() function : usage variations - sort array with diff. sub arrays
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation
- * Source code: ext/standard/array.c
-*/
-
/*
* testing ksort() by providing arrays containing sub arrays for $array argument
* with flowing flag values:
Test ksort() function : usage variations - sorting arrays with/without keys
--FILE--
<?php
-/* Prototype : bool ksort ( array &$array [, int $sort_flags] )
- * Description: Sort an array by key, maintaining key to data correlation.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing ksort() by providing arrays with/without key values for $array argument with following flag values:
* 1.flag value as default
--FILE--
<?php
/*
- * proto mixed max(mixed arg1 [, mixed arg2 [, mixed ...]])
* Function is implemented in ext/standard/array.c
*/
--FILE--
<?php
/*
- * proto mixed max(mixed arg1 [, mixed arg2 [, mixed ...]])
* Function is implemented in ext/standard/array.c
*/
--FILE--
<?php
/*
- * proto mixed max(mixed arg1 [, mixed arg2 [, mixed ...]])
* Function is implemented in ext/standard/array.c
*/
--FILE--
<?php
/*
- * proto mixed min(mixed arg1 [, mixed arg2 [, mixed ...]])
* Function is implemented in ext/standard/array.c
*/
--FILE--
<?php
/*
- * proto mixed min(mixed arg1 [, mixed arg2 [, mixed ...]])
* Function is implemented in ext/standard/array.c
*/
--FILE--
<?php
/*
- * proto mixed min(mixed arg1 [, mixed arg2 [, mixed ...]])
* Function is implemented in ext/standard/array.c
*/
Test natcasesort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of natcasesort()
*/
Test natcasesort() function : object functionality - array of objects
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass natcasesort() an array of objects to test how it re-orders them
*/
Test natcasesort() function : object functionality - mixed visibility within objects
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass natcasesort() an array of objects which have properties of different
* visibilities to test how it re-orders the array.
Test natcasesort() function : usage variations - position of internal array pointer
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Check position of internal array pointer after calling natcasesort()
*/
Test natcasesort() function : usage variations - Different array keys
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays where the keys are different data types to test behaviour of natcasesort()
*/
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays of different data types to natcasesort() to test how they are sorted
*/
?>
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays of numeric data to test how natcasesort re-orders the array
*/
Test natcasesort() function : usage variations - different string types
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays of string data to see how natcasesort() re-orders the array
*/
Test natcasesort() function : usage variations - different hex values
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an array of different hex values to test how natcasesort() re-orders it
*/
Test natcasesort() function : usage variations - referenced variables
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an array of referenced variables to test how natcasesort() re-orders it
*/
Test natcasesort() function : usage variations - recursive arrays
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass natcasesort() an infinitely recursive array to test how it is re-ordered
*/
Test natcasesort() function : usage variations - octal values
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an array of octal values to test how natcasesort() re-orders it
*/
--FILE--
<?php
/*
-* proto bool natsort ( array &$array )
* Function is implemented in ext/standard/array.c
*/
$array1 = $array2 = array("img12.png", "img10.png", "img2.png", "img1.png");
Test next() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed next(array $array_arg)
- * Description: Move array argument's internal pointer to the next element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of next()
*/
Test next() function : usage variation - Mulit-dimensional arrays
--FILE--
<?php
-/* Prototype : mixed next(array $array_arg)
- * Description: Move array argument's internal pointer to the next element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Test next() when passed:
* 1. a two-dimensional array
Test prev() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed prev(array $array_arg)
- * Description: Move array argument's internal pointer to the previous element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of prev()
*/
prev - ensure warning is received when passing an indirect temporary.
--FILE--
<?php
-/* Prototype : mixed prev(array $array_arg)
- * Description: Move array argument's internal pointer to the previous element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Pass temporary variables to prev() to test behaviour
*/
prev - ensure we cannot pass a temporary
--FILE--
<?php
-/* Prototype : mixed prev(array $array_arg)
- * Description: Move array argument's internal pointer to the previous element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Pass temporary variables to prev() to test behaviour
*/
Test prev() function : usage variation - Multi-dimensional arrays
--FILE--
<?php
-/* Prototype : mixed prev(array $array_arg)
- * Description: Move array argument's internal pointer to the previous element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Test prev() when passed:
* 1. a two-dimensional array
Test reset() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed reset(array $array_arg)
- * Description: Set array argument's internal pointer to the first element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of reset()
*/
Test reset() function : usage variations - unset first element
--FILE--
<?php
-/* Prototype : mixed reset(array $array_arg)
- * Description: Set array argument's internal pointer to the first element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Unset first element of an array and test behaviour of reset()
*/
Test reset() function : usage variations - Referenced variables
--FILE--
<?php
-/* Prototype : mixed reset(array $array_arg)
- * Description: Set array argument's internal pointer to the first element and return it
- * Source code: ext/standard/array.c
- */
-
/*
* Reference two arrays to each other then call reset() to test position of
* internal pointer in both arrays
Test rsort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of rsort()
*/
Test rsort() function : object functionality
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of rsort() with objects
*/
Test rsort() function : object functionality - different visibilities
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Test functionality of rsort() with objects where properties have different visibilities
*/
Test rsort() function : usage variations - Octal values
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Pass rsort() an array containing octal values to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays containing different numeric data to rsort() to test behaviour
*/
Test rsort() function : usage variations - referenced variables
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Test behaviour of rsort() when:
* 1. passed an array of referenced variables
Test rsort() function : usage variations - String values
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays containing different string data to rsort() to test behaviour
*/
Test rsort() function : usage variations - Hexadecimal vales
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Pass rsort() an array of hexadecimal values to test behaviour
*/
Test rsort() function : usage variations - boolean values
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Pass rsort() arrays of boolean values to test behaviour
*/
Test rsort() function : usage variations - multi-dimensional arrays
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Pass rsort() multi-dimensional arrays to test behaviour
*/
Test rsort() function : usage variations - mixed associative arrays
--FILE--
<?php
-/* Prototype : bool rsort(array &$array_arg [, int $sort_flags])
- * Description: Sort an array in reverse order
- * Source code: ext/standard/array.c
- */
-
/*
* Pass rsort() associative arrays to test key re-assignment
*/
Test shuffle() function : basic functionality - array with default keys
--FILE--
<?php
-/* Prototype : bool shuffle(array $array_arg)
- * Description: Randomly shuffle the contents of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of shuffle when an array with default keys
* is passed to the 'array_arg' argument and check for the
Test shuffle() function : basic functionality - with associative array
--FILE--
<?php
-/* Prototype : bool shuffle(array $array_arg)
- * Description: Randomly shuffle the contents of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of shuffle when an associative array is
* passed to the 'array_arg' argument and check for the
Test shuffle() function : usage variation - with MultiDimensional array
--FILE--
<?php
-/* Prototype : bool shuffle(array $array_arg)
- * Description: Randomly shuffle the contents of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of shuffle() function when multi-dimensional array is
* passed to 'array_arg' argument
Test shuffle() function : usage variation - arrays with diff types of values
--FILE--
<?php
-/* Prototype : bool shuffle(array $array_arg)
- * Description: Randomly shuffle the contents of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of shuffle() function when arrays having different
* types of values, are passed to 'array_arg' argument
Test shuffle() function : usage variation - associative arrays with diff types of values
--FILE--
<?php
-/* Prototype : bool shuffle(array $array_arg)
- * Description: Randomly shuffle the contents of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of shuffle() function when associative arrays
* having different types of values, are passed to 'array_arg' argument
Test shuffle() function : usage variation - arrays with diff heredoc strings
--FILE--
<?php
-/* Prototype : bool shuffle(array $array_arg)
- * Description: Randomly shuffle the contents of an array
- * Source code: ext/standard/array.c
-*/
-
/*
* Test behaviour of shuffle() when an array of heredoc strings is passed to
* 'array_arg' argument of the function
Test sizeof() function : basic functionality - for scalar types
--FILE--
<?php
-/* Prototype : int sizeof(mixed $var[, int $mode] )
- * Description: Counts an elements in an array. If Standard PHP library is
- * installed, it will return the properties of an object.
- * Source code: ext/standard/basic_functions.c
- * Alias to functions: count()
- */
-
/* Testing the sizeof() for some of the scalar types(integer, float) values
* in default, COUNT_NORMAL and COUNT_RECURSIVE modes.
*/
Test sizeof() function : basic functionality - for non-scalar type(array)
--FILE--
<?php
-/* Prototype : int sizeof(mixed $var[, int $mode] )
- * Description: Counts an elements in an array. If Standard PHP library is
- * installed, it will return the properties of an object.
- * Source code: ext/standard/basic_functions.c
- * Alias to functions: count()
- */
-
/* Testing the sizeof() for non-scalar type(array) value
* in default, COUNT_NORMAL and COUNT_RECURSIVE modes.
* Sizeof() has been tested for simple integer, string,
Test sizeof() function : object functionality - object with Countable interface
--FILE--
<?php
-/* Prototype : int sizeof($mixed var[, int $mode])
- * Description: Counts an elements in an array. If Standard PHP library is installed,
- * it will return the properties of an object.
- * Source code: ext/standard/basic_functions.c
- * Alias to functions: count()
- */
-
echo "*** Testing sizeof() : object functionality ***\n";
echo "-- Testing sizeof() with an object which implements Countable interface --\n";
Test sizeof() function : object functionality - objects without Countable interface
--FILE--
<?php
-/* Prototype : int sizeof($mixed var[, int $mode] )
- * Description: Counts an elements in an array. If Standard PHP library is installed,
- * it will return the properties of an object.
- * Source code: ext/standard/basic_functions.c
- * Alias to functions: count()
- */
-
echo "*** Testing sizeof() : object functionality ***\n";
echo "--- Testing sizeof() with objects which doesn't implement Countable interface ---\n";
Test sizeof() function : usage variations - for all scalar types and resource variable
--FILE--
<?php
-/* Prototype : int sizeof($mixed var[, int $mode])
- * Description: Counts an elements in an array. If Standard PHP library is installed,
- * it will return the properties of an object.
- * Source code: ext/standard/basic_functions.c
- * Alias to functions: count()
- */
-
echo "*** Testing sizeof() : usage variations ***\n";
echo "--- Testing sizeof() for all scalar types in default,COUNT_NORMAL and COUNT_RECURSIVE mode ---\n";
Test sizeof() function : usage variations - different array values for 'var' argument
--FILE--
<?php
-/* Prototype : int sizeof($mixed var[, int $mode])
- * Description: Counts an elements in an array. If Standard PHP library is installed,
- * it will return the properties of an object.
- * Source code: ext/standard/basic_functions.c
- * Alias to functions: count()
- */
-
echo "*** Testing sizeof() : usage variations ***\n";
// get a resource variable
Test sizeof() function : usage variations - checking for infinite recursion in COUNT_RECURSIVE mode
--FILE--
<?php
-/* Prototype : int sizeof($mixed var[, int $mode])
- * Description: Counts an elements in an array. If Standard PHP library is installed,
- * it will return the properties of an object.
- * Source code: ext/standard/basic_functions.c
- * Alias to functions: count()
- */
-
echo "*** Testing sizeof() : usage variations ***\n";
echo "-- Testing sizeof() for infinite recursion with arrays as argument in COUNT_RECURSIVE mode --\n";
Test sizeof() function : usage variations - all kinds of unset variables for 'var' argument
--FILE--
<?php
-/* Prototype : int sizeof($mixed var[, int $mode])
- * Description: Counts an elements in an array. If Standard PHP library is installed,
- * it will return the properties of an object.
- * Source code: ext/standard/basic_functions.c
- * Alias to functions: count()
- */
-
echo "*** Testing sizeof() : usage variations ***\n";
echo "--- Testing sizeof() for all kinds of unset variables in default, Normal and Recursive Modes ---\n";
Test sort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing sort() by providing arrays with default keys and assoc arrays
* to check the basic functionality with following flag values.
Test sort() function : object functionality - sorting objects, 'sort_flags' as default/SORT_REGULAR
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
/*
* testing sort() by providing integer/string object arrays with flag values are default, SORT_REGULAR
*/
Test sort() function : object functionality - sorting objects with diff. accessibility of member vars
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing sort() by providing integer/string object arrays with flag values are default, SORT_REGULAR
*/
Test sort() function : usage variations - sort octal values
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing sort() by providing different octal array for $array argument
* with following flag values
Test sort() function : usage variations - sort integer/float values
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing sort() by providing different integer/float value arrays for $array argument
* with following flag values
Test sort() function : usage variations - sort reference values
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing sort() by providing reference variable array with following flag values
* flag value as default
Test sort() function : usage variations - sort strings
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing sort() by providing different string arrays for $array argument with following flag values
* flag value as default
Test sort() function : usage variations - sort hexadecimal values
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing sort() by providing different hexa-decimal array for $array argument with following flag values
* flag value as default
Test sort() function : usage variations - sort boolean values
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing sort() by providing bool value array for $array argument with following flag values.
* flag value as default
Test sort() function : usage variations - sort array with diff. sub arrays, 'sort_flags' as default/SORT_REGULAR
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* testing sort() by providing arrays contains sub arrays for $array argument with flowing flag values
* flag value as default
Test sort() function : usage variations - sort diff. associative arrays, 'sort_flags' as default/SORT_REGULAR
--FILE--
<?php
-/* Prototype : bool sort ( array &$array [, int $sort_flags] )
- * Description: This function sorts an array.
- Elements will be arranged from lowest to highest when this function has completed.
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing sort() by providing arrays with key values for $array argument
* with following flag values.
Test uasort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing uasort() : basic functionality ***\n";
// comparison function
-/* Prototype : int cmp(mixed $value1, mixed $value2)
- * Parameters : $value1 and $value2 - values to be compared
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value2
- * Description : compares value1 and value2
- */
function cmp($value1, $value2)
{
if($value1 == $value2) {
Test uasort() function : basic functionality - duplicate values
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
echo "*** Testing uasort() : basic functionality with duplicate values ***\n";
// comparison function
-/* Prototype : int cmp(mixed $value1, mixed $value2)
- * Parameters : $value1 and $value2 - values to be compared
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value2
- * Description : compares value1 and value2
- */
function cmp($value1, $value2)
{
if($value1 == $value2) {
Test uasort() function : object functionality
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing uasort() function with the array of objects
* array of objects which has only one member variable & more than one member variables
echo "*** Testing uasort() : object functionality ***\n";
// comparison function
-/* Prototype : int cmp(mixed $value1, mixed $value2)
- * Parameters : $value1 and $value2 - values to be compared
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value3
- * Description : compares value1 and value2
- */
function simple_cmp($value1, $value2)
{
if($value1 == $value2) {
Test uasort() function : object functionality - sort diff. objects
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*
/*
* This testcase tests uasort() functionality with different objects
echo "*** Testing uasort() : object functionality ***\n";
// comparison function
-/* Prototype : int cmp_function(mixed $value1, mixed $value2)
- * Parameters : $value1 and $value2 - values to be compared
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value2
- * Description : compares value1 and value2
- */
function cmp_function($value1, $value2)
{
if($value1 == $value2) {
Test uasort() function : usage variations - sort array with reference variables
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing uasort() with 'array_arg' containing different reference variables
*/
// comparison function
-/* Prototype : int cmp_function(mixed $value1, mixed $value2)
- * Parameters : $value1 and $value2 - values to be compared
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value2
- * Description : compares value1 and value2
- */
function cmp_function($value1, $value2)
{
if($value1 == $value2) {
Test uasort() function : usage variations - different associative arrays
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
/* Testing uasort() with different associative arrays having keys as
* string, integer, default & duplicate keys
*/
echo "*** Testing uasort() : sorting different associative arrays ***\n";
// comparison function
-/* Prototype : int cmp(mixed $value1, mixed $value2)
- * Parameters : $value1 and $value2 - values to be compared
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value2
- * Description : compares value1 and value2
- */
function cmp($value1, $value2)
{
if($value1 == $value2) {
Test uasort() function : usage variations - sort different numeric values
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
/*
* sorting different types of numeric arrays containing data of following type:
* integer, octal, hexadecimal & float
*/
// comparison function
-/* Prototype : int cmp_function(mixed $value1, mixed $value2)
- * Parameters : $value1 and $value2 - values to be compared
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value2
- * Description : compares value1 and value2
- */
function cmp_function($value1, $value2)
{
if($value1 == $value2) {
Test uasort() function : usage variations - sort diff. strings
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
/*
* sorting different strings:
* single quoted, double quoted and heredoc strings
*/
// comparison function
-/* Prototype : int cmp_function(mixed $value1, mixed $value2)
- * Parameters : $value1 and $value2 - values to be compared
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value2
- * Description : compares value1 and value2
- */
function cmp_function($value1, $value2)
{
if($value1 == $value2) {
Test uasort() function : usage variations - sort array having subarrays
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
/*
* Testing uasort() with 'array_arg' having different subarrays as array elements
*/
// comparison function
-/* Prototype : int cmp_function(mixed $value1, mixed $value2)
- * Parameters : $value1 and $value2 - values to be compared
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value2
- * Description : compares value1 and value2
- */
function cmp_function($value1, $value2)
{
if($value1 == $value2) {
Test uasort() function : usage variations - anonymous function as 'cmp_function'
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different anonymous functions as 'cmp_function'
* arguments passed by value
Test uasort() function : usage variations - built-in function as 'cmp_function'
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
/*
* Passing different built-in library functions in place of 'cmp_function'
* valid comparison functions: strcmp() & strcasecmp()
Test uasort() function : usage variations - 'cmp_function' with reference argument
--FILE--
<?php
-/* Prototype : bool uasort(array $array_arg, string $cmp_function)
- * Description: Sort an array with a user-defined comparison function and maintain index association
- * Source code: ext/standard/array.c
-*/
-
/* Testing uasort() functionality with comparison function having arguments as reference
*/
echo "*** Testing uasort() : 'cmp_function' with reference arguments ***\n";
// comparison function
-/* Prototype : int cmp(mixed &$value1, mixed &$value2)
- * Parameters : $value1 and $value2 - values received by reference
- * Return value : 0 - if both values are same
- * 1 - if value1 is greater than value2
- * -1 - if value1 is less than value2
- * Description : compares value1 and value2
- */
function cmp(&$value1, &$value2)
{
if($value1 == $value2) {
--FILE--
<?php
/*
-* proto bool uksort ( array &$array, callback $cmp_function )
* Function is implemented in ext/standard/array.c
*/
function cmp($a, $b) {
Test usort() function : basic functionality
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Test basic functionality of usort() with indexed and associative arrays
*/
Test usort() function : object functionality - different number of properties
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an array of objects which have a different number of properties
* to test behaviour of usort()
Test usort() function : object functionality - Different types of classes
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an array of objects which are either:
* 1. Empty
Test usort() function : usage variations - duplicate keys and values
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an array with duplicate keys and values to usort() to test behaviour
*/
Test usort() function : usage variations - diff. array values
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an array with different data types as keys to usort() to test how it is re-ordered
*/
Test usort() function : usage variations - numeric data
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays of numeric data to usort() to test how it is re-ordered
*/
Test usort() function : usage variations - string data
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Pass arrays of string data to usort() to test how it is re-ordered
*/
Test usort() function : usage variations - multi-dimensional arrays
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Pass a multi-dimensional array as $array_arg argument to usort()
* to test how array is re-ordered
Test usort() function : usage variations - Anonymous comparison function
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an anonymous comparison function as $cmp_function argument to test behaviour()
*/
Test usort() function : usage variations - use built in functions as $cmp_function arg
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Test usort() when comparison function is:
* 1. a built in comparison function
Test usort() function : usage variations - referenced variables
--FILE--
<?php
-/* Prototype : bool usort(array $array_arg, string $cmp_function)
- * Description: Sort an array by values using a user-defined comparison function
- * Source code: ext/standard/array.c
- */
-
/*
* Pass an array of referenced variables as $array_arg to test behaviour
*/
Test class_exists() function : basic functionality
--FILE--
<?php
-/* Prototype : proto bool class_exists(string classname [, bool autoload])
- * Description: Checks if the class exists
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing class_exists() : basic functionality ***\n";
spl_autoload_register(function ($className) {
Test class_exists() function : usage variations - case sensitivity
--FILE--
<?php
-/* Prototype : proto bool class_exists(string classname [, bool autoload])
- * Description: Checks if the class exists
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
class caseSensitivityTest {}
var_dump(class_exists('casesensitivitytest'));
Test get_class_methods() function : basic functionality
--FILE--
<?php
-/* Prototype : proto array get_class_methods(mixed class)
- * Description: Returns an array of method names for class or class instance.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
/*
* Test basic behaviour with existing class and non-existent class.
*/
Test get_class_methods() function : basic functionality
--FILE--
<?php
-/* Prototype : proto array get_class_methods(mixed class)
- * Description: Returns an array of method names for class or class instance.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
/*
* Test behaviour with various visibility levels.
*/
Test get_class_methods() function : basic functionality
--FILE--
<?php
-/* Prototype : proto array get_class_methods(mixed class)
- * Description: Returns an array of method names for class or class instance.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
/*
* Test behaviour with interfaces.
*/
Test get_class_methods() function : usage variations - unexpected types
--FILE--
<?php
-/* Prototype : proto array get_class_methods(mixed class)
- * Description: Returns an array of method names for class or class instance.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
-
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
echo "Error: $err_no - $err_msg\n";
}
Test get_class_methods() function : usage variations - case sensitivity
--FILE--
<?php
-/* Prototype : proto array get_class_methods(mixed class)
- * Description: Returns an array of method names for class or class instance.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing get_class_methods() : usage variations ***\n";
class caseSensitivityTest {
Test get_class() function : usage variations - passing unexpected types.
--FILE--
<?php
-/* Prototype : proto string get_class([object object])
- * Description: Retrieves the class name
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing get_class() : usage variations ***\n";
// Note: basic use cases in Zend/tests/009.phpt
Test get_class() function : usage variations - ensure class name case is preserved.
--FILE--
<?php
-/* Prototype : proto string get_class([object object])
- * Description: Retrieves the class name
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
class caseSensitivityTest {}
var_dump(get_class(new casesensitivitytest));
Test get_class_vars() function : testing visibility
--FILE--
<?php
-/* Prototype : array get_class_vars(string class_name)
- * Description: Returns an array of default properties of the class.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
class Ancestor {
function test() {
var_dump(get_class_vars("Tester"));
Test get_declared_classes() function : basic functionality
--FILE--
<?php
-/* Prototype : proto array get_declared_classes()
- * Description: Returns an array of all declared classes.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
-
echo "*** Testing get_declared_classes() : basic functionality ***\n";
// Zero arguments
Test get_declared_classes() function : testing autoloaded classes
--FILE--
<?php
-/* Prototype : proto array get_declared_classes()
- * Description: Returns an array of all declared classes.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
-
echo "*** Testing get_declared_classes() : testing autoloaded classes ***\n";
spl_autoload_register(function ($class_name) {
Test get_declared_interfaces() function : basic functionality
--FILE--
<?php
-/* Prototype : proto array get_declared_interfaces()
- * Description: Returns an array of all declared interfaces.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
-
echo "*** Testing get_declared_interfaces() : basic functionality ***\n";
// Zero arguments
Test get_declared_interfaces() function : autoloading of interfaces
--FILE--
<?php
-/* Prototype : proto array get_declared_interfaces()
- * Description: Returns an array of all declared interfaces.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
-
echo "*** Testing get_declared_interfaces() : autoloading of interfaces ***\n";
spl_autoload_register(function ($class_name) {
Test get_declared_traits() function : basic functionality
--FILE--
<?php
-/* Prototype : proto array get_declared_traits()
- * Description: Returns an array of all declared traits.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
-
echo "*** Testing get_declared_traits() : basic functionality ***\n";
trait MyTrait {}
Test get_declared_traits() function : testing autoloaded traits
--FILE--
<?php
-/* Prototype : proto array get_declared_traits()
- * Description: Returns an array of all declared traits.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
-
echo "*** Testing get_declared_traits() : testing autoloaded traits ***\n";
spl_autoload_register(function ($trait_name) {
get_object_vars(): visibility from static methods (target object passed as arg)
--FILE--
<?php
-/* Prototype : proto array get_object_vars(object obj)
- * Description: Returns an array of object properties
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
Class A {
private $hiddenPriv = 'A::hiddenPriv';
get_object_vars(): visibility from non static methods (target object passed as arg)
--FILE--
<?php
-/* Prototype : proto array get_object_vars(object obj)
- * Description: Returns an array of object properties
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
Class A {
private $hiddenPriv = 'A::hiddenPriv';
get_object_vars() - ensure statics are not shown
--FILE--
<?php
-/* Prototype : proto array get_object_vars(object obj)
- * Description: Returns an array of object properties
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
Class A {
public static $var = 'hello';
}
get_object_vars() - ensure references are preserved
--FILE--
<?php
-/* Prototype : proto array get_object_vars(object obj)
- * Description: Returns an array of object properties
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
$obj = new stdClass;
var_dump(get_object_vars($obj));
Test get_parent_class() function : variation - case sensitivity
--FILE--
<?php
-/* Prototype : proto string get_parent_class([mixed object])
- * Description: Retrieves the parent class name for object or class or current scope.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
// Note: basic use cases in Zend/tests/010.phpt
echo "*** Testing get_parent_class() : variation ***\n";
Test get_parent_class() function : usage variations - unexpected argument type.
--FILE--
<?php
-/* Prototype : proto string get_parent_class([mixed object])
- * Description: Retrieves the parent class name for object or class or current scope.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
spl_autoload_register(function ($className) {
echo "In autoload($className)\n";
});
Test interface_exists() function : autoloaded interface
--FILE--
<?php
-/* Prototype : bool interface_exists(string classname [, bool autoload])
- * Description: Checks if the class exists
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing interface_exists() : autoloaded interface ***\n";
spl_autoload_register(function ($class_name) {
Test interface_exists() function : test autoload default value
--FILE--
<?php
-/* Prototype : bool interface_exists(string classname [, bool autoload])
- * Description: Checks if the class exists
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing interface_exists() : test autoload default value ***\n";
spl_autoload_register(function ($class_name) {
Test is_a() function : usage variations - wrong type for arg 1
--FILE--
<?php
-/* Prototype : proto bool is_a(object object, string class_name)
- * Description: Returns true if the object is of this class or has this class as one of its parents
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
// Note: basic use cases in Zend/tests/is_a.phpt
echo "*** Testing is_a() : usage variations ***\n";
Test is_a() function : usage variations - case sensitivity
--FILE--
<?php
-/* Prototype : proto bool is_a(object object, string class_name)
- * Description: Returns true if the object is of this class or has this class as one of its parents
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing is_a() : usage variations ***\n";
class caseSensitivityTest {}
Test is_subclass_of() function : usage variations - unexpected type for arg 1
--FILE--
<?php
-/* Prototype : proto bool is_subclass_of(object object, string class_name)
- * Description: Returns true if the object has this class as one of its parents
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
// Note: basic use cases in Zend/tests/is_a.phpt
spl_autoload_register(function ($className) {
echo "In autoload($className)\n";
Test is_subclass_of() function : usage variations - case sensitivity
--FILE--
<?php
-/* Prototype : proto bool is_subclass_of(object object, string class_name)
- * Description: Returns true if the object has this class as one of its parents
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing is_subclass_of() : usage variations ***\n";
echo "*** Testing is_a() : usage variations ***\n";
Test is_subclass_of() function : usage variations - unexpected type for arg 1 with valid class in arg 2.
--FILE--
<?php
-/* Prototype : proto bool is_subclass_of(object object, string class_name)
- * Description: Returns true if the object has this class as one of its parents
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
// Note: basic use cases in Zend/tests/is_a.phpt
spl_autoload_register(function ($className) {
echo "In autoload($className)\n";
method_exists() on userspace classes; static & non-static methods with various visibilities.
--FILE--
<?php
-/* Prototype : proto bool is_subclass_of(object object, string class_name)
- * Description: Returns true if the object has this class as one of its parents
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
Class B {
public function inherit_pub() {}
protected function inherit_prot() {}
method_exists() on internal classes
--FILE--
<?php
-/* Prototype : proto bool is_subclass_of(object object, string class_name)
- * Description: Returns true if the object has this class as one of its parents
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo " ---(Internal classes, using string class name)---\n";
echo "Does exception::getmessage exist? ";
var_dump(method_exists("exception", "getmessage"));
method_exists() on non-existent class, with __autoload().
--FILE--
<?php
-/* Prototype : proto bool is_subclass_of(object object, string class_name)
- * Description: Returns true if the object has this class as one of its parents
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
spl_autoload_register(function ($name) {
echo "In autoload($name)\n";
});
Test method_exists() function : usage variations - unexpected type for arg 1
--FILE--
<?php
-/* Prototype : proto bool method_exists(object object, string method)
- * Description: Checks if the class method exists
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
spl_autoload_register(function ($className) {
echo "In autoload($className)\n";
});
Test method_exists() function : variation - Case sensitivity
--FILE--
<?php
-/* Prototype : proto bool method_exists(object object, string method)
- * Description: Checks if the class method exists
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing method_exists() : variation ***\n";
Class caseSensitivityTest {
Test property_exists() function : error conditions
--FILE--
<?php
-/* Prototype : bool property_exists(mixed object_or_class, string property_name)
- * Description: Checks if the object or class has a property
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing property_exists() : error conditions ***\n";
echo "\n-- Testing property_exists() function with incorrect arguments --\n";
Test property_exists() function : class auto loading
--FILE--
<?php
-/* Prototype : bool property_exists(mixed object_or_class, string property_name)
- * Description: Checks if the object or class has a property
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing property_exists() : class auto loading ***\n";
spl_autoload_register(function ($class_name) {
Test trait_exists() function : usage variations - case sensitivity
--FILE--
<?php
-/* Prototype : proto bool trait_exists(string traitname [, bool autoload])
- * Description: Checks if the trait exists
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
trait caseSensitivityTest {}
var_dump(trait_exists('casesensitivitytest'));
Test trait_exists() function : basic functionality
--FILE--
<?php
-/* Prototype : proto bool trait_exists(string traitname [, bool autoload])
- * Description: Checks if the trait exists
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "*** Testing trait_exists() : basic functionality ***\n";
spl_autoload_register(function ($traitName) {
?>
--FILE--
<?php
-/* Prototype : bool chdir(string $directory)
- * Description: Change the current directory
- * Source code: ext/standard/dir.c
- */
-
/*
* Test basic functionality of chdir() with absolute and relative paths
*/
Test chdir() function : basic functionality
--FILE--
<?php
-/* Prototype : bool chdir(string $directory)
- * Description: Change the current directory
- * Source code: ext/standard/dir.c
- */
-
/*
* Test basic functionality of chdir() with absolute and relative paths
*/
?>
--FILE--
<?php
-/* Prototype : bool chdir(string $directory)
- * Description: Change the current directory
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory that does not exist as $directory to chdir() to test behaviour
*/
Test chdir() function : error conditions - Non-existent directory
--FILE--
<?php
-/* Prototype : bool chdir(string $directory)
- * Description: Change the current directory
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory that does not exist as $directory to chdir() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : bool chdir(string $directory)
- * Description: Change the current directory
- * Source code: ext/standard/dir.c
- */
-
/*
* Test chdir() with variations of relative paths
*/
Test chdir() function : usage variations - relative paths
--FILE--
<?php
-/* Prototype : bool chdir(string $directory)
- * Description: Change the current directory
- * Source code: ext/standard/dir.c
- */
-
/*
* Test chdir() with variations of relative paths
*/
?>
--FILE--
<?php
-/* Prototype : void closedir([resource $dir_handle])
- * Description: Close directory connection identified by the dir_handle
- * Source code: ext/standard/dir.c
- * Alias to functions: close
- */
-
/*
* Test basic functionality of closedir()
*/
Test closedir() function : basic functionality
--FILE--
<?php
-/* Prototype : void closedir([resource $dir_handle])
- * Description: Close directory connection identified by the dir_handle
- * Source code: ext/standard/dir.c
- * Alias to functions: close
- */
-
/*
* Test basic functionality of closedir()
*/
?>
--FILE--
<?php
-/* Prototype : void closedir([resource $dir_handle])
- * Description: Close directory connection identified by the dir_handle
- * Source code: ext/standard/dir.c
- * Alias to functions: close
- */
-
/*
* close the directory handle twice using closedir() to test behaviour
*/
Test closedir() function : usage variations - close directory handle twice
--FILE--
<?php
-/* Prototype : void closedir([resource $dir_handle])
- * Description: Close directory connection identified by the dir_handle
- * Source code: ext/standard/dir.c
- * Alias to functions: close
- */
-
/*
* close the directory handle twice using closedir() to test behaviour
*/
Test closedir() function : usage variations - close a file pointer
--FILE--
<?php
-/* Prototype : void closedir([resource $dir_handle])
- * Description: Close directory connection identified by the dir_handle
- * Source code: ext/standard/dir.c
- * Alias to functions: close
- */
-
/*
* Create a file pointer using fopen() then try to close it using closedir()
*/
?>
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
echo "*** Testing dir() : basic functionality ***\n";
// include the file.inc for Function: function create_files()
Test dir() function : basic functionality
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
echo "*** Testing dir() : basic functionality ***\n";
// include the file.inc for Function: function create_files()
?>
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
/*
* Providing various permissions to the directory to be opened and checking
* to see if dir() function opens the directory successfully.
?>
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
/*
* Testing the behavior of dir() function by trying to open a
* directory which is already open.
Test dir() function : usage variations - operate on previously opened directory
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
/*
* Testing the behavior of dir() function by trying to open a
* directory which is already open.
?>
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
/*
* Passing a file as argument to dir() function instead of a directory
* and checking if proper warning message is generated.
?>
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
/*
* Passing a non-existent directory as argument to dir() function
* and checking to see if proper warning message is output.
?>
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
/*
* remove the execute permission from the parent dir and test dir() on child dir
* 1) remove write & execute permission from the 1st parent and test dir()
?>
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
/*
* Create more than one temporary directory & subdirectory and check if dir() function can open
* those directories when wildcard characters are used to refer to them.
?>
--FILE--
<?php
-/*
- * Prototype : object dir(string $directory[, resource $context])
- * Description: Directory class with properties, handle and class and methods read, rewind and close
- * Source code: ext/standard/dir.c
- */
-
/*
* Checking the behavior of dir() function by passing directories which
* have valid and invalid relative path.
?>
--FILE--
<?php
-/* Prototype : mixed getcwd(void)
- * Description: Gets the current directory
- * Source code: ext/standard/dir.c
- */
-
/*
* Test basic functionality of getcwd()
*/
Test getcwd() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed getcwd(void)
- * Description: Gets the current directory
- * Source code: ext/standard/dir.c
- */
-
/*
* Test basic functionality of getcwd()
*/
?>
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Test basic functionality of opendir() with absolute and relative paths as $path argument
*/
Test opendir() function : basic functionality
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Test basic functionality of opendir() with absolute and relative paths as $path argument
*/
?>
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a non-existent directory as $path argument to opendir() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Call opendir() twice with the same directory as $path argument
*/
Test opendir() function : usage variations - open a directory twice
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Call opendir() twice with the same directory as $path argument
*/
?>
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Test opendir() with different relative paths as $path argument
*/
Test opendir() function : usage variations - different relative paths
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Test opendir() with different relative paths as $path argument
*/
?>
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* remove the execute permission from the parent dir and test opendir() on child dir
* 1) remove write & execute permission from the 1st parent and test opendir()
?>
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass paths containing wildcards to test if opendir() recognises them
*/
?>
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass paths containing wildcards to test if opendir() recognises them
*/
?>
--FILE--
<?php
-/* Prototype : mixed opendir(string $path[, resource $context])
- * Description: Open a directory and return a dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Open a directory using opendir() with different directory permissions
*/
?>
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.C
- */
-
/*
* Test basic functionality of readdir()
*/
Test readdir() function : basic functionality
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.C
- */
-
/*
* Test basic functionality of readdir()
*/
?>
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass readdir() a directory handle pointing to an empty directory to test behaviour
*/
Test readdir() function : usage variations - empty directories
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass readdir() a directory handle pointing to an empty directory to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory handle pointing to a directory that has a sub-directory
* to test behaviour of readdir()
Test readdir() function : usage variations - sub-directories
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory handle pointing to a directory that has a sub-directory
* to test behaviour of readdir()
?>
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory handle pointing to a directory that contains
* files with different file names to test how readdir() reads them
Test readdir() function : usage variations - different file names
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory handle pointing to a directory that contains
* files with different file names to test how readdir() reads them
?>
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Open a directory with different premissions then try to read it
* to test behaviour of readdir()
?>
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Open two directory handles on the same directory and pass both
* to readdir() to test behaviour
Test readdir() function : usage variations - operate on previously opened directory
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Open two directory handles on the same directory and pass both
* to readdir() to test behaviour
Test readdir() function : usage variations - use file pointers
--FILE--
<?php
-/* Prototype : string readdir([resource $dir_handle])
- * Description: Read directory entry from dir_handle
- * Source code: ext/standard/dir.c
- */
-
/*
* Open a file pointer using fopen and pass to readdir() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : void rewinddir([resource $dir_handle])
- * Description: Rewind dir_handle back to the start
- * Source code: ext/standard/dir.c
- * Alias to functions: rewind
- */
-
/*
* Test basic functionality of rewinddir()
*/
Test rewinddir() function : basic functionality
--FILE--
<?php
-/* Prototype : void rewinddir([resource $dir_handle])
- * Description: Rewind dir_handle back to the start
- * Source code: ext/standard/dir.c
- * Alias to functions: rewind
- */
-
/*
* Test basic functionality of rewinddir()
*/
?>
--FILE--
<?php
-/* Prototype : void rewinddir([resource $dir_handle])
- * Description: Rewind dir_handle back to the start
- * Source code: ext/standard/dir.c
- * Alias to functions: rewind
- */
-
/*
* Open and close a directory handle then call rewinddir() to test behaviour
*/
Test rewinddir() function : usage variations - operate on a closed directory
--FILE--
<?php
-/* Prototype : void rewinddir([resource $dir_handle])
- * Description: Rewind dir_handle back to the start
- * Source code: ext/standard/dir.c
- * Alias to functions: rewind
- */
-
/*
* Open and close a directory handle then call rewinddir() to test behaviour
*/
Test rewinddir() function : usage variations - file pointers
--FILE--
<?php
-/* Prototype : void rewinddir([resource $dir_handle])
- * Description: Rewind dir_handle back to the start
- * Source code: ext/standard/dir.c
- * Alias to functions: rewind
- */
-
/*
* Pass a file pointer to rewinddir() to test behaviour
*/
?>
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Test basic functionality of scandir()
*/
Test scandir() function : basic functionality
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Test basic functionality of scandir()
*/
?>
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory that does not exist to scandir() to test error messages
*/
?>
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
printf("SCANDIR_SORT_ASCENDING: %d\n", SCANDIR_SORT_ASCENDING);
printf("SCANDIR_SORT_DESCENDING: %d\n", SCANDIR_SORT_DESCENDING);
printf("SCANDIR_SORT_NONE: %d\n", SCANDIR_SORT_NONE);
Test scandir() function : usage variations - different sorting constants
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
printf("SCANDIR_SORT_ASCENDING: %d\n", SCANDIR_SORT_ASCENDING);
printf("SCANDIR_SORT_DESCENDING: %d\n", SCANDIR_SORT_DESCENDING);
printf("SCANDIR_SORT_NONE: %d\n", SCANDIR_SORT_NONE);
?>
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Test scandir() with relative paths as $dir argument
*/
Test scandir() function : usage variations - different relative paths
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Test scandir() with relative paths as $dir argument
*/
?>
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* remove the execute permission from the parent dir and test scandir() on child dir
* 1. remove write & execute permission from the 1st parent and test scandir()
?>
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory path using wildcards as $dir argument to test how scandir() behaves
*/
?>
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Create directories with different permissions to test whether scandir() can access them
*/
?>
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory containing files with different types of names to test how scandir()
* reads them
Test scandir() function : usage variations - different file names
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass a directory containing files with different types of names to test how scandir()
* reads them
?>
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass different integers as $sorting_order argument to test how scandir()
* re-orders the array
Test scandir() function : usage variations - different ints as $sorting_order arg
--FILE--
<?php
-/* Prototype : array scandir(string $dir [, int $sorting_order [, resource $context]])
- * Description: List files & directories inside the specified path
- * Source code: ext/standard/dir.c
- */
-
/*
* Pass different integers as $sorting_order argument to test how scandir()
* re-orders the array
--FILE--
<?php
/*
- * Prototype: object dir(string directory[, resource context])
* Description: Directory class with properties, handle and class and methods read, rewind and close
* Class is defined in ext/standard/dir.c
*/
Test fileatime(), filemtime(), filectime() & touch() functions : basic functionality
--FILE--
<?php
-/*
- Prototype: int fileatime ( string $filename );
- Description: Returns the time the file was last accessed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
-
- Prototype: int filemtime ( string $filename );
- Description: Returns the time the file was last modified, or FALSE
- in case of an error.
-
- Prototype: int filectime ( string $filename );
- Description: Returns the time the file was last changed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
-
- Prototype: bool touch ( string $filename [, int $time [, int $atime]] );
- Description: Attempts to set the access and modification times of the file
- named in the filename parameter to the value given in time.
-*/
echo "*** Testing the basic functionality with file ***\n";
print( @date('Y:M:D:H:i:s', fileatime(__FILE__)) )."\n";
Test fileatime(), filemtime(), filectime() & touch() functions : error conditions
--FILE--
<?php
-/*
- Prototype: int fileatime ( string $filename );
- Description: Returns the time the file was last accessed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
-
- Prototype: int filemtime ( string $filename );
- Description: Returns the time the file was last modified, or FALSE
- in case of an error.
-
- Prototype: int filectime ( string $filename );
- Description: Returns the time the file was last changed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
-
- Prototype: bool touch ( string $filename [, int $time [, int $atime]] );
- Description: Attempts to set the access and modification times of the file
- named in the filename parameter to the value given in time.
-*/
echo "*** Testing error conditions ***\n";
?>
--FILE--
<?php
-/*
- Prototype: int fileatime ( string $filename );
- Description: Returns the time the file was last accessed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
-
- Prototype: int filemtime ( string $filename );
- Description: Returns the time the file was last modified, or FALSE
- in case of an error.
-
- Prototype: int filectime ( string $filename );
- Description: Returns the time the file was last changed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
-
- Prototype: bool touch ( string $filename [, int $time [, int $atime]] );
- Description: Attempts to set the access and modification times of the file
- named in the filename parameter to the value given in time.
-*/
-
-/*
- Prototype: void stat_fn(string $filename);
- Description: Prints access, modification and change times of a file
-*/
+
function stat_fn( $filename ) {
echo "-- File access time is => ";
print( @date( 'Y:M:D:H:i:s', fileatime($filename) ) )."\n";
?>
--FILE--
<?php
-/*
- Prototype: int fileatime ( string $filename );
- Description: Returns the time the file was last accessed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
-
- Prototype: int filemtime ( string $filename );
- Description: Returns the time the file was last modified, or FALSE
- in case of an error.
-
- Prototype: int filectime ( string $filename );
- Description: Returns the time the file was last changed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
-
- Prototype: bool touch ( string $filename [, int $time [, int $atime]] );
- Description: Attempts to set the access and modification times of the file
- named in the filename parameter to the value given in time.
-*/
-
-/*
- Prototype: void stat_fn(string $filename);
- Description: Prints access, modification and change times of a file
-*/
+
function stat_fn( $filename ) {
echo "\n-- File '$filename' --\n";
echo "-- File access time is => ";
?>
--FILE--
<?php
-/*
- Prototype: int fileatime ( string $filename );
- Description: Returns the time the file was last accessed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
- Prototype: int filemtime ( string $filename );
- Description: Returns the time the file was last modified, or FALSE
- in case of an error.
-
- Prototype: int filectime ( string $filename );
- Description: Returns the time the file was last changed, or FALSE
- in case of an error. The time is returned as a Unix timestamp.
-
- Prototype: bool touch ( string $filename [, int $time [, int $atime]] );
- Description: Attempts to set the access and modification times of the file
- named in the filename parameter to the value given in time.
-*/
-
-/*
- Prototype: void stat_fn(string $filename);
- Description: Prints access, modification and change times of a file
-*/
function stat_fn( $filename ) {
echo "\n-- File '$filename' --\n";
echo "-- File access time is => ";
?>
--FILE--
<?php
-/*
- Prototype: int fileperms ( string $filename );
- Description: Returns the permissions on the file, or FALSE in case of an error
-
- Prototype: bool chmod ( string $filename, int $mode );
- Description: Attempts to change the mode of the file specified by
- filename to that given in mode
-*/
$path = __DIR__;
echo "*** Testing fileperms(), chmod() with files and dirs ***\n";
?>
--FILE--
<?php
-/*
- Prototype: int fileperms ( string $filename )
- Description: Returns the permissions on the file, or FALSE in case of an error
-
- Prototype: bool chmod ( string $filename, int $mode )
- Description: Attempts to change the mode of the file specified by
- filename to that given in mode
-*/
-
echo "*** Testing error conditions for fileperms(), chmod() ***\n";
/* With standard files and dirs */
?>
--FILE--
<?php
-/*
- Prototype: int fileperms ( string $filename );
- Description: Returns the permissions on the file, or FALSE in case of an error
-
- Prototype: bool chmod ( string $filename, int $mode );
- Description: Attempts to change the mode of the file specified by
- filename to that given in mode
-*/
-
echo "*** Testing fileperms() & chmod() : usage variations ***\n";
$file_name = __DIR__."/006_variation1.tmp";
?>
--FILE--
<?php
-/*
- Prototype: int fileperms ( string $filename );
- Description: Returns the permissions on the file, or FALSE in case of an error
-
- Prototype: bool chmod ( string $filename, int $mode );
- Description: Attempts to change the mode of the file specified by
- filename to that given in mode
-*/
-
/* Testing with miscellaneous Permission */
echo "*** Testing fileperms() & chmod() : usage variations ***\n";
Test fopen(), fclose() & feof() functions: basic functionality
--FILE--
<?php
-/*
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-
- Prototype: bool feof ( resource $handle );
- Description: Tests for end-of-file on a file pointer
-*/
-
echo "*** Testing basic operations of fopen() and fclose() functions ***\n";
$modes = array(
"w",
Test fopen and fclose() functions - usage variations - "r" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "r" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "r+t" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "r+t" mode,
checking for the file creation, write & read operations,
?>
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "wt" mode,
checking for the file creation, write & read operations,
?>
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "wt" mode,
checking for the file creation, write & read operations,
?>
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "wt" mode,
checking for the file creation, write & read operations,
?>
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "w+t" mode,
checking for the file creation, write & read operations,
?>
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "w+t" mode,
checking for the file creation, write & read operations,
?>
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "at" mode,
checking for the file creation, write & read operations,
?>
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "at" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "a+t" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "a+t" mode,
checking for the file creation, write & read operations,
<?php
/*
fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
+
Description: Opens file or URL.
*/
/*
fclose() function:
- Prototype: bool fclose ( resource $handle );
Description: Closes an open file pointer
*/
Test fopen and fclose() functions - usage variations - "x+t" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "x+t" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "rb" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "rb" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "r+b" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "r+b" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "wb" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "wb" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "r+" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "r+" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "w+b" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "w+b" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "ab" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "ab" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "a+b" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "a+b" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "xb" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "xb" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "x+b" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "x+b" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "w" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "w" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "w+" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "w+" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "a" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "a" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "a+" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "a+" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "x" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "x" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "x+" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "x+" mode,
checking for the file creation, write & read operations,
Test fopen and fclose() functions - usage variations - "rt" mode
--FILE--
<?php
-/*
- fopen() function:
- Prototype: resource fopen(string $filename, string $mode
- [, bool $use_include_path [, resource $context]] );
- Description: Opens file or URL.
-*/
-/*
- fclose() function:
- Prototype: bool fclose ( resource $handle );
- Description: Closes an open file pointer
-*/
/* Test fopen() and fclose(): Opening the file in "rt" mode,
checking for the file creation, write & read operations,
--FILE--
<?php
/*
- * proto string basename(string path [, string suffix])
* Function is implemented in ext/standard/string.c
*/
$file_paths = array (
Test chmod() function : error conditions
--FILE--
<?php
-/* Prototype : bool chmod(string filename, int mode)
- * Description: Change file mode
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
echo "*** Testing chmod() : error conditions ***\n";
// testing chmod with a non-existing file
Test copy() function: basic functionality
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- * Description: Makes a copy of the file source to dest.
- * Returns TRUE on success or FALSE on failure.
- */
-
echo "*** Testing copy() function: to copy file from source to destination --\n";
var_dump( file_exists(__FILE__) );
Test copy() function: error conditions
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- * Description: Makes a copy of the file source to dest.
- * Returns TRUE on success or FALSE on failure.
- */
-
echo "*** Testing copy() function: error conditions --\n";
/* Invalid args */
var_dump( copy("/no/file", "file") );
Test copy() function: usage variations - destination file names(numerics/strings)
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: In creation of destination file names containing numerics/strings
and checking the existence and size of destination files
*/
Test copy() function: usage variations - identical names
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): Try copying source file to desntination file, where destination file name is identical to source name */
$file_path = __DIR__;
Test copy() function: usage variations - existing dir as destination
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): Trying to copy the file to a destination, where destination is an existing dir */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): Trying to create a copy of an existing dir */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): Trying to create a copy of an existing dir */
$file_path = __DIR__;
Test copy() function: usage variations - src as dir and dest as an existing file(Bug #42243)
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): Trying to copy dir to an existing file */
echo "*** Test copy() function: Trying to copy dir to file ***\n";
Test copy() function: usage variations - non existing src/dest
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): Trying to create a copy of non-existing source in an existing destination
and an existing source in non-existing destination */
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): Trying to create a copy of file in a dir which doesn't have write permissions */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: Trying to create copy of source file
into different destination dir paths given in various notations */
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: Trying to create copy of source file
into different destination dir paths given in various notations */
Test copy() function: usage variations - wildcard chars in source
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): Trying to copy the source file which is given with the combination of wild-card chars */
$file_path = __DIR__;
Test copy() function: usage variations - stat after copy
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): checking stat of file before and after after copy operation */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: In creation of destination file names containing special characters
and checking the existence and size of destination files
*/
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: In creation of destination file names containing special characters
and checking the existence and size of destination files
*/
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: In creation of destination file names containing special characters
and checking the existence and size of destination files
*/
obscure_filename
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: In creation of destination file names containing white spaces
and checking the existence and size of destination files
*/
obscure_filename
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: In creation of destination file names containing white spaces
and checking the existence and size of destination files
*/
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: In creation of destination file names with empty string, nulls & bools
and checking the existence and size of destination files
*/
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: Checking case sensitivity in creation of destination file names
and the existence and size of destination files
*/
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: Checking case sensitivity in creation of destination file names
and the existence and size of destination files
*/
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: Trying to create copy of source file
into different destination dir paths given in various notations */
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: Trying to create copy of source file
into different destination dir paths given in various notations */
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy() function: Trying to create copy of links */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Trying to copy the links across dir paths given in various notations
and dirs having limited access */
?>
--FILE--
<?php
-/* Prototype: bool copy ( string $source, string $dest );
- Description: Makes a copy of the file source to dest.
- Returns TRUE on success or FALSE on failure.
-*/
-
/* Test copy(): Trying to copy source file to destination file with and without write permissions */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype : string dirname(string path)
- * Description: Returns the directory name component of the path
- * Source code: ext/standard/string.c
- * Alias to functions:
- */
-
echo "*** Testing dirname() : basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype : string dirname(string path)
- * Description: Returns the directory name component of the path
- * Source code: ext/standard/string.c
- * Alias to functions:
- */
-
echo "*** Testing dirname() : basic functionality ***\n";
memory_limit=32M
--FILE--
<?php
-/*
- * Prototype: float disk_free_space( string directory )
- * Description: Given a string containing a directory, this function
- * will return the number of bytes available on the corresponding
- * filesystem or disk partition
- */
-
$file_path = __DIR__;
echo "*** Testing with existing directory ***\n";
?>
--FILE--
<?php
-/*
- * Prototype: float disk_free_space( string directory )
- * Description: Given a string containing a directory, this function will
- * return the number of bytes available on the corresponding
- * filesystem or disk partition
- */
-
echo "*** Testing error conditions ***\n";
$file_path = __DIR__;
?>
--FILE--
<?php
-/*
- * Prototype: float disk_free_space( string directory )
- * Description: Given a string containing a directory, this function will
- * return the number of bytes available on the corresponding
- * filesystem or disk partition
- */
-
echo "*** Testing error conditions ***\n";
$file_path = __DIR__;
Test disk_free_space and its alias diskfreespace() functions : Usage Variations
--FILE--
<?php
-/*
- * Prototype: float disk_free_space( string directory )
- * Description: Given a string containing a directory, this function
- * will return the number of bytes available on the corresponding
- * filesystem or disk partition
- */
-
$file_path = __DIR__;
echo "*** Testing with a directory ***\n";
disk_total_space
--FILE--
<?php
-/*
- * Prototype: float disk_total_space( string $directory );
- * Description: given a string containing a directory, this function will
- * return the total number of bytes on the corresponding filesyatem
- * or disk partition.
- */
-
$file_path = __DIR__;
echo "*** Testing with normal directory ***\n";
disk_total_space
--FILE--
<?php
-/*
- * Prototype: float disk_total_space( string $directory );
- * Description: given a string containing a directory, this function
- * will return the total number of bytes on the corresponding
- * filesystem or disk partition
- */
-
echo "*** Testing error conditions ***\n";
$file_path = __DIR__;
disk_total_space
--FILE--
<?php
-/*
- * Prototype: float disk_total_space( string $directory );
- * Description: given a string containing a directory, this function
- * will return the total number of bytes on the corresponding
- * filesystem or disk partition
- */
-
echo "*** Testing error conditions ***\n";
$file_path = __DIR__;
disk_total_space
--FILE--
<?php
-/*
- * Prototype: float disk_total_space( string directory )
- * Description: given a string containing a directory, this function
- * will return the total number of bytes on the corresponding
- * filesystem or disk partition.
- */
-
$file_path = __DIR__;
echo "*** Testing with a directory ***\n";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : proto bool feof(resource fp)
- * Description: Test for end-of-file on a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions: gzeof
- */
-
echo "*** Testing feof() : basic functionality ***\n";
$tmpFile1 = __FILE__.".tmp1";
$h = fopen($tmpFile1, 'wb');
Test fflush() function: basic functionality
--FILE--
<?php
-/* Prototype: bool fflush ( resource $handle );
- Description: Flushes the output to a file
-*/
echo "*** Testing fflush(): writing to a file and reading the contents ***\n";
$data = <<<EOD
?>
--FILE--
<?php
-/* Prototype: bool fflush ( resource $handle );
- Description: Flushes the output to a file
-*/
/* test fflush() with handle to the files opened in different modes */
?>
--FILE--
<?php
-/* Prototype: bool fflush ( resource $handle );
- Description: Flushes the output to a file
-*/
/* test fflush() with handle to the files opened in different modes */
?>
--FILE--
<?php
-/* Prototype: bool fflush ( resource $handle );
- Description: Flushes the output to a file
-*/
/* test fflush() with handle of files opened in different modes */
?>
--FILE--
<?php
-/* Prototype: bool fflush ( resource $handle );
- Description: Flushes the output to a file
-*/
/* test fflush() with handle to symbollic link */
?>
--FILE--
<?php
-/* Prototype: bool fflush ( resource $handle );
- Description: Flushes the output to a file
-*/
/* test fflush() with handle to hard links as resource */
Test fflush() function: usage variations - file opened in read-only mode
--FILE--
<?php
-/* Prototype: bool fflush ( resource $handle );
- Description: Flushes the output to a file
-*/
/* test fflush() with handle to a file opened in read-only mode as resource */
Test fgetc() function : basic functionality
--FILE--
<?php
-/*
- Prototype: string fgetc ( resource $handle );
- Description: Gets character from file pointer
-*/
// include the header for common test function
include ("file.inc");
Test fgetc() function : usage variations - read when file pointer at EOF
--FILE--
<?php
-/*
- Prototype: string fgetc ( resource $handle );
- Description: Gets character from file pointer
-*/
// include the header for common test function
include ("file.inc");
Test fgetc() function : usage variations - closed handle
--FILE--
<?php
-/*
- Prototype: string fgetc ( resource $handle );
- Description: Gets character from file pointer
-*/
-
/* try reading a char using fgetc() using invalid handles
- closed file handle
- unset file handle
--FILE--
<?php
/*
- Prototype: string fgetc ( resource $handle );
Description: Gets character from file pointer
*/
Test fgetc() function : usage variations - different read modes
--FILE--
<?php
-/*
- Prototype: string fgetc ( resource $handle );
- Description: Gets character from file pointer
-*/
-
/* read from fie using fgetc, file opened using different
read read modes */
--FILE--
<?php
/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
Description: Gets line from file pointer and parse for CSV fields
*/
Test fgetcsv() : usage variations - file pointer pointing to EOF
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() by reading from a file when the file pointer is pointing to end of file */
echo "*** Testing fgetcsv() : with file pointer pointing to EOF ***\n";
Test fgetcsv() : usage variations - with different enclosure but same delimiter
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() by reading from a file when different enclosure that is not
present in the data being read and delimiter which is present in the data */
Test fgetcsv() : usage variations - two chars as enclosure & delimiter (various read and append modes)
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() by providing two characters for enclosure and delimiter parameters */
echo "*** Testing fgetcsv() : with two chars as enclosure & delimiter ***\n";
Test fgetcsv() : usage variations - with line without any csv fields
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() to read a line from a file which doesn't have any CSV field */
echo "*** Testing fgetcsv() : reading the line which is without csv fields ***\n";
Test fgetcsv() : usage variations - reading the blank line
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() by reading a file containing a blank line */
echo "*** Testing fgetcsv() : reading the blank line ***\n";
Test fgetcsv() : usage variations - with default enclosure
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() to read a file when provided with default enclosure character */
echo "*** Testing fgetcsv() : with default enclosure ***\n";
Test fgetcsv() : usage variations - with default enclosure & length as 0
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() to read a file when provided with default enclosure character
and length value equal to zero
*/
Test fgetcsv() : usage variations - with default enclosure & length less than line size
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() to read a file when provided with default enclosure character
and length value less than the size of line being read
*/
--FILE--
<?php
/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
Description: Gets line from file pointer and parse for CSV fields
*/
Test fgetcsv() : usage variations - with default enclosure & delimiter of two chars
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read a file when provided with default enclosure character
and with delimiter of two characters
Test fgetcsv() : usage variations - with length as 0
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() to rwad from a file with length argument equal to zero */
echo "*** Testing fgetcsv() : with length as 0 ***\n";
Test fgetcsv() : usage variations - with default enclosure, line without any csv fields
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read a line without any csv fields from a file
when provided with default enclosure value
Test fgetcsv() : usage variations - with default enclosure, blank line
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read a file containing blank line when provided with
default enclosure argument
Test fgetcsv() : usage variations - with default enclosure, file pointer pointing at end of file
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read a file whose file pointer is pointing to end of file
and fgetcsv() provided with default enclosure argument
Test fgetcsv() : usage variations - empty file
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/* Testing fgetcsv() to read from an empty file */
echo "*** Testing fgetcsv() : reading from file which is having zero content ***\n";
Test fgetcsv() : usage variations - two chars as enclosure & delimiter (various write modes)
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read from a file opened in various write modes and
enclosure argument with two characters
Test fgetcsv() : usage variations - with only file handle as argument, file pointer pointing at end of file
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read a file whose file pointer is pointing to end of file
and fgetcsv() provided with only file handle in its argument
Test fgetcsv() : usage variations - with file handle and length, file pointer pointing at end of file
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read a file whose file pointer is pointing to end of file
and fgetcsv() provided with file handle and length arguments
Test fgetcsv() : usage variations - with length and enclosure, file pointer pointing at end of file
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read a file whose file pointer is pointing to end of file
and fgetcsv() provided with enclosure argument
Test fgetcsv() : usage variations - with length less than line size
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read from a file when provided with the length argument
value less than the line size
--FILE--
<?php
/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
Description: Gets line from file pointer and parse for CSV fields
*/
Test fgetcsv() : usage variations - with different delimiter and enclosure
--FILE--
<?php
-/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
- Description: Gets line from file pointer and parse for CSV fields
-*/
-
/*
Testing fgetcsv() to read from a file when provided with values of delimiter and
enclosure that are not present in the line read by fgetcsv()
--FILE--
<?php
/*
- Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
Description: Gets line from file pointer and parse for CSV fields
*/
Test fgets() function : basic functionality
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
-
// include the file.inc for common test functions
include ("file.inc");
Test fgets() function : error conditions
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets line from file pointer
-*/
-
echo "*** Testing error conditions ***\n";
$fp = fopen(__FILE__, "r");
Test fgets() function : usage variations - write only modes (Bug #42036)
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
/* try fgets on files which are opened in non readable modes
w, wb, wt,
a, ab, at,
Test fgets() function : usage variations - closed handle
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
-
/* try reading a line using fgets() using invalid handles
- closed file handle
- unset file handle
Test fgets() function : usage variations - read with/without length
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
-
// include the file.inc for common test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
-
// include the file.inc for common test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
-
// include the file.inc for common test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
-
// include the file.inc for common test functions
include ("file.inc");
Test fgets() function : usage variations - read beyond filesize
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
-
// include the file.inc for common test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
-
// include the file.inc for common test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: string fgets ( resource $handle [, int $length] );
- Description: Gets a line from file pointer
-*/
-
// include the file.inc for common test functions
include ("file.inc");
--FILE--
<?php
/*
- * Prototype: array file ( string filename [,int use-include_path [,resource context]] );
* Description: Reads entire file into an array
- * Returns the file in an array
*/
require(__DIR__ . '/file.inc');
$file_path = __DIR__;
Test file() function : error conditions
--FILE--
<?php
-/*
- Prototype: array file ( string filename [,int use-include_path [,resource context]] );
- Description: Reads entire file into an array
- Returns the file in an array
-*/
$file_path = __DIR__;
echo "\n*** Testing error conditions ***\n";
$file_handle = fopen($file_path."/file.tmp", "w");
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : proto bool file_exists(string filename)
- * Description: Returns true if filename exists
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
echo "*** Testing file_exists() : usage variations ***\n";
var_dump(file_exists(NULL));
--FILE--
<?php
-/* Prototype: string file_get_contents( string $filename[, bool $use_include_path[,
- * resource $context[, int $offset[, int $maxlen]]]] )
- * Description: Reads entire file into a string
- */
-
$file_path = __DIR__;
include($file_path."/file.inc");
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype: string file_get_contents( string $filename{, bool $use_include_path[,
- * resource $context[, int $offset[, int $maxlen]]]] )
- * Description: Reads entire file into a string
- */
echo "*** Testing error conditions ***\n";
--FILE--
<?php
-/* Prototype: string file_get_contents( string $filename[, bool $use_include_path[,
- * resource $context[, int $offset[, int $maxlen]]]] )
- * Description: Reads entire file into a string
- */
-
-/* Prototype: int file_put_contents( string $filename, mixed $data[, int $flags[, resource $context]] )
- * Description: Write a string to a file
- */
-
$file_path = __DIR__;
include($file_path."/file.inc");
Test file-get_contents() and file_put_contents() functions : error conditions
--FILE--
<?php
-/* Prototype: string file_get_contents( string $filename{, bool $use_include_path[,
- * resource $context[, int $offset[, int $maxlen]]]] )
- * Description: Reads entire file into a string
- */
-
-/* Prototype: int file_put_contents( string $filename, mixed $data[, int $flags[, resource $context]] )
- * Description: Write a string to a file
- */
echo "*** Testing error conditions ***\n";
Test file_get_contents() and file_put_contents() functions : usage variations - all arguments
--FILE--
<?php
-/* Prototype: string file_get_contents( string $filename[, bool $use_include_path[,
- * resource $context[, int $offset[, int $maxlen]]]] )
- * Description: Reads entire file into a string
- */
-/* Prototype: int file_put_contents( string $filename, mixed $data[,int $flags[, resource $context]] )
- * Description: Write a string to a file
- */
/* Testing variation in all argument values */
$file_path = __DIR__;
Test file_get_contents() and file_put_contents() functions : usage variations - use_include_path
--FILE--
<?php
-/* Prototype: string file_get_contents( string $filename[, bool $use_include_path[,
- * resource $context[, int $offset[, int $maxlen]]]] )
- * Description: Reads entire file into a string
- */
-
-/* Prototype: int file_put_contents( string $filename, mixed $data[,int $flags[, resource $context]] )
- * Description: Write a string to a file
- */
/* Testing variation using use_include_path argument */
$file_path = __DIR__;
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
- * Description: Read the entire file into a string
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_get_contents() : variation ***\n";
require_once('fopen_include_path.inc');
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
- * Description: Read the entire file into a string
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_get_contents() : variation ***\n";
?>
--FILE--
<?php
-/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
- * Description: Read the entire file into a string
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_get_contents() : variation ***\n";
$mainDir = "fileGetContentsVar7私はガラスを食べられます.dir";
$subDir = "fileGetContentsVar7Sub私はガラスを食べられます";
?>
--FILE--
<?php
-/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
- * Description: Read the entire file into a string
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_get_contents() : variation ***\n";
$mainDir = "fileGetContentsVar7.dir";
$subDir = "fileGetContentsVar7Sub";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
- * Description: Read the entire file into a string
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_get_contents() : variation ***\n";
$mainDir = "fileGetContentsVar7.dir";
$subDir = "fileGetContentsVar7Sub";
obscure_filename
--FILE--
<?php
-/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
- * Description: Read the entire file into a string
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_get_contents() : variation ***\n";
/* An array of filenames */
obscure_filename
--FILE--
<?php
-/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
- * Description: Read the entire file into a string
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_get_contents() : variation ***\n";
/* An array of filenames */
$names_arr = array(
?>
--FILE--
<?php
-/* Prototype : string file_get_contents(string filename [, bool use_include_path [, resource context [, long offset [, long maxlen]]]])
- * Description: Read the entire file into a string
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_get_contents() : variation ***\n";
$filename = __DIR__.'/fileGetContentsVar9.tmp';
$softlink = __DIR__.'/fileGetContentsVar9.SoftLink';
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
- * Description: Write/Create a file with contents data and return the number of bytes written
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_put_contents() : variation ***\n";
$filename = "FilePutContentsVar1.tmp";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
- * Description: Write/Create a file with contents data and return the number of bytes written
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_put_contents() : usage variation ***\n";
// Define error handler
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
- * Description: Write/Create a file with contents data and return the number of bytes written
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
-
require_once('fopen_include_path.inc');
$thisTestDir = basename(__FILE__, ".php") . ".dir";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
- * Description: Write/Create a file with contents data and return the number of bytes written
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_put_contents() : variation ***\n";
require_once('fopen_include_path.inc');
?>
--FILE--
<?php
-/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
- * Description: Write/Create a file with contents data and return the number of bytes written
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_put_contents() : usage variation ***\n";
$mainDir = "filePutContentsVar7.dir";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
- * Description: Write/Create a file with contents data and return the number of bytes written
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_put_contents() : usage variation ***\n";
$mainDir = "filePutContentsVar7.dir";
obscure_filename
--FILE--
<?php
-/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
- * Description: Write/Create a file with contents data and return the number of bytes written
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_put_contents() : usage variation ***\n";
/* An array of filenames */
obscure_filename
--FILE--
<?php
-/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
- * Description: Write/Create a file with contents data and return the number of bytes written
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_put_contents() : usage variation ***\n";
$dir = __DIR__ . '/file_put_contents_variation8';
?>
--FILE--
<?php
-/* Prototype : int file_put_contents(string file, mixed data [, int flags [, resource context]])
- * Description: Write/Create a file with contents data and return the number of bytes written
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file_put_contents() : usage variation ***\n";
$filename = __DIR__.'/filePutContentsVar9.tmp';
Test file() function : usage variations
--FILE--
<?php
-/*
- * Prototype: array file ( string filename [,int use-include_path [,resource context]] );
- * Description: Reads entire file into an array
- Returns the file in an array
- */
require(__DIR__ . '/file.inc');
$data_array = array( "Garbage data", "Gar\nba\nge d\nata", "Gar\n\nbage \n\n data" );
?>
--FILE--
<?php
-/* Prototype : array file(string filename [, int flags[, resource context]])
- * Description: Read entire file into an array
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file() : variation ***\n";
$mainDir = "fileVar8.dir";
$subDir = "fileVar8Sub";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : array file(string filename [, int flags[, resource context]])
- * Description: Read entire file into an array
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file() : variation ***\n";
$mainDir = "fileVar8.dir";
$subDir = "fileVar8Sub";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : array file(string filename [, int flags[, resource context]])
- * Description: Read entire file into an array
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing file() : variation ***\n";
$testfile = __DIR__."/fileVar9.txt";
?>
--FILE--
<?php
-/* Prototype: int filegroup ( string $filename )
- * Description: Returns the group ID of the file, or FALSE in case of an error.
- */
echo "*** Testing filegroup(): basic functionality ***\n";
Test filegroup() function: error conditions
--FILE--
<?php
-/* Prototype: int filegroup ( string $filename )
- * Description: Returns the group ID of the file, or FALSE in case of an error.
- */
echo "*** Testing filegroup(): error conditions ***\n";
}
--FILE--
<?php
-/* Prototype: int filegroup ( string $filename )
- * Description: Returns the group ID of the file, or FALSE in case of an error.
- */
-
/* Creating soft and hard links to a file and applying filegroup() on links */
$file_path = __DIR__;
obscure_filename
--FILE--
<?php
-/* Prototype: int filegroup ( string $filename )
- * Description: Returns the group ID of the file, or FALSE in case of an error.
- */
-
/* Testing filegroup() with invalid arguments -int, float, bool, NULL, resource */
$file_path = __DIR__;
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype: int filegroup ( string $filename )
- * Description: Returns the group ID of the file, or FALSE in case of an error.
- */
/* Passing file names with different notations, using slashes, wild-card chars */
Test fileinode() function: Basic functionality
--FILE--
<?php
-/*
-Prototype: int fileinode ( string $filename );
-Description: Returns the inode number of the file, or FALSE in case of an error.
-*/
-
echo "*** Testing fileinode() with file, directory ***\n";
/* Getting inode of created file */
Test fileinode() function: Error conditions
--FILE--
<?php
-/*
-Prototype: int fileinode ( string $filename );
-Description: Returns the inode number of the file, or FALSE in case of an error.
-*/
-
echo "*** Testing error conditions of fileinode() ***";
/* Non-existing file or dir */
echo "\n*** Done ***";
--EXPECTF--
*** Testing error conditions of fileinode() ***
-Warning: fileinode(): stat failed for /no/such/file/dir in %s on line 10
+Warning: fileinode(): stat failed for /no/such/file/dir in %s on line %d
bool(false)
-Warning: fileinode(): stat failed for string in %s on line 13
+Warning: fileinode(): stat failed for string in %s on line %d
bool(false)
-Warning: fileinode(): stat failed for 100 in %s on line 14
+Warning: fileinode(): stat failed for 100 in %s on line %d
bool(false)
*** Done ***
?>
--FILE--
<?php
-/*
-Prototype: int fileinode ( string $filename );
-Description: Returns the inode number of the file, or FALSE in case of an error.
-*/
-
echo "*** Testing fileinode() with files, links and directories ***\n";
$file_path = __DIR__;
$file1 = $file_path."/fileinode1_variation.tmp";
}
--FILE--
<?php
-/*
-Prototype: int fileinode ( string $filename );
-Description: Returns the inode number of the file, or FALSE in case of an error.
-*/
-
/* Creating soft and hard links to a file and applying fileinode() on links */
$file_path = __DIR__;
obscure_filename
--FILE--
<?php
-/*
-Prototype: int fileinode ( string $filename );
-Description: Returns the inode number of the file, or FALSE in case of an error.
-*/
-
/* Testing fileinode() with invalid arguments -int, float, bool, NULL, resource */
$file_path = __DIR__;
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/*
-Prototype: int fileinode ( string $filename );
-Description: Returns the inode number of the file, or FALSE in case of an error.
-*/
-
/* Passing file names with different notations, using slashes, wild-card chars */
$file_path = __DIR__;
Test fileowner() function: basic functionality
--FILE--
<?php
-/* Prototype: int fileowner ( string $filename )
- * Description: Returns the user ID of the owner of the file, or
- * FALSE in case of an error.
- */
-
echo "*** Testing fileowner(): basic functionality ***\n";
echo "-- Testing with the file or directory created by owner --\n";
Test of fileowner() function: error conditions
--FILE--
<?php
-/* Prototype: int fileowner ( string $filename )
- * Description: Returns the user ID of the owner of the file, or
- * FALSE in case of an error.
- */
echo "*** Testing fileowner(): error conditions ***\n";
/* Non-existing file or dir */
}
--FILE--
<?php
-/* Prototype: int fileowner ( string $filename )
- * Description: Returns the user ID of the owner of the file, or
- * FALSE in case of an error.
- */
/* Creating soft and hard links to a file and applying fileowner() on links */
obscure_filename
--FILE--
<?php
-/* Prototype: int fileowner ( string $filename )
- * Description: Returns the user ID of the owner of the file, or
- * FALSE in case of an error.
- */
/* Testing fileowner() with invalid arguments -int, float, bool, NULL, resource */
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype: int fileowner ( string $filename )
- * Description: Returns the user ID of the owner of the file, or
- * FALSE in case of an error.
- */
/* Passing file names with different notations, using slashes, wild-card chars */
}
--FILE--
<?php
-/* Prototype: int fileperms ( string $filename )
- * Description: Returns the group ID of the file, or FALSE in case of an error.
- */
/* Creating soft and hard links to a file and applying fileperms() on links */
obscure_filename
--FILE--
<?php
-/* Prototype: int fileperms ( string $filename )
- * Description: Returns the group ID of the file, or FALSE in case of an error.
- */
-
/* Testing fileperms() with invalid arguments -int, float, bool, NULL, resource */
$file_path = __DIR__;
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype: int fileperms ( string $filename )
- * Description: Returns the group ID of the file, or FALSE in case of an error.
- */
-
/* Passing file names with different notations, using slashes, wild-card chars */
$file_path = __DIR__;
Test filesize() function: basic functionaity
--FILE--
<?php
-/*
- * Prototype: int filesize ( string $filename );
- * Description: Returns the size of the file in bytes, or FALSE
- * (and generates an error of level E_WARNING) in case of an error.
- */
-
-
echo "*** Testing size of files and directories with filesize() ***\n";
$file_path = __DIR__;
Test filesize() function: error conditions
--FILE--
<?php
-/*
- * Prototype : int filesize ( string $filename );
- * Description : Returns the size of the file in bytes, or FALSE
- * (and generates an error of level E_WARNING) in case of an error.
- */
-
echo "*** Testing filesize(): error conditions ***";
/* Non-existing file or dir */
}
--FILE--
<?php
-/*
- Prototype : int filesize ( string $filename );
- Description : Returns the size of the file in bytes, or FALSE
- (and generates an error of level E_WARNING) in case of an error.
-*/
-
$file_path = __DIR__;
require($file_path."/file.inc");
}
--FILE--
<?php
-/*
- Prototype : int filesize ( string $filename );
- Description : Returns the size of the file in bytes, or FALSE
- (and generates an error of level E_WARNING) in case of an error.
-*/
-
$file_path = __DIR__;
require($file_path."/file.inc");
}
--FILE--
<?php
-/*
- Prototype : int filesize ( string $filename );
- Description : Returns the size of the file in bytes, or FALSE
- (and generates an error of level E_WARNING) in case of an error.
-*/
-
$file_path = __DIR__;
require($file_path."/file.inc");
}
--FILE--
<?php
-/*
- Prototype : int filesize ( string $filename );
- Description : Returns the size of the file in bytes, or FALSE
- (and generates an error of level E_WARNING) in case of an error.
-*/
-
$file_path = __DIR__;
require($file_path."/file.inc");
}
--FILE--
<?php
-/*
- Prototype : int filesize ( string $filename );
- Description : Returns the size of the file in bytes, or FALSE
- (and generates an error of level E_WARNING) in case of an error.
-*/
-
$file_path = __DIR__;
require($file_path."/file.inc");
Test filesize() function: usage variations - file size after truncate
--FILE--
<?php
-/*
- Prototype : int filesize ( string $filename );
- Description : Returns the size of the file in bytes, or FALSE
- (and generates an error of level E_WARNING) in case of an error.
-*/
-
$file_path = __DIR__;
echo "*** Testing filesize(): usage variations ***\n";
}
--FILE--
<?php
-/*
- Prototype : int filesize ( string $filename );
- Description : Returns the size of the file in bytes, or FALSE
- (and generates an error of level E_WARNING) in case of an error.
-*/
-
$file_path = __DIR__;
require($file_path."/file.inc");
}
--FILE--
<?php
-/*
- Prototype : int filesize ( string $filename );
- Description : Returns the size of the file in bytes, or FALSE
- (and generates an error of level E_WARNING) in case of an error.
-*/
-
/* Testing filesize() with data written using different file modes and by creating holes in file */
$file_path = __DIR__;
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/*
- * Prototype : int filesize ( string $filename );
- * Description : Returns the size of the file in bytes, or FALSE
- * (and generates an error of level E_WARNING) in case of an error.
- */
-
echo "*** Testing filesize(): usage variations ***\n";
/* null, false, "", " " */
Test filetype() function: Basic functionality
--FILE--
<?php
-/*
-Prototype: string filetype ( string $filename );
-Description: Returns the type of the file. Possible values are fifo, char,
- dir, block, link, file, and unknown.
-*/
-
echo "*** Testing filetype() with files and dirs ***\n";
print( filetype(__FILE__) )."\n";
Test filetype() function: Error conditions
--FILE--
<?php
-/*
-Prototype: string filetype ( string $filename );
-Description: Returns the type of the file. Possible values are fifo, char,
- dir, block, link, file, and unknown.
-*/
-
echo "*** Testing error conditions ***";
/* non-existing file or dir */
print( filetype("/no/such/file/dir") );
?>
--FILE--
<?php
-/*
-Prototype: string filetype ( string $filename );
-Description: Returns the type of the file. Possible values are fifo, char,
- dir, block, link, file, and unknown.
-*/
-
echo "*** Testing filetype() with various types ***\n";
$file_path = __DIR__;
$file1 = $file_path."/filetype1_variation.tmp";
?>
--FILE--
<?php
-/*
-Prototype: string filetype ( string $filename );
-Description: Returns the type of the file. Possible values are fifo, char,
- dir, block, link, file, and unknown.
-*/
-
echo "-- Checking for char --\n";
print( filetype("/dev/null") )."\n";
?>
?>
--FILE--
<?php
-/*
-Prototype: string filetype ( string $filename );
-Description: Returns the type of the file. Possible values are fifo, char,
- dir, block, link, file, and unknown.
-*/
-
echo "-- Checking for block --\n";
print( filetype("/dev/ram0") )."\n";
?>
--FILE--
<?php
/*
-Prototype: bool flock(resource $handle, int $operation [, int &$wouldblock]);
Description: PHP supports a portable way of locking complete files
in an advisory way
*/
--FILE--
<?php
/*
-Prototype: bool flock(resource $handle, int $operation [, int &$wouldblock]);
Description: PHP supports a portable way of locking complete files
in an advisory way
*/
Test flock() function: Variations
--FILE--
<?php
-/*
-Prototype: bool flock(resource $handle, int $operation [, int &$wouldblock]);
-Description: PHP supports a portable way of locking complete files
- in an advisory way
-*/
-
echo "*** Testing flock() fun with the various operation and
wouldblock values ***\n";
?>
--FILE--
<?php
-/* Prototype: bool fnmatch ( string $pattern, string $string [, int $flags] )
- Description: fnmatch() checks if the passed string would match
- the given shell wildcard pattern.
-*/
echo "*** Testing fnmatch() with file ***\n";
$file = basename(__FILE__);
?>
--FILE--
<?php
-/* Prototype: bool fnmatch ( string $pattern, string $string [, int $flags] )
- Description: fnmatch() checks if the passed string would match
- the given shell wildcard pattern.
-*/
echo "*** Testing fnmatch() with file and various patterns ***\n";
$file_name = __DIR__."/match.tmp";
?>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing fopen() : variation ***\n";
// fopen with interesting windows paths.
?>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing fopen() : variation ***\n";
// fopen with interesting windows paths.
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
set_include_path("rubbish");
testme();
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
require_once('fopen_include_path.inc');
echo "*** Testing fopen() : variation ***\n";
?>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing fopen() : variation ***\n";
// fopen with interesting windows paths.
?>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing fopen() : variation ***\n";
// fopen with interesting windows paths.
?>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing fopen() : variation ***\n";
// fopen with interesting windows paths.
?>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing fopen() : variation ***\n";
// fopen with interesting windows paths.
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
require_once('fopen_include_path.inc');
$thisTestDir = "fopenVariation16.dir";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
require_once('fopen_include_path.inc');
$thisTestDir = basename(__FILE__, ".php") . ".dir";
?>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
$tmpDir = 'fopenVar19.Dir';
$realFilename = __FILE__.'.real';
$sortFilename = __FILE__.'.soft';
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
-
-
//create the include directory structure
$thisTestDir = basename(__FILE__, ".php") . ".dir";
mkdir($thisTestDir);
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing fopen() : variation ***\n";
$absfile = __FILE__.'.tmp';
$relfile = "fopen_variation6.tmp";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
require_once('fopen_include_path.inc');
$thisTestDir = basename(__FILE__, ".php") . ".dir";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
-
-
$thisTestDir = basename(__FILE__, ".php") . ".dir";
mkdir($thisTestDir);
chdir($thisTestDir);
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : resource fopen(string filename, string mode [, bool use_include_path [, resource context]])
- * Description: Open a file or a URL and return a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
require_once('fopen_include_path.inc');
$thisTestDir = basename(__FILE__, ".php") . ".dir";
Test fpassthru() function: Basic functionality
--FILE--
<?php
-/*
-Prototype: int fpassthru ( resource $handle );
-Description: Reads to EOF on the given file pointer from the current position
- and writes the results to the output buffer.
-*/
-
$file_name = __DIR__."/passthru.tmp";
$write_handle = fopen($file_name, "w");
Test fpassthru() function: Variations
--FILE--
<?php
-/*
-Prototype: int fpassthru ( resource $handle );
-Description: Reads to EOF on the given file pointer from the current position
- and writes the results to the output buffer.
-*/
-
echo "*** Testing fpassthru() function with files ***\n\n";
echo "--- Testing with different offsets ---\n";
Test fputcsv() : usage variations - with all parameters specified
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/* Testing fputcsv() to write to a file when all its parameters are provided */
echo "*** Testing fputcsv() : with all parameters specified ***\n";
Test fputcsv() : usage variations - with line without any csv fields
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
-
/* Testing fputcsv() to write to a file when the field has no CSV format */
echo "*** Testing fputcsv() : with no CSV format in the field ***\n";
Test fputcsv() : usage variations - with default enclosure value
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/* Testing fputcsv() to write to a file when default enclosure value is provided */
echo "*** Testing fputcsv() : with default enclosure value ***\n";
Test fputcsv() : usage variations - with default enclosure and different delimiter
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/* Testing fputcsv() to write to a file when default enclosure value and delimiter value
other than that in the field is provided */
Test fputcsv() : usage variations - with default enclosure & delimiter of two chars
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/* Testing fputcsv() to write to a file when default enclosure value and delimiter
of two chars is provided */
Test fputcsv() : usage variations - with enclosure & delimiter of two chars(read only modes)
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/* Testing fputcsv() to write to a file when default enclosure value and delimiter
of two chars is provided and file is opened in read only mode */
Test fputcsv() : usage variations - with delimiter as NULL
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/* Testing fputcsv() to write to a file when delimiter is NULL */
echo "*** Testing fputcsv() : with delimiter as NULL ***\n";
Test fputcsv() : usage variations - with enclosure as NULL
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/* Testing fputcsv() to write to a file when enclosure is NULL */
echo "*** Testing fputcsv() : with enclosure as NULL ***\n";
Test fputcsv() : usage variations - with delimiter and enclosure as NULL
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/* Testing fputcsv() to write to a file when delimiter and enclosure is NULL */
echo "*** Testing fputcsv() : with delimiter and enclosure as NULL ***\n";
Test fputcsv() : usage variations - with default arguments value
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/* Testing fputcsv() to write to a file when default arguments values are considered */
echo "*** Testing fputcsv() : with default arguments value ***\n";
Test fputcsv() : usage variations - with different delimiter and enclosure
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/*
Testing fputcsv() to write to a file when delimiter are different from those
present in the field to be written to the file
Test fputcsv() : usage variations - with different delimiter and same enclosure
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/*
Testing fputcsv() to write to a file when enclosure is same but delimiter is different from those
present in the field to be written to the file
Test fputcsv() : usage variations - with same delimiter and different enclosure
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
/*
Testing fputcsv() to write to a file when delimiter is same but enclosure is different from those
present in the field to be written to the file
Test fputcsv() : usage variations - two chars as enclosure & delimiter
--FILE--
<?php
-/*
- Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
-*/
-
-
/* Testing fputcsv() to write to a file when delimiter and enclosure are of two chars each */
echo "*** Testing fputcsv() : with two chars as enclosure & delimiter ***\n";
Test fread() function : basic functionality
--FILE--
<?php
-/*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
Test fread() function : error conditions
--FILE--
<?php
-/*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
echo "*** Testing error conditions ***\n";
$filename = __FILE__;
$file_handle = fopen($filename, "r");
<?php
/*
- * proto int fwrite(resource fp, string str [, int length])
* Function is implemented in ext/standard/file.c
*/
- /*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
-
$outputfile = __FILE__.".tmp";
echo "--- testing rw moving about the file ---\n";
Test fread() function : usage variations - read some/all chars, read/write modes
--FILE--
<?php
-/*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
/* Read content less than file size &
Read entire file
*/
Test fread() function : usage variations - read some/all chars, write only mode (Bug #42036)
--FILE--
<?php
-/*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
/* Try reading some or all content of the file opened in write only mode */
// include the file.inc for common functions for test
?>
--FILE--
<?php
-/*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
Test fread() function : usage variations - read beyond file size, write only mode
--FILE--
<?php
-/*
- Prototype: string fread ( resource $handle [, int $length] );
- Description: reads up to length bytes from the file pointer referenced by handle.
- Reading stops when up to length bytes have been read, EOF (end of file) is
- reached, (for network streams) when a packet becomes available, or (after
- opening userspace stream) when 8192 bytes have been read whichever comes first.
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
Test fscanf() function: error conditions
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
echo "*** Testing fscanf() for error conditions ***\n";
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* test fscanf() for its return type */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan resource type using different float format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan arrays using different float format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan strings using different float format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan boolean data using different float format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan different strings using different string format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan float values using different string format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan resource type using different string format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan arrays using different string format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan integer values using different string format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan boolean data using different string format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan different integer values using different integer format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan different integer values using different char format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan float values using different char format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan resource type using different char format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan arrays using different char format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan strings using different char format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan boolean data using different char format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan different chars using different char format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan different integer values using different octal format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan float values using different octal format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan resource type using different octal format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan float values using different integer format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan arrays using different octal format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan strings using different octal format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan boolean data using different octal format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan different integer values using different hexa format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan float values using different hexa format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan resource type using different hexa format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan arrays using different hexa format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan strings using different hexa format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan boolean data using different hexa format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan different integer values using different unsigned int format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan resource type using different integer format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan float values using different unsigned format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan resource type using different unsigned format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan arrays using different unsigned format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan strings using different unsigned format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan boolean data using different unsigned format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan different integer values using different scientific format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan float values using different scientific format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan resource type using different scientific format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan arrays using different scientific format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan strings using different scientific format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan arrays using different integer format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan boolean data using different scientific format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan a file for read when file is opened inwrite only mode */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan an empty file */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to read a file when file pointer is pointing to EOF */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan a file to read objects */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/*
Test fscanf() to scan data using different format types and also
tracking the file pointer movement along with reading
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan strings using different integer format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan boolean data using different integer format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan different float values using different format types */
$file_path = __DIR__;
--FILE--
<?php
-/*
- Prototype: mixed fscanf ( resource $handle, string $format [, mixed &$...] );
- Description: Parses input from a file according to a format
-*/
-
/* Test fscanf() to scan integer values using different float format types */
$file_path = __DIR__;
Test fseek(), ftell() & rewind() functions : Basic functionality - all r and a modes
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
echo "*** Testing fseek() : error conditions ***\n";
// fseek() on a file handle which is already closed
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
echo "*** Testing ftell() : error conditions ***\n";
// ftell on a file handle which is already closed
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
echo "*** Testing rewind() : error conditions ***\n";
// rewind on a file handle which is already closed
Test fseek(), ftell() & rewind() functions : usage variations - all r & a modes, default whence
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
Test fseek(), ftell() & rewind() functions : usage variations - all r and a modes, SEEK_SET
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
Test fseek(), ftell() & rewind() functions : usage variations - all r & a modes, SEEK_CUR
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
Test fseek(), ftell() & rewind() functions : usage variations - all r and a modes, SEEK_END
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
?>
--FILE--
<?php
-/* Prototype: int fseek ( resource $handle, int $offset [, int $whence] );
- Description: Seeks on a file pointer
-
- Prototype: bool rewind ( resource $handle );
- Description: Rewind the position of a file pointer
-
- Prototype: int ftell ( resource $handle );
- Description: Tells file pointer read/write position
-*/
-
// include the file.inc for common functions for test
include ("file.inc");
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : proto int fseek(resource fp, int offset [, int whence])
- * Description: Seek on a file pointer
- * Source code: ext/standard/file.c
- * Alias to functions: gzseek
- */
-
echo "*** Testing fseek() : variation - beyond file boundaries ***\n";
$outputfile = __FILE__.".tmp";
Test ftruncate() function : error conditions
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: truncates a file to a given length
-*/
-
echo "*** Testing ftruncate() : error conditions ***\n";
$filename = __DIR__."/ftruncate_error.tmp";
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
Test ftruncate() function : usage variations - truncate file to negative size
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
/* truncate the file to smaller size and display the content */
// include common file related test functions
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
/* truncate the file to smaller size and display the content */
// include common file related test functions
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
/* truncate the file when file pointer is positioned at end of the file */
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: bool ftruncate ( resource $handle, int $size );
- Description: Truncates a file to a given length
-*/
-
/* truncate the file when file pointer is positioned at end of the file */
// include common file related test functions
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
// include the file.inc for Function: function delete_file($filename)
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
// include the file.inc for Function: function delete_file($filename)
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
// include the file.inc for Function: function delete_file($filename)
include ("file.inc");
Test fwrite() function : error conditions
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
// include the file.inc for Function: function delete_file($filename)
include ("file.inc");
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
-
echo "*** Testing fwrite() various operations ***\n";
// include the file.inc for Function: function delete_file($filename)
Test fwrite() function : usage variations - r, rb & rt modes
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
-
echo "*** Testing fwrite() various operations ***\n";
// include the file.inc for Function: function delete_file($filename)
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
-
echo "*** Testing fwrite() various operations ***\n";
// include the file.inc for Function: function delete_file($filename)
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
-
echo "*** Testing fwrite() various operations ***\n";
// include the file.inc for Function: function delete_file($filename)
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
-
echo "*** Testing fwrite() various operations ***\n";
// include the file.inc for Function: function delete_file($filename)
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
-
echo "*** Testing fwrite() various operations ***\n";
// include the file.inc for Function: function delete_file($filename)
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
-
echo "*** Testing fwrite() various operations ***\n";
// include the file.inc for Function: function delete_file($filename)
?>
--FILE--
<?php
-/*
- Prototype: int fwrite ( resource $handle,string string, [, int $length] );
- Description: fwrite() writes the contents of string to the file stream pointed to by handle.
- If the length arquement is given,writing will stop after length bytes have been
- written or the end of string reached, whichever comes first.
- fwrite() returns the number of bytes written or FALSE on error
-*/
-
-
echo "*** Testing fwrite() various operations ***\n";
// include the file.inc for Function: function delete_file($filename)
Test glob() function: basic functions
--FILE--
<?php
-/* Prototype: array glob ( string $pattern [, int $flags] );
- Description: Find pathnames matching a pattern
-*/
-
echo "*** Testing glob() : basic functions ***\n";
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array glob ( string $pattern [, int $flags] );
- Description: Find pathnames matching a pattern
-*/
-
echo "*** Testing glob() : error condition - pattern too long. ***\n";
var_dump(glob(str_repeat('x', 3000)));
?>
--FILE--
<?php
-/* Prototype: array glob ( string $pattern [, int $flags] );
- Description: Find pathnames matching a pattern
-*/
-
echo "*** Testing glob() : usage variations ***\n";
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array glob ( string $pattern [, int $flags] );
- Description: Find pathnames matching a pattern
-*/
-
echo "*** Testing glob() : usage variations ***\n";
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array glob ( string $pattern [, int $flags] );
- Description: Find pathnames matching a pattern
-*/
-
echo "*** Testing glob() : usage variations ***\n";
$file_path = __DIR__;
Test glob() function with relative path
--FILE--
<?php
-/* Prototype: array glob ( string $pattern [, int $flags] );
- Description: Find pathnames matching a pattern
-*/
-
$file_path = __DIR__;
// temp dirname used here
Test is_dir() function: basic functionality
--FILE--
<?php
-/* Prototype: bool is_dir ( string $filename );
- Description: Tells whether the filename is a regular file
- Returns TRUE if the filename exists and is a regular file
-*/
-
echo "*** Testing is_dir(): basic functionality ***\n";
$file_path = __DIR__;
var_dump( is_dir($file_path) );
Test is_dir() function: usage variations - dir/subdir
--FILE--
<?php
-/* Prototype: bool is_dir ( string $dirname );
- Description: Tells whether the dirname is a directory
- Returns TRUE if the dirname exists and is a directory, FALSE otherwise.
-*/
-
/* Testing is_dir() with base and sub dirs */
$file_path = __DIR__;
}
--FILE--
<?php
-/* Prototype: bool is_dir ( string $dirname );
- Description: Tells whether the dirname is a directory
- Returns TRUE if the dirname exists and is a directory, FALSE otherwise.
-*/
-
/* Testing is_dir() with dir, soft & hard link to dir,
and with file, soft & hard link to file */
obscure_filename
--FILE--
<?php
-/* Prototype: bool is_dir ( string $dirname );
- Description: Tells whether the dirname is a directory
- Returns TRUE if the dirname exists and is a directory, FALSE otherwise.
-*/
-
/* Passing invalid arguments to is_dir() */
echo "*** Testing is_dir() with Invalid arguments: expected bool(false) ***\n";
Test is_dir() function: usage variations - diff. path notations
--FILE--
<?php
-/* Prototype: bool is_dir ( string $dirname );
- Description: Tells whether the dirname is a directory
- Returns TRUE if the dirname exists and is a directory, FALSE otherwise.
-*/
-
/* Passing dir names with different notations, using slashes, wild-card chars */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool is_executable ( string $filename );
- Description: Tells whether the filename is executable
-*/
require __DIR__.'/file.inc';
echo "*** Testing is_executable(): basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype: bool is_executable ( string $filename );
- Description: Tells whether the filename is executable
-*/
require __DIR__.'/file.inc';
echo "*** Testing is_executable(): basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype: bool is_executable ( string $filename );
- Description: Tells whether the filename is executable
-*/
-
// include common file test functions
require __DIR__.'/file.inc';
Test is_executable() function: error conditions
--FILE--
<?php
-/* Prototype: bool is_executable ( string $filename );
- Description: Tells whether the filename is executable
-*/
-
echo "\n*** Testing is_exceutable() on non-existent directory ***\n";
var_dump( is_executable(__DIR__."/is_executable") );
?>
--FILE--
<?php
-/* Prototype: bool is_executable ( string $filename );
- Description: Tells whether the filename is executable
-*/
-
/* test is_executable() with file having different filepath notation */
require __DIR__.'/file.inc';
?>
--FILE--
<?php
-/* Prototype: bool is_executable ( string $filename );
- Description: Tells whether the filename is executable
-*/
-
/* test is_executable() with file/dir having different permissions */
require __DIR__.'/file.inc';
?>
--FILE--
<?php
-/* Prototype: bool is_executable ( string $filename );
- Description: Tells whether the filename is executable
-*/
-
/* test is_executable() with invalid arguments */
echo "*** Testing is_executable(): usage variations ***\n";
Test is_file() function: basic functionality
--FILE--
<?php
-/* Prototype: bool is_file ( string $filename );
- Description: Tells whether the filename is a regular file
- Returns TRUE if the filename exists and is a regular file
-*/
-
echo "*** Testing is_file(): basic functionality ***\n";
/* Checking with current file */
Test is_file() function: usage variations - diff. files
--FILE--
<?php
-/* Prototype: bool is_file ( string $filename );
- Description: Tells whether the filename is a regular file
- Returns TRUE if the filename exists and is a regular file
-*/
-
/* Testing is_file() with file containing data, truncating its size
and the file created by touch() */
}
--FILE--
<?php
-/* Prototype: bool is_file ( string $filename );
- Description: Tells whether the filename is a regular file
- Returns TRUE if the filename exists and is a regular file
-*/
-
/* Creating soft and hard links to a file and applying is_file() on links */
$file_path = __DIR__;
obscure_filename
--FILE--
<?php
-/* Prototype: bool is_file ( string $filename );
- Description: Tells whether the filename is a regular file
- Returns TRUE if the filename exists and is a regular file
-*/
-
/* Testing is_file() with invalid arguments -int, float, bool, NULL */
function flatten($variable) {
Test is_file() function: usage variations - diff. path notations (Bug #42027)
--FILE--
<?php
-/* Prototype: bool is_file ( string $filename );
- Description: Tells whether the filename is a regular file
- Returns TRUE if the filename exists and is a regular file
-*/
-
/* Passing file names with different notations, using slashes, wild-card chars */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool is_readable ( string $filename );
- Description: Tells whether the filename is readable
-*/
-
// include common file test functions
require __DIR__.'/file.inc';
?>
--FILE--
<?php
-/* Prototype: bool is_readable ( string $filename );
- Description: Tells whether the filename is readable
-*/
-
// include common file test functions
require __DIR__.'/file.inc';
?>
--FILE--
<?php
-/* Prototype: bool is_readable ( string $filename );
- Description: Tells whether the filename is readable
-*/
-
// include common file test functions
require __DIR__.'/file.inc';
Test is_readable() function: error conditions
--FILE--
<?php
-/* Prototype: bool is_readable ( string $filename );
- Description: Tells whether the filename is readable
-*/
-
echo "\n*** Testing is_readable() on non-existent file ***\n";
var_dump( is_readable(__DIR__."/is_readable.tmp") );
?>
--FILE--
<?php
-/* Prototype: bool is_readable ( string $filename );
- Description: Tells whether the filename is readable.
-*/
-
/* test is_readable() with file having different filepath notation */
require __DIR__.'/file.inc';
?>
--FILE--
<?php
-/* Prototype: bool is_readable ( string $filename );
- Description: Tells whether the filename is readable.
-*/
-
/* test is_executable() with file/dir having different permissions */
require __DIR__.'/file.inc';
?>
--FILE--
<?php
-/* Prototype: bool is_readable ( string $filename );
- Description: Tells whether the filename is readable.
-*/
-
/* test is_executable() with invalid arguments */
echo "*** Testing is_readable(): usage variations ***\n";
?>
--FILE--
<?php
-/* Prototype: bool is_writable ( string $filename );
- Description: Tells whether the filename is writable.
-
- is_writeable() is an alias of is_writable()
-*/
-
// include common file test functions
require __DIR__.'/file.inc';
Test is_writable() and its alias is_writeable() function: error conditions
--FILE--
<?php
-/* Prototype: bool is_writable ( string $filename );
- Description: Tells whether the filename is writable.
-
- is_writeable() is an alias of is_writable()
-*/
-
echo "\n*** Testing is_writable() on non-existent file ***\n";
var_dump( is_writable(__DIR__."/is_writable") );
var_dump( is_writeable(__DIR__."/is_writable") );
?>
--FILE--
<?php
-/* Prototype: bool is_writable ( string $filename );
- Description: Tells whether the filename is writable.
-
- is_writeable() is an alias of is_writable()
-*/
/* test is_writable() & is_writeable() with file having different filepath notation */
require __DIR__.'/file.inc';
echo "*** Testing is_writable(): usage variations ***\n";
?>
--FILE--
<?php
-/* Prototype: bool is_writable ( string $filename );
- Description: Tells whether the filename is writable.
-
- is_writeable() is an alias of is_writable()
-*/
-
/* test is_executable() with file/dir having different permissions */
require __DIR__.'/file.inc';
obscure_filename
--FILE--
<?php
-/* Prototype: bool is_writable ( string $filename );
- Description: Tells whether the filename is writable.
-
- is_writeable() is an alias of is_writable()
-*/
-
/* test is_writable() & is_writeable() with invalid arguments */
echo "*** Testing is_writable(): usage variations ***\n";
?>
--FILE--
<?php
-/* Prototype : bool lchown (string filename, mixed user)
- * Description: Change file owner of a symlink
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
echo "*** Testing lchown() : basic functionality ***\n";
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'lchown_basic.txt';
$symlink = __DIR__ . DIRECTORY_SEPARATOR . 'lchown_basic_symlink.txt';
?>
--FILE--
<?php
-/* Prototype : bool lchown (string filename, mixed user)
- * Description: Change file owner of a symlink
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
echo "*** Testing lchown() : error functionality ***\n";
// Set up
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
$file_path = __DIR__;
require("$file_path/file.inc");
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
echo "*** Testing lstat() for error conditions ***\n";
$file_path = __DIR__;
var_dump( lstat("$file_path/temp.tmp") ); // non existing file
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of rename() on stats of file */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of is_dir() on stats of a dir */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
$file_path = __DIR__;
require "$file_path/file.inc";
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of is_link() on stats of link */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* use stat on file created using "w" and "r" mode of fopen */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of is_link() on stats of hard link */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects on stats by changing permissions of link */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects on stats with changing permissions of file */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects on stats by changing permissions of a dir */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test for stats of dir/file when their names are stored in objects */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test for stats of dir/file when their names are stored in an array */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of rename() on stats of dir */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test for stats of link when their names are stored in object and array */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of truncate() on stats of a file */
$file_path = __DIR__;
obscure_filename
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
echo "*** testing stat ***\n";
var_dump(stat(NULL));
var_dump(stat(false));
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of rename() on stats of link */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of touch() on stats of file */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of touch() on stats of dir */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
/* test the effects of touch() on stats of link */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
$file_path = __DIR__;
require "$file_path/file.inc";
?>
--FILE--
<?php
-/* Prototype: array lstat ( string $filename );
- Description: Gives information about a file or symbolic link
-
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
$file_path = __DIR__;
require "$file_path/file.inc";
Test mkdir() and rmdir() functions : error conditions
--FILE--
<?php
-/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] );
- Description: Makes directory
-
- Prototype: bool rmdir ( string $dirname [, resource $context] );
- Description: Removes directory
-*/
echo "\n*** Testing rmdir() on non-existent directory ***\n";
var_dump( rmdir("temp") );
?>
--FILE--
<?php
-/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] );
- Description: Makes directory
-*/
echo "*** Testing mkdir() and rmdir() for different permissions ***\n";
?>
--FILE--
<?php
-/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] );
- Description: Makes directory
-*/
echo "*** Testing mkdir() and rmdir() for different permissions ***\n";
?>
--FILE--
<?php
-/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] );
- Description: Makes directory
-*/
echo "*** Testing mkdir() and rmdir() for different permissions ***\n";
?>
--FILE--
<?php
-/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool $recursive [, resource $context]]] );
- Description: Makes directory
-*/
$context = stream_context_create();
?>
--FILE--
<?php
-/* Prototype : bool mkdir(string pathname [, int mode [, bool recursive [, resource context]]])
- * Description: Create a directory
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing mkdir() : variation ***\n";
$workDir = "mkdirVar5.tmp";
?>
--FILE--
<?php
-/* Prototype : bool mkdir(string pathname [, int mode [, bool recursive [, resource context]]])
- * Description: Create a directory
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing mkdir() : variation ***\n";
$workDir = "mkdirVar5.tmp";
Test parse_ini_file() function
--FILE--
<?php
-/* Prototype: array parse_ini_file(string $filename [,bool $process_sections]);
- Description: parse_ini_file() loads in the ini file specified in filename,
- and returns the settings in it in an associative array.
-*/
-
$file_path = __DIR__;
$parse_string = <<<EOD
Test parse_ini_file() function : error conditions
--FILE--
<?php
-/* Prototype : proto array parse_ini_file(string filename [, bool process_sections])
- * Description: Parse configuration file
- * Source code: ext/standard/basic_functions.c
- * Alias to functions:
- */
-
echo "*** Testing parse_ini_file() : error conditions ***\n";
//Test parse_ini_file with one more than the expected number of arguments
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : array parse_ini_file(string filename [, bool process_sections])
- * Description: Parse configuration file
- * Source code: ext/standard/basic_functions.c
- * Alias to functions:
- */
-
echo "*** Testing parse_ini_file() : variation ***\n";
$output_file = __FILE__.".ini";
$iniFile = <<<FILE
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : array parse_ini_file(string filename [, bool process_sections])
- * Description: Parse configuration file
- * Source code: ext/standard/basic_functions.c
- * Alias to functions:
- */
-
echo "*** Testing parse_ini_file() : variation ***\n";
$output_file = __FILE__.".ini";
$iniFile = <<<FILE
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : array parse_ini_file(string filename [, bool process_sections])
- * Description: Parse configuration file
- * Source code: ext/standard/basic_functions.c
- * Alias to functions:
- */
-
echo "*** Testing parse_ini_file() : variation ***\n";
$pwd = getcwd();
$f = "parse_ini_file_variation3";
?>
--FILE--
<?php
-/* Prototype : array parse_ini_file(string filename [, bool process_sections])
- * Description: Parse configuration file
- * Source code: ext/standard/basic_functions.c
- * Alias to functions:
- */
-
echo "*** Testing parse_ini_file() : variation ***\n";
$mainDir = "parseIniFileVar私はガラスを食べられます.dir";
$subDir = "parseIniFileVar私はガラスを食べられますSub";
?>
--FILE--
<?php
-/* Prototype : array parse_ini_file(string filename [, bool process_sections])
- * Description: Parse configuration file
- * Source code: ext/standard/basic_functions.c
- * Alias to functions:
- */
-
echo "*** Testing parse_ini_file() : variation ***\n";
$mainDir = "parseIniFileVar6.dir";
$subDir = "parseIniFileVar6Sub";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : array parse_ini_file(string filename [, bool process_sections])
- * Description: Parse configuration file
- * Source code: ext/standard/basic_functions.c
- * Alias to functions:
- */
-
echo "*** Testing parse_ini_file() : variation ***\n";
$mainDir = "parseIniFileVar6.dir";
$subDir = "parseIniFileVar6Sub";
Test pathinfo() function: basic functionality
--FILE--
<?php
-/* Prototype: mixed pathinfo ( string $path [, int $options] );
- Description: Returns information about a file path
-*/
-
echo "*** Testing basic functions of pathinfo() ***\n";
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: mixed pathinfo ( string $path [, int $options] );
- Description: Returns information about a file path
-*/
-
echo "*** Testing basic functions of pathinfo() ***\n";
$paths = array (
?>
--FILE--
<?php
-/* Prototype: mixed pathinfo ( string $path [, int $options] );
- Description: Returns information about a file path
-*/
-
echo "*** Testing basic functions of pathinfo() ***\n";
$paths = array (
?>
--FILE--
<?php
-/* Prototype: mixed pathinfo ( string $path [, int $options] );
- Description: Returns information about a file path
-*/
-
echo "*** Testing basic functions of pathinfo() ***\n";
$paths = array (
?>
--FILE--
<?php
-/* Prototype: mixed pathinfo ( string $path [, int $options] );
- Description: Returns information about a file path
-*/
-
echo "*** Testing basic functions of pathinfo() ***\n";
$paths = array (
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : array pathinfo(string path[, int options])
- * Description: Returns information about a certain string
- * Source code: ext/standard/string.c
- * Alias to functions:
- */
-
echo "*** Testing pathinfo() : usage variation ***\n";
$testfile = "/usr/include/arpa/inet.h";
Test pathinfo() function: usage variations
--FILE--
<?php
-/* Prototype: mixed pathinfo ( string $path [, int $options] );
- Description: Returns information about a file path
-*/
-
echo "*** Testing pathinfo() with miscellaneous input arguments ***\n";
$fp = fopen(__FILE__, "r");
?>
--FILE--
<?php
-/*
- * Prototype: resource popen ( string command, string mode )
- * Description: Opens process file pointer.
-
- * Prototype: int pclose ( resource handle );
- * Description: Closes process file pointer.
- */
-
echo "*** Testing popen(): reading from the pipe ***\n";
$file_path = __DIR__;
?>
--FILE--
<?php
-/*
- * Prototype: resource popen ( string command, string mode )
- * Description: Opens process file pointer.
-
- * Prototype: int pclose ( resource handle );
- * Description: Closes process file pointer.
- */
-
echo "*** Testing popen(): reading from the pipe ***\n";
$file_path = __DIR__;
?>
--FILE--
<?php
-/*
- * Prototype: resource popen ( string command, string mode )
- * Description: Opens process file pointer.
- *
- * Prototype: int pclose ( resource handle );
- * Description: Closes process file pointer.
- */
-
$file_path = __DIR__;
require($file_path."/file.inc");
?>
--FILE--
<?php
-/*
- * Prototype: resource popen ( string command, string mode )
- * Description: Opens process file pointer.
- * Prototype: int pclose ( resource handle );
- * Description: Closes process file pointer.
- */
$file_path = __DIR__;
echo "*** Testing for error conditions ***\n";
var_dump( popen() ); // Zero Arguments
?>
--FILE--
<?php
-/*
- * Prototype: resource popen ( string command, string mode )
- * Description: Opens process file pointer.
-
- * Prototype: int pclose ( resource handle );
- * Description: Closes process file pointer.
- */
$file_path = __DIR__;
echo "*** Testing for error conditions ***\n";
var_dump( popen("abc.txt", "rw") ); // Invalid mode Argument
?>
--FILE--
<?php
-/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] );
- Description: Outputs a file
-*/
// common file used
require(__DIR__ . '/file.inc');
?>
--FILE--
<?php
-/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] );
- Description: Outputs a file
-*/
// common file used
require(__DIR__ . '/file.inc');
Test readfile() function: error conditions
--FILE--
<?php
-/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] );
- Description: Outputs a file
-*/
-
$context = stream_context_create();
echo "*** Test readfile(): error conditions ***\n";
Test readfile() function: usage variation - stream_context
--FILE--
<?php
-/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] );
- Description: Outputs a file
-*/
-
/* test readfile() with third argument : context */
// include file.inc
obscure_filename
--FILE--
<?php
-/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]])
- * Description: Output a file or a URL
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing readfile() : variation ***\n";
/* An array of files */
?>
--FILE--
<?php
-/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] );
- Description: Outputs a file
-*/
-
/* Variation 2 : Create file
Create soft/hard link to it
Read link using readfile()
Test readfile() function: usage variation - include path
--FILE--
<?php
-/* Prototype: int readfile ( string $filename [, bool $use_include_path [, resource $context]] );
- Description: Outputs a file
-*/
/* test readfile() by providing an include path, second argument */
// include file.inc
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]])
- * Description: Output a file or a URL
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
require_once('fopen_include_path.inc');
echo "*** Testing readfile() : variation ***\n";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]])
- * Description: Output a file or a URL
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
require_once('fopen_include_path.inc');
echo "*** Testing readfile() : variation ***\n";
?>
--FILE--
<?php
-/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]])
- * Description: Output a file or a URL
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing readfile() : variation ***\n";
$mainDir = "readfileVar私はガラスを食べられます8";
$subDir = "readfileVar私はガラスを食べられます8Sub";
?>
--FILE--
<?php
-/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]])
- * Description: Output a file or a URL
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing readfile() : variation ***\n";
$mainDir = "readfileVar8";
$subDir = "readfileVar8Sub";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : int readfile(string filename [, bool use_include_path[, resource context]])
- * Description: Output a file or a URL
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing readfile() : variation ***\n";
$mainDir = "readfileVar8";
$subDir = "readfileVar8Sub";
?>
--FILE--
<?php
-/* Prototype: string readlink ( string $path );
- Description: Returns the target of a symbolic link
-
- Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
/* creating directories, symbolic links and files */
$file_path = __DIR__;
mkdir("$file_path/readlink_realpath_basic1/home/test/", 0777, true);
?>
--FILE--
<?php
-/* Prototype: string readlink ( string $path );
- Description: Returns the target of a symbolic link
-
- Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
/* creating directories, symbolic links and files */
$file_path = __DIR__;
mkdir("$file_path/readlink_realpath_basic2/home/test/", 0777, true);
?>
--FILE--
<?php
-/* Prototype: string readlink ( string $path );
- Description: Returns the target of a symbolic link
-
- Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
echo "\n*** Testing readlink() on a non-existent link ***\n";
var_dump( readlink(__DIR__."/readlink_error.tmp") );
?>
--FILE--
<?php
-/* Prototype: string readlink ( string $path );
- Description: Returns the target of a symbolic link
-
- Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
echo "*** Testing readlink() and realpath() : usage variations ***\n";
$name_prefix = __DIR__;
$filename = "$name_prefix/readlink_realpath_variation1/home/tests/link/readlink_realpath_variation1.tmp";
?>
--FILE--
<?php
-/* Prototype: string readlink ( string $path );
- Description: Returns the target of a symbolic link
-
- Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
echo "*** Testing readlink() and realpath() : usage variations ***\n";
$name_prefix = __DIR__;
// create temp dir
Test readlink() and realpath() functions: usage variation - invalid args
--FILE--
<?php
-/* Prototype: string readlink ( string $path );
- Description: Returns the target of a symbolic link
-
- Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
echo "*** Testing readlink() and realpath() : usage variations ***\n";
echo "\n*** Testing readlink() and realpath() with linkname as empty string, NULL and single space ***\n";
obscure_filename
--FILE--
<?php
-/* Prototype: string readlink ( string $path );
- Description: Returns the target of a symbolic link */
-
/* Testing readlink() with invalid arguments -int, float, bool, NULL, resource */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
echo "\n*** Testing basic functions of realpath() with files ***\n";
/* creating directories and files */
?>
--FILE--
<?php
-/* Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
echo "\n*** Testing basic functions of realpath() with files ***\n";
/* creating directories and files */
Test realpath() with relative paths
--FILE--
<?php
-/* Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
echo "\n*** Testing basic functions of realpath() with files ***\n";
/* creating directories and files */
?>
--FILE--
<?php
-/* Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
require __DIR__.'/file.inc';
echo "*** Testing realpath(): usage variations ***\n";
?>
--FILE--
<?php
-/* Prototype: string realpath ( string $path );
- Description: Returns canonicalized absolute pathname
-*/
-
require __DIR__.'/file.inc';
echo "*** Testing realpath(): usage variations ***\n";
?>
--FILE--
<?php
-/* Prototype : string realpath(string path)
- * Description: Return the resolved path
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing realpath() : variation ***\n";
$paths = array('c:\\',
Test rename() function: basic functionality
--FILE--
<?php
-/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
- Description: Renames a file or directory
-*/
-
echo "*** Testing rename() on non-existing file ***\n";
$file_path = __DIR__;
require "$file_path/file.inc";
?>
--FILE--
<?php
-/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
- Description: Renames a file or directory
-*/
-
require __DIR__.'/file.inc';
/* create directory */
?>
--FILE--
<?php
-/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
- Description: Renames a file or directory
-*/
-
require __DIR__.'/file.inc';
/* creating directory */
?>
--FILE--
<?php
-/* Prototype : bool rename(string old_name, string new_name[, resource context])
- * Description: Rename a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing rename() with absolute and relative paths ***\n";
$mainDir = "renameVar11";
$subDir = "renameVar11Sub";
?>
--FILE--
<?php
-/* Prototype : bool rename(string old_name, string new_name[, resource context])
- * Description: Rename a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
/* Creating unique files in various dirs by passing relative paths to $dir arg */
echo "*** Testing rename() with absolute and relative paths ***\n";
?>
--FILE--
<?php
-/* Prototype : bool rename(string old_name, string new_name[, resource context])
- * Description: Rename a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
/* Creating unique files in various dirs by passing relative paths to $dir arg */
echo "*** Testing rename() with absolute and relative paths ***\n";
obscure_filename
--FILE--
<?php
-/* Prototype : bool rename(string old_name, string new_name[, resource context])
- * Description: Rename a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
/* An array of files */
$names_arr = array(
/* Invalid args */
obscure_filename
--FILE--
<?php
-/* Prototype : bool rename(string old_name, string new_name[, resource context])
- * Description: Rename a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing rename() with obscure files ***\n";
$file_path = __DIR__."/renameVar13";
$aFile = $file_path.'/afile.tmp';
?>
--FILE--
<?php
-/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
- Description: Renames a file or directory
-*/
-
require __DIR__.'/file.inc';
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
- Description: Renames a file or directory
-*/
-
require __DIR__.'/file.inc';
/* creating directory */
?>
--FILE--
<?php
-/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
- Description: Renames a file or directory
-*/
-
echo "\n*** Testing rename() on non-existing file ***\n";
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
- Description: Renames a file or directory
-*/
-
echo "\n*** Testing rename() on non-existing file ***\n";
$file_path = __DIR__;
Test rename() function: basic functionality
--FILE--
<?php
-/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
- Description: Renames a file or directory
-*/
-
echo "\n*** Testing rename() by giving stream context as third argument ***\n";
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype : bool rmdir(string dirname[, resource context])
- * Description: Remove a directory
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing rmdir() : variation ***\n";
$workDir = "rmdirVar3.tmp";
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : bool rmdir(string dirname[, resource context])
- * Description: Remove a directory
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing rmdir() : variation ***\n";
$workDir = "rmdirVar3.tmp";
?>
--FILE--
<?php
-/*
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
$file_path = __DIR__;
require("$file_path/file.inc");
?>
--FILE--
<?php
-/*
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
$file_path = __DIR__;
require("$file_path/file.inc");
?>
--FILE--
<?php
-/*
- Prototype: array stat ( string $filename );
- Description: Gives information about a file
-*/
-
$file_path = __DIR__;
$arr = array(__FILE__);
--FILE--
<?php
-/*
- * Prototype: array stat ( string $filename );
- * Description: Gives information about a file
- */
-
/* test the effects of rename() on stats of dir/file */
$file_path = __DIR__;
--FILE--
<?php
-/*
- * Prototype: array stat ( string $filename );
- * Description: Gives information about a file
- */
-
/* test the effects of rename() on stats of dir/file */
$file_path = __DIR__;
--FILE--
<?php
-/*
- * Prototype: array stat ( string $filename );
- * Description: Gives information about a file
- */
-
/* test the effects of writing to a file on the stats of the file */
--FILE--
<?php
-/*
- * Prototype: array stat ( string $filename );
- * Description: Gives information about a file
- */
-
/* test the effects of creating & deleting of subdir/file on the stats of dir/file */
$file_path = __DIR__;
--FILE--
<?php
-/*
- * Prototype: array stat ( string $filename );
- * Description: Gives information about a file
- */
-
/* test the effects on the stats of dir/file for using is_dir() & is_file() on dir/file */
$file_path = __DIR__;
--FILE--
<?php
-/*
- * Prototype: array stat ( string $filename );
- * Description: Gives information about a file
- */
-
/* test the stats of file opened in write mode and then same in read mode */
$file_path = __DIR__;
--FILE--
<?php
-/*
- * Prototype: array stat ( string $filename );
- * Description: Gives information about a file
- */
-
/* test the effects on the stats of dir/file for changing permissions of dir/file */
--FILE--
<?php
-/*
- * Prototype: array stat ( string $filename );
- * Description: Gives information about a file
- */
-
/* test the stats of dir/file when their names are stored in objects */
$file_path = __DIR__;
--FILE--
<?php
-/*
- * Prototype: array stat ( string $filename );
- * Description: Gives information about a file
- */
-
/* test the effects of truncate() on stats of file */
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
$file_path = __DIR__;
// temp dir created in present working directory
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
$file_path = __DIR__;
echo "*** Testing symlink(), linkinfo(), link() and is_link() : basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
// create temp $filename and create link $linkname to it
$filename = __DIR__."/symlink_link_linkinfo_is_link_error1.tmp";
$fp = fopen($filename, "w"); // create temp file
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
// create temp $filename and create link $linkname to it
$filename = __DIR__."/symlink_link_linkinfo_is_link_error2.tmp";
$fp = fopen($filename, "w"); // create temp file
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
/* Variation 1 : Creating links across directories where linkname is stored as an object and array member */
// creating temp directory which will contain temp file and links created
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
/* Variation 2 : Create hard link to non-existent file */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
/* Variation 3 : Create file and a soft link to the file
Access data of the file through the soft link
Update the file through soft link
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
/* Variation 4 : Create file and a hard link to the file
Access data of the file through the hard link
Update the file through hard link
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
/* Variation 5 : Creating link, deleting it and checking linkinfo(), is_link() on it */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
/* Variation 6 : Change permission of directory and try creating links inside that directory */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
/* Variation 7 : Create soft/hard link to itself */
// temp file used
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
/* Variation 8 : Create soft/hard link to different directory */
/* creating link to a file in different dir with the same name as the file */
?>
--FILE--
<?php
-/* Prototype: bool symlink ( string $target, string $link );
- Description: creates a symbolic link to the existing target with the specified name link
-
- Prototype: bool is_link ( string $filename );
- Description: Tells whether the given file is a symbolic link.
-
- Prototype: bool link ( string $target, string $link );
- Description: Create a hard link
-
- Prototype: int linkinfo ( string $path );
- Description: Gets information about a link
-*/
-
/* Variation 9 : Check lstat of soft/hard link created
Check linkinfo() value with lstat['dev']
*/
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Creating number of unique files by passing a file name as prefix */
$file_path = __DIR__."/tempnamVar1_私はガラスを食べられます";
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Creating number of unique files by passing a file name as prefix */
$file_path = __DIR__."/tempnamVar1";
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Creating number of unique files by passing a file name as prefix */
$file_path = __DIR__."/tempnamVar1";
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Creating unique files in various dirs by passing relative paths to $dir arg */
echo "*** Testing tempnam() with absolute and relative paths ***\n";
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Creating unique files in various dirs by passing relative paths to $dir arg */
echo "*** Testing tempnam() with absolute and relative paths ***\n";
obscure_filename
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Passing invalid/non-existing args for $prefix */
echo "*** Testing tempnam() with obscure prefixes ***\n";
obscure_filename
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Passing invalid/non-existing args for $prefix */
echo "*** Testing tempnam() with obscure prefixes ***\n";
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Trying to create the file in a dir with permissions from 0000 to 0350,
Allowable permissions: files are expected to be created in the input dir
Non-allowable permissions: files are expected to be created in '/tmp' dir
--EXPECTF--
*** Testing tempnam() with dir of permissions from 0000 to 0350 ***
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
0
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
1
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
2
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
3
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
4
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
5
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
6
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
7
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
10
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
11
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
12
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
13
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
14
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
15
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
16
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
17
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
20
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
21
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
22
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
23
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
24
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
25
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
26
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
27
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
30
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
31
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
32
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
33
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
34
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
35
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
36
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
37
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
40
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
41
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
42
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
43
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
44
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
45
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
46
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
47
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
50
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
51
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
52
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
53
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
54
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
55
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
56
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
57
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
60
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
61
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
62
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
63
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
64
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
65
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
66
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
67
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
70
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
71
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
72
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
73
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
74
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
75
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
76
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
77
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
100
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
101
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
102
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
103
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
104
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
105
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
106
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
107
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
110
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
111
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
112
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
113
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
114
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
115
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
116
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
117
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
120
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
121
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
122
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
123
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
124
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
125
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
126
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
127
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
130
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
131
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
132
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
133
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
134
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
135
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
136
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
137
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
140
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
141
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
142
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
143
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
144
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
145
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
146
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
147
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
150
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
151
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
152
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
153
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
154
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
155
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
156
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
157
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
160
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
161
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
162
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
163
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
164
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
165
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
166
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
167
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
170
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
171
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
172
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
173
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
174
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
175
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
176
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
177
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
200
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
201
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
202
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
203
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
204
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
205
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
206
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
207
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
210
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
211
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
212
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
213
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
214
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
215
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
216
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
217
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
220
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
221
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
222
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
223
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
224
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
225
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
226
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
227
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
230
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
231
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
232
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
233
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
234
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
235
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
236
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
237
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
240
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
241
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
242
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
243
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
244
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
245
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
246
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
247
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
250
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
251
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
252
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
253
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
254
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
255
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
256
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
257
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
260
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
261
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
262
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
263
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
264
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
265
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
266
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
267
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
270
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
271
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
272
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
273
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
274
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
275
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
276
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-0.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
277
*** Done ***
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Trying to create the file in a dir with permissions from 0351 to 0777,
Allowable permissions: files are expected to be created in the input dir
Non-allowable permissions: files are expected to be created in '/tmp' dir
--EXPECTF--
*** Testing tempnam() with dir of permissions from 0351 to 0777 ***
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
400
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
401
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
402
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
403
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
404
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
405
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
406
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
407
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
410
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
411
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
412
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
413
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
414
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
415
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
416
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
417
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
420
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
421
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
422
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
423
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
424
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
425
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
426
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
427
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
430
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
431
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
432
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
433
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
434
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
435
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
436
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
437
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
440
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
441
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
442
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
443
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
444
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
445
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
446
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
447
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
450
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
451
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
452
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
453
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
454
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
455
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
456
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
457
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
460
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
461
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
462
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
463
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
464
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
465
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
466
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
467
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
470
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
471
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
472
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
473
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
474
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
475
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
476
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
477
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
500
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
501
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
502
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
503
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
504
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
505
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
506
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
507
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
510
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
511
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
512
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
513
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
514
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
515
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
516
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
517
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
520
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
521
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
522
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
523
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
524
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
525
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
526
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
527
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
530
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
531
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
532
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
533
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
534
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
535
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
536
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
537
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
540
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
541
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
542
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
543
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
544
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
545
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
546
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
547
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
550
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
551
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
552
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
553
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
554
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
555
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
556
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
557
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
560
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
561
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
562
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
563
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
564
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
565
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
566
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
567
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
570
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
571
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
572
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
573
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
574
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
575
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
576
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
577
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
600
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
601
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
602
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
603
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
604
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
605
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
606
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
607
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
610
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
611
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
612
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
613
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
614
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
615
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
616
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
617
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
620
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
621
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
622
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
623
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
624
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
625
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
626
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
627
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
630
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
631
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
632
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
633
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
634
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
635
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
636
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
637
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
640
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
641
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
642
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
643
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
644
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
645
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
646
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
647
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
650
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
651
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
652
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
653
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
654
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
655
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
656
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
657
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
660
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
661
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
662
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
663
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
664
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
665
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
666
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
667
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
670
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
671
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
672
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
673
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
674
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
675
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
676
-Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation4-1.php on line 20
+Notice: tempnam(): file created in the system's temporary directory in %s on line %d
677
*** Done ***
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Passing an existing file as $prefix for tempnam() fn */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Passing an existing file as $prefix for tempnam() fn */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Trying to create unique files by passing previously created unique file name as prefix */
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Trying to create unique files by passing previously created unique file name as prefix */
$file_path = __DIR__;
obscure_filename
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Passing invalid/non-existing args for $dir,
hence the unique files will be created in temporary dir */
obscure_filename
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Passing invalid/non-existing args for $dir,
hence the unique files will be created in temporary dir */
?>
--FILE--
<?php
-/* Prototype: string tempnam ( string $dir, string $prefix );
- Description: Create file with unique file name.
-*/
-
/* Creating unique files in various dirs by passing relative paths to $dir arg */
echo "*** Testing tempnam() with absolute and relative paths ***\n";
?>
--FILE--
<?php
-/* Prototype : proto bool touch(string filename [, int time [, int atime]])
- * Description: Set modification time of file
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
echo "*** Testing touch() : basic functionality ***\n";
$filename = __DIR__."/touch_私はガラスを食べられます.dat";
?>
--FILE--
<?php
-/* Prototype : proto bool touch(string filename [, int time [, int atime]])
- * Description: Set modification time of file
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
echo "*** Testing touch() : basic functionality ***\n";
$filename = __DIR__."/touch.dat";
?>
--FILE--
<?php
-/* Prototype : proto bool touch(string filename [, int time [, int atime]])
- * Description: Set modification time of file
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
echo "*** Testing touch() : basic functionality ***\n";
$filename = __DIR__."/touch_basic.dat";
}
--FILE--
<?php
-/* Prototype : bool touch(string filename [, int time [, int atime]])
- * Description: Set modification time of file
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
$workDir = "touchVar5.tmp";
$subDirOrFile = "aSubDirOrFile";
$cwd = __DIR__;
?>
--FILE--
<?php
-/* Prototype : bool touch(string filename [, int time [, int atime]])
- * Description: Set modification time of file
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
$workDir = "touchVar5.tmp";
$subDirOrFile = "aSubDirOrFile";
mkdir($workDir);
?>
--FILE--
<?php
-/* Prototype : bool touch(string filename [, int time [, int atime]])
- * Description: Set modification time of file
- * Source code: ext/standard/filestat.c
- * Alias to functions:
- */
-
$workDir = "touchVar5.tmp";
$subDirOrFile = "aSubDirOrFile";
chdir(__DIR__);
?>
--FILE--
<?php
-/* Prototype: int umask ( [int $mask] );
- Description: Changes the current umask
-*/
-
echo "*** Testing umask() : basic functionality ***\n";
// checking umask() on all the modes
for($mask = 0000; $mask <= 0777; $mask++) {
?>
--FILE--
<?php
-/* Prototype: int umask ( [int $mask] );
- Description: Changes the current umask
-*/
-
$file_path = __DIR__;
/* Check umask() on file/dir */
?>
--FILE--
<?php
-/* Prototype: int umask ( [int $mask] );
- Description: Changes the current umask
-*/
-
$file_path = __DIR__;
/* Check umask() on file/dir */
Testing unlink() function : basic functionality
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
$file_path = __DIR__.DIRECTORY_SEPARATOR."私はガラスを食べられます";
?>
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
$file_path = __DIR__;
?>
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
/* Delete file having default permission but its dir having readonly permission
Delete file having readonly permission but dir having default permission
?>
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
/* Delete file having default permission but its dir having readonly permission
Delete file having readonly permission but dir having default permission
?>
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
/* Delete file having default permission but its dir having readonly permission
Delete file having readonly permission but dir having default permission
?>
--FILE--
<?php
-/* Prototype : bool unlink(string filename[, context context])
- * Description: Delete a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing unlink() : variation ***\n";
$workDir = "unlinkVar10.tmp";
Test unlink() function : usage variations - unlink file in use
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
/* Try to unlink file when file handle is still in use */
?>
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
/* Delete link files - soft and hard links */
Test unlink() function : usage variations - unlink deleted file
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
/* Try deleting a file which is already deleted */
?>
--FILE--
<?php
-/* Prototype : bool unlink ( string $filename [, resource $context] );
- Description : Deletes filename
-*/
/* delete files with different file permission(0000 to 0777) */
Dave Kelsey <d_kelsey@uk.ibm.com>
--FILE--
<?php
-/* Prototype : bool unlink(string filename[, context context])
- * Description: Delete a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing unlink() : variation: contexts and relative files ***\n";
// test relative directories and stream contexts.
?>
--FILE--
<?php
-/* Prototype : bool unlink(string filename[, context context])
- * Description: Delete a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing unlink() : variation ***\n";
$workDir = "unlinkVar8.tmp";
?>
--FILE--
<?php
-/* Prototype : bool unlink(string filename[, context context])
- * Description: Delete a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing unlink() : variation ***\n";
$workDir = "unlinkVar8.tmp";
?>
--FILE--
<?php
-/* Prototype : bool unlink(string filename[, context context])
- * Description: Delete a file
- * Source code: ext/standard/file.c
- * Alias to functions:
- */
-
echo "*** Testing unlink() : variation ***\n";
$workDir = "unlinkVar9.tmp";
?>
--FILE--
<?php
-/* Prototype : bool stream_filter_remove(resource stream_filter)
- * Description: Flushes any data in the filter's internal buffer, removes it from the chain, and frees the resource
- * Source code: ext/standard/streamsfuncs.c
- * Alias to functions:
- */
-
echo "*** Testing stream_filter_remove() : basic functionality ***\n";
$file = __DIR__ . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
?>
--FILE--
<?php
-/* Prototype : bool stream_filter_remove(resource stream_filter)
- * Description: Flushes any data in the filter's internal buffer, removes it from the chain, and frees the resource
- * Source code: ext/standard/streamsfuncs.c
- * Alias to functions:
- */
-
$file = __DIR__ . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
touch( $file );
$fp = fopen( $file, 'w+' );
<?php if (PHP_ZTS) { print "skip only for no-zts build"; }
--FILE--
<?php
-/* Prototype: void debug_zval_dump ( mixed $variable );
- Description: Dumps a string representation of an internal zend value to output.
-*/
-
-/* Prototype: void zval_dump( $value );
- Description: use debug_zval_dump() to display the objects and its
- reference count */
function zval_dump( $values ) {
$counter = 1;
foreach( $values as $value ) {
Test debug_zval_dump() function : usage variations
--FILE--
<?php
-/* Prototype: void debug_zval_dump ( mixed $variable );
- Description: Dumps a string representation of an internal zend value
- to output.
-*/
-
echo "*** Testing debug_zval_dump() on functions ***\n";
echo "--- Variation 1: global variable inside a function ---\n";
$global_var = 10; //declaring global variable
?>
--FILE--
<?php
-/* Prototype : string escapeshellarg ( string $arg )
- * Description: Escape a string to be used as a shell argument.
- * Source code: ext/standard/exec.c
- * Alias to functions:
- */
-
echo "Simple testcase for escapeshellarg() function\n";
var_dump(escapeshellarg("テストマルチバイ'ト・パス"));
?>
--FILE--
<?php
-/* Prototype : string escapeshellarg ( string $arg )
- * Description: Escape a string to be used as a shell argument.
- * Source code: ext/standard/exec.c
- * Alias to functions:
- */
-
echo "Simple testcase for escapeshellarg() function\n";
var_dump(escapeshellarg("Mr O'Neil"));
?>
--FILE--
<?php
-/* Prototype : string escapeshellarg ( string $arg )
- * Description: Escape a string to be used as a shell argument.
- * Source code: ext/standard/exec.c
- * Alias to functions:
- */
-
echo "Simple testcase for escapeshellarg() function\n";
var_dump(escapeshellarg("Mr O'Neil"));
--FILE--
<?php
-/* Prototype : string escapeshellarg ( string $arg )
- * Description: Escape a string to be used as a shell argument.
- * Source code: ext/standard/exec.c
- */
-
echo "*** Testing escapeshellarg() : usage variations ***\n";
//get an unset variable
--FILE--
<?php
-/* Prototype : string escapeshellarg ( string $arg )
- * Description: Escape a string to be used as a shell argument.
- * Source code: ext/standard/exec.c
- */
-
echo "*** Testing escapeshellarg() : usage variations ***\n";
//get an unset variable
Testing floatval() and its alias doubleval() Functions
--FILE--
<?php
-/* Prototype: float floatval( mixed $var );
- * Description: Returns the float value of var.
- */
-
echo "*** Testing floatval() with valid float values ***\n";
// different valid float values
$valid_floats = array(
*** Testing floatval() on non floating types ***
-Notice: A non well formed numeric value encountered in %s on line 69
+Notice: A non well formed numeric value encountered in %s on line %d
-Notice: A non well formed numeric value encountered in %s on line 70
+Notice: A non well formed numeric value encountered in %s on line %d
float(-2147483648)
float(2147483648)
float(%d)
precision = 14
--FILE--
<?php
-/* Prototype: float floatval( mixed $var );
- * Description: Returns the float value of var.
- */
-
// different valid float values
$valid_floats = array(
"0.0" => 0.0,
Testing floatval() and its alias doubleval() functions : usage variations - different data types as $y arg
--FILE--
<?php
-/* Prototype: float floatval( mixed $var );
- * Description: Returns the float value of var.
- */
-
-
-
// get a resource type variable
$fp = fopen (__FILE__, "r");
fclose($fp);
Test get_defined_constants() function : basic functionality
--FILE--
<?php
-/* Prototype : array get_defined_constants ([ bool $categorize ] )
- * Description: Returns an associative array with the names of all the constants and their values
- * Source code: Zend/zend_builtin_functions.c
- */
-
echo "*** Testing get_defined_constants() : basic functionality ***\n";
var_dump(gettype(get_defined_constants(true)));
Test get_defined_vars() function
--FILE--
<?php
-/* Prototype: array get_defined_vars ( void )
- Description: This function returns a multidimensional array containing a list of all defined
- variables, be them environment, server or user-defined variables, within the scope that
- get_defined_vars() is called.
-*/
-
echo "Simple testcase for get_defined_vars() function\n\n";
function f1() {
Test get_extension_funcs() function: basic test
--FILE--
<?php
-/* Prototype : array get_extension_funcs ( string $module_name )
- * Description: Returns an array with the names of the functions of a module.
- * Source code: Zend/zend_builtin_functions.c
- * Alias to functions:
- */
-
echo "Simple testcase for get_extension_funcs() function\n";
$result = get_extension_funcs("standard");
include_path=.
--FILE--
<?php
-/* Prototype: string get_include_path ( void )
- * Description: Gets the current include_path configuration option
-*/
echo "*** Testing get_include_path()\n";
include_path=.
--FILE--
<?php
-/* Prototype: array get_included_files ( void )
- * Description: Returns an array with the names of included or required files
-*/
echo "*** Testing get_included_files()\n";
Test get_loaded_extensions() function : basic functionality
--FILE--
<?php
-/* Prototype : array get_loaded_extensions ([ bool $zend_extensions= false ] )
- * Description: Returns an array with the names of all modules compiled and loaded
- * Source code: Zend/zend_builtin_functions.c
- */
-
echo "*** Testing get_loaded_extensions() : basic functionality ***\n";
echo "Get loaded extensions\n";
Test get_resource_type() function : basic functionality
--FILE--
<?php
-/* Prototype : string get_resource_type ( resource $handle )
- * Description: Returns the resource type
- * Source code: Zend/zend_builtin_functions.c
- */
-
echo "*** Testing get_resource_type() : basic functionality ***\n";
$res = fopen(__FILE__, "r");
Test getmypid() function: basic test
--FILE--
<?php
-/* Prototype : int getmypid ( void )
- * Description: Gets the current PHP process ID.
- * Source code: ext/standard/pageinfo.c
- * Alias to functions:
- */
-
echo "Simple testcase for getmypid() function\n";
var_dump(getmypid());
<?php if (!function_exists("getrusage")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array getrusage ([ int $who ] )
- * Description: Gets the current resource usages
- * Source code: ext/standard/microtime.c
- * Alias to functions:
- */
-
echo "Simple testcase for getrusage() function\n";
$dat = getrusage();
precision=14
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test the basic functionalities of settype() & gettype() functions.
Use the gettype() to get the type of regular data and use settype()
to change its type to other types */
Test gettype() & settype() functions : error conditions
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test different error conditions of settype() and gettype() functions */
echo "**** Testing gettype() and settype() functions ****\n";
precision=14
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test usage variation of gettype() and settype() functions:
settype() to null type.
Set type of the data to "null" and verify using gettype
precision=14
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test usage variation of gettype() and settype() functions:
settype() to int/integer type.
Set type of the data to "int"/"integer" and verify using gettype
?>
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test usage variation of gettype() and settype() functions:
settype() to float/double type.
Set type of the data to "float"/"double" and verify using gettype
precision=14
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test usage variation of gettype() and settype() functions:
settype() to bool/boolean type.
Set type of the data to "bool"/"boolean" and verify using gettype
precision=14
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test usage variation of gettype() and settype() functions:
settype() to resource type.
Set type of the data to "resource" and verify using gettype
precision=14
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test usage variation of gettype() and settype() functions:
settype() to array type.
Set type of the data to "array" and verify using gettype
precision=14
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test usage variation of gettype() and settype() functions:
settype() to object type.
Set type of the data to "object" and verify using gettype
precision=14
--FILE--
<?php
-/* Prototype: string gettype ( mixed $var );
- Description: Returns the type of the PHP variable var
-
- Prototype: bool settype ( mixed &$var, string $type );
- Description: Set the type of variable var to type
-*/
-
/* Test usage variation of gettype() and settype() functions:
settype() to string type.
Set type of the data to "string" and verify using gettype
?>
--FILE--
<?php
-/* Prototype: int intval( mixed $var [.int $base] );
- * Description: Returns the integer value of var, using the specified base for the conversion(the default is base 10).
- */
-
echo "*** Testing intval() with valid integer values ***\n";
// different valid integer values
$valid_ints = array(
Test intval() function : usage variation
--FILE--
<?php
-/* Prototype : int intval(mixed var [, int base])
- * Description: Get the integer value of a variable using the optional base for the conversion
- * Source code: ext/standard/type.c
- * Alias to functions:
- */
-
echo "*** Testing intval() : usage variation ***\n";
// Define error handler
Test is_array() function
--FILE--
<?php
-/* Prototype: bool is_array ( mixed $var );
- * Description: Finds whether the given variable is an array
- */
-
echo "*** Testing is_array() on different type of arrays ***\n";
/* different types of arrays */
$arrays = array(
Test is_bool() function
--FILE--
<?php
-/* Prototype: bool is_bool ( mixed $var );
- * Description: Finds whether the given variable is a boolean
- */
-
echo "*** Testing is_bool() with valid boolean values ***\n";
// different valid boolean values
$valid_bools = array(
Test is_callable() function : usage variations - defined functions
--FILE--
<?php
-/* Prototype: bool is_callable ( mixed $var [, bool $syntax_only [, string &$callable_name]] );
- * Description: Verify that the contents of a variable can be called as a function
- * Source code: ext/imap/php_imap.c
- */
-
-/* Prototype: void check_iscallable( $functions );
- Description: use iscallable() on given string to check for valid function name
- returns true if valid function name, false otherwise
-*/
function check_iscallable( $functions ) {
$counter = 1;
foreach($functions as $func) {
Test is_callable() function : usage variations - on objects
--FILE--
<?php
-/* Prototype: bool is_callable ( mixed $var [, bool $syntax_only [, string &$callable_name]] );
- Description: Verify that the contents of a variable can be called as a function
- In case of objects, $var = array($SomeObject, 'MethodName')
-*/
-
-/* Prototype: void check_iscallable_objects( $methods );
- Description: use is_callable() on given $method to check if the array
- contains a valid method name;
- returns true if valid function name, false otherwise
-*/
function check_iscallable_objects( $methods ) {
global $loop_counter;
$counter = 1;
Test is_callable() function : usage variations - undefined functions
--FILE--
<?php
-/* Prototype: bool is_callable ( mixed $var [, bool $syntax_only [, string &$callable_name]] );
- Description: Verify that the contents of a variable can be called as a function
- In case of objects, $var = array($SomeObject, 'MethodName')
-*/
-
-/* Prototype: void check_iscallable( $functions );
- Description: use iscallable() on given string to check for valid function name
- returns true if valid function name, false otherwise
-*/
function check_iscallable( $functions ) {
$counter = 1;
foreach($functions as $func) {
Test is_callable() function : usage variations - on invalid function names
--FILE--
<?php
-/* Prototype: bool is_callable ( mixed $var [, bool $syntax_only [, string &$callable_name]] );
- Description: Verify that the contents of a variable can be called as a function
- In case of objects, $var = array($SomeObject, 'MethodName')
-*/
-
-/* Prototype: void check_iscallable( $functions );
- Description: use iscallable() on given string to check for valid function name
- returns true if valid function name, false otherwise
-*/
function check_iscallable( $functions ) {
$counter = 1;
foreach($functions as $func) {
?>
--FILE--
<?php
-/* Prototype: bool is_float ( mixed $var );
- * Description: Finds whether the given variable is a float
- */
-
echo "*** Testing is_float(), is_double() with float values***\n";
// different valid float values
$floats = array(
precision=14
--FILE--
<?php
-/* Prototype: bool is_float ( mixed $var );
- * Description: Finds whether the given variable is a float
- */
-
echo "*** Testing is_float(), is_double() with float values***\n";
// different valid float values
$floats = array(
?>
--FILE--
<?php
-/* Prototype: bool is_int ( mixed $var );
- * Description: Finds whether the given variable is an integer
- */
-
echo "*** Testing is_int(), is_integer() & is_long() with valid integer values ***\n";
// different valid integer values
$valid_ints = array(
precision=14
--FILE--
<?php
-/* Prototype: bool is_int ( mixed $var );
- * Description: Finds whether the given variable is an integer
- */
-
echo "*** Testing is_int(), is_integer() & is_long() with valid integer values ***\n";
// different valid integer values
$valid_ints = array(
Test is_null() function
--FILE--
<?php
-/* Prototype: bool is_null ( mixed $var );
- * Description: Finds whether the given variable is NULL
- */
-
echo "*** Testing is_null() with valid null values ***\n";
// different valid null values
$unset_array = array();
Test is_numeric() function
--FILE--
<?php
-/* Prototype: bool is_numeric ( mixed $var );
- * Description: Finds whether a variable is a number or a numeric string
- */
-
echo "*** Testing is_numeric() with valid numeric values ***\n";
// different valid numeric values
$numerics = array(
Test is_object() function
--FILE--
<?php
-/* Prototype: bool is_object ( mixed $var );
- * Description: Finds whether the given variable is an object
- */
-
echo "*** Testing is_object() with valid objects ***\n";
// class with no members
Test is_resource() function : basic functionality
--FILE--
<?php
-/* Prototype : bool is_resource ( mixed $var )
- * Description: Finds whether a variable is a resource
- * Source code: ext/standard/type.c
- */
-
echo "*** Testing is_resource() : basic functionality ***\n";
class Hello {
Test is_scalar() function
--FILE--
<?php
-/* Prototype: bool is_scalar ( mixed $var );
- * Description: Finds whether a variable is a scalar (i.e integer, float, string or boolean)
- */
-
echo "*** Testing basic operations ***\n";
$scalar_variables = array(
0, // integers
Test is_string() function
--FILE--
<?php
-/* Prototype: bool is_string ( mixed $var );
- * Description: Finds whether the given variable is a string
- */
-
echo "*** Testing is_string() with valid string values ***\n";
// different valid strings
Test isset() function : basic functionality
--FILE--
<?php
-/* Prototype : bool isset ( mixed $var [, mixed $var [, $... ]] )
- * Description: Determine if a variable is set and is not NULL
- */
-
class foo {}
echo "*** Testing isset() : basic functionality ***\n";
Test isset() function : basic functionality
--FILE--
<?php
-/* Prototype : bool isset ( mixed $var [, mixed $var [, $... ]] )
- * Description: Determine if a variable is set and is not NULL
- */
-
class foo {}
echo "*** Testing isset() : basic functionality ***\n";
output_buffering=0
--FILE--
<?php
-/* Prototype : bool ob_get_flush(void)
- * Description: Get current buffer contents, flush (send) the output buffer, and delete current output buffer
- * Source code: main/output.c
- * Alias to functions:
- */
-
echo "*** Testing ob_get_flush() : basic functionality ***\n";
ob_start();
output_buffering=0
--FILE--
<?php
-/* Prototype : bool ob_get_flush(void)
- * Description: Get current buffer contents, flush (send) the output buffer, and delete current output buffer
- * Source code: main/output.c
- * Alias to functions:
- */
-
echo "*** Testing ob_get_flush() : error conditions ***\n";
// No ob_start() executed
output_buffering=0
--FILE--
<?php
-/* Prototype : int ob_get_length(void)
- * Description: Return the length of the output buffer
- * Source code: main/output.c
- * Alias to functions:
- */
-
function dump_string_length( $string )
{
ob_start();
Test parse_ini_string() function
--FILE--
<?php
-/* Prototype: array parse_ini_string(string $string [,bool $process_sections]);
- Description: parse_ini_string() loads in the ini file specified in filename,
- and returns the settings in it in an associative array.
-*/
-
$parse_string = <<<EOD
; Comment starts with semi-colon(;)
; Section starts with [<section name>]
Test php_uname() function - basic test
--FILE--
<?php
-/* Prototype: string php_uname ([ string $mode ] )
- * Description: Returns information about the operating system PHP is running on
-*/
echo "*** Testing php_uname() - basic test\n";
Test php_uname() function - error conditions - pass function incorrect arguments
--FILE--
<?php
-/* Prototype: string php_uname ([ string $mode ] )
- * Description: Returns information about the operating system PHP is running on
-*/
echo "*** Testing php_uname() - error test\n";
precision=14
--FILE--
<?php
-/* Prototype: bool print_r ( mixed $expression [, bool $return] );
- Description: Prints human-readable information about a variable
-*/
-/* Prototype: void check_printr( $variables )
- Description: use print_r() to print variables */
function check_printr( $variables ) {
$counter = 1;
foreach( $variables as $variable ) {
precision=14
--FILE--
<?php
-/* Prototype: bool print_r ( mixed $expression [, bool $return] );
- Description: Prints human-readable information about a variable
-*/
-/* Prototype: void check_printr( $variables )
- Description: use print_r() to print variables */
function check_printr( $variables ) {
$counter = 1;
foreach( $variables as $variable ) {
?>
--FILE--
<?php
-/* Prototype : int sleep ( int $seconds )
- * Description: Delays the program execution for the given number of seconds .
- * Source code: ext/standard/basic_functions.c
- */
-
echo "*** Testing sleep() : basic functionality ***\n";
$sleeptime = 1; // sleep for 1 seconds
precision=14
--FILE--
<?php
-/* Prototype: string strval ( mixed $var );
- * Description: Returns the string value of var
- */
-
echo "*** Testing str_val() with scalar values***\n";
$heredoc_string = <<<EOD
This is a multiline heredoc
Test uniqid() function : basic functionality
--FILE--
<?php
-/* Prototype : string uniqid ([ string $prefix= "" [, bool $more_entropy= false ]] )
- * Description: Gets a prefixed unique identifier based on the current time in microseconds.
- * Source code: ext/standard/uniqid.c
-*/
echo "*** Testing uniqid() : basic functionality ***\n";
echo "\nuniqid() without a prefix\n";
?>
--FILE--
<?php
-/* Prototype : void usleep ( int $micro_seconds )
- * Description: Delays program execution for the given number of micro seconds.
- * Source code: ext/standard/basic_functions.c
- */
-
set_time_limit(20);
echo "*** Testing usleep() : basic functionality ***\n";
precision=14
--FILE--
<?php
-/* Prototype: void var_dump ( mixed $expression [, mixed $expression [, $...]] );
- Description: Displays structured information about one or more expressions that includes its type and value.
-*/
-/* Prototype: void check_vardump( $variables );
- Description: use var_dump() to display the variables */
function check_vardump( $variables ) {
$counter = 1;
foreach( $variables as $variable ) {
precision=14
--FILE--
<?php
-/* Prototype: void var_dump ( mixed $expression [, mixed $expression [, $...]] );
- Description: Displays structured information about one or more expressions that includes its type and value.
-*/
-/* Prototype: void check_vardump( $variables );
- Description: use var_dump() to display the variables */
function check_vardump( $variables ) {
$counter = 1;
foreach( $variables as $variable ) {
--FILE--
<?php
setlocale(LC_ALL, "german", "de","de_DE","de_DE.ISO8859-1","de_DE.ISO_8859-1","de_DE.UTF-8");
-/* Prototype: mixed var_export( mixed expression [, bool return]);
- * Description: Returns the variable representation when the return parameter is used and evaluates to TRUE. Otherwise, this function will return NULL.
-
-*/
-
echo "*** Testing var_export() with integer values ***\n";
// different integer values
$valid_ints = array(
--FILE--
<?php
setlocale(LC_ALL, "german", "de","de_DE","de_DE.ISO8859-1","de_DE.ISO_8859-1","de_DE.UTF-8");
-/* Prototype: mixed var_export( mixed expression [, bool return]);
- * Description: Returns the variable representation when the return parameter is used and evaluates to TRUE. Otherwise, this function will return NULL.
-
-*/
-
echo "*** Testing var_export() with integer values ***\n";
// different integer values
$valid_ints = array(
?>
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "*** Testing var_export() with integer values ***\n";
// different integer values
$valid_ints = array(
?>
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "*** Testing var_export() with integer values ***\n";
// different integer values
$valid_ints = array(
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "*** Testing var_export() with valid boolean values ***\n";
// different valid boolean values
$valid_bool = array(
serialize_precision=17
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "*** Testing var_export() with valid float values ***\n";
// different valid float values
$valid_floats = array(
Test var_export() function with valid strings
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
-
echo "*** Testing var_export() with valid strings ***\n";
// different valid string
$valid_strings = array(
serialize_precision=17
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
-
echo "*** Testing var_export() with valid arrays ***\n";
// different valid arrays
$valid_arrays = array(
Test var_export() function with valid objects
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "*** Testing var_export() with valid objects ***\n";
// class with no members
Test var_export() function with valid null values
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "*** Testing var_export() with valid null values ***\n";
// different valid null values
var_export(): simple test with arrays and objects
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "\n\n-- Var export on a simple object --\n";
$o1 = new stdclass;
$o1->p = '22';
Test var_export() function : error conditions - recursive object
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
$obj = new stdClass;
$obj->p =& $obj;
var_export($obj, true);
?>
--EXPECTF--
-Warning: var_export does not handle circular references in %s on line 10
+Warning: var_export does not handle circular references in %s on line %d
Test var_export() function : error conditions - recursive array
--FILE--
<?php
-/* Prototype : mixed var_export(mixed var [, bool return])
- * Description: Outputs or returns a string representation of a variable
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
$a[] =& $a;
var_export($a, true);
?>
--EXPECTF--
-Warning: var_export does not handle circular references in %s on line 9
+Warning: var_export does not handle circular references in %s on line %d
Test getimagesize() function : basic functionality
--FILE--
<?php
-/* Prototype : array getimagesize(string imagefile [, array info])
- * Description: Get the size of an image as 4-element array
- * Source code: ext/standard/image.c
- */
-
$imagetype_filenames = array(
// GIF file
"GIF image file" => "200x100.gif",
Test getimagesize() function : basic functionality - load APP info from jpeg.
--FILE--
<?php
-/* Prototype : proto array getimagesize(string imagefile [, array info])
- * Description: Get the size of an image as 4-element array
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
-
/*
* Load APP info from jpeg
*/
GetImageSize() for tiff format with big-endian (aka Motorola, aka MM) ordering
--FILE--
<?php
-/* Prototype : proto array getimagesize(string imagefile [, array info])
- * Description: Get the size of an image as 4-element array
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
-
echo "*** Testing getimagesize() : tiff_mm format ***\n";
var_dump(getimagesize(__DIR__ . "/2x2mm.tiff", $arr));
var_dump($arr);
Test getimagesize() function : usage variations - unexpected type for arg 2
--FILE--
<?php
-/* Prototype : proto array getimagesize(string imagefile [, array info])
- * Description: Get the size of an image as 4-element array
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
-
function test_error_handler($err_no, $err_msg, $filename, $linenum) {
echo "Error: $err_no - $err_msg\n";
}
Test getimagesize() function : variation - Passing non image files
--FILE--
<?php
-/* Prototype : array getimagesize(string imagefile [, array info])
- * Description: Get the size of an image as 4-element array
- * Source code: ext/standard/image.c
- */
-
-
$file_types_array = array (
//File containing text string
"File with text data" => "test.txt",
?>
--FILE--
<?php
-/* Prototype : array getimagesize(string imagefile [, array info])
- * Description: Get the size of an image as 4-element array
- * Source code: ext/standard/image.c
- */
-
echo "*** Testing getimagesize() : variation ***\n";
var_dump( getimagesize(__DIR__."/test13pix.swf", $info) );
?>
--FILE--
<?php
-/* Prototype : array getimagesize(string imagefile [, array info])
- * Description: Get the size of an image as 4-element array
- * Source code: ext/standard/image.c
- */
-
echo "*** Testing getimagesize() : basic functionality ***\n";
var_dump( getimagesize(__DIR__."/test13pix.swf", $info) );
GetImageSize() for wbmp format
--FILE--
<?php
-/* Prototype : proto array getimagesize(string imagefile [, array info])
- * Description: Get the size of an image as 4-element array
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
-
echo "*** Testing getimagesize() : wbmp format ***\n";
var_dump(getimagesize(__DIR__ . "/75x50.wbmp", $arr));
var_dump($arr);
GetImageSize() for xbm format
--FILE--
<?php
-/* Prototype : proto array getimagesize(string imagefile [, array info])
- * Description: Get the size of an image as 4-element array
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
-
echo "*** Testing getimagesize() : xbm format ***\n";
var_dump(getimagesize(__DIR__ . "/75x50.xbm", $arr));
var_dump($arr);
--FILE--
<?php
-/* Prototype : string image_type_to_mime_type ( int $imagetype )
- * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype.
- * Source code: ext/standard/image.c
- * Alias to functions:
- */
-
echo "Starting image_type_to_mime_type() test\n\n";
$image_types = array (
Test image_type_to_mime_type() function : usage variations - Pass decimal, octal, and hexadecimal values as imagetype
--FILE--
<?php
-/* Prototype : string image_type_to_mime_type(int imagetype)
- * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype
- * Source code: ext/standard/image.c
- */
-
echo "*** Testing image_type_to_mime_type() : usage variations ***\n";
error_reporting(E_ALL ^ E_NOTICE);
Sanjay Mantoor <sanjay.mantoor@gmail.com>
--FILE--
<?php
-/* Prototype : string image_type_to_mime_type(int imagetype)
- * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype
- * Source code: ext/standard/image.c
- */
-
echo "*** Testing image_type_to_mime_type() : usage variations ***\n";
for($imagetype = 0; $imagetype <= IMAGETYPE_COUNT; ++$imagetype) {
?>
--FILE--
<?php
-/* Prototype : string image_type_to_mime_type(int imagetype)
- * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype
- * Source code: ext/standard/image.c
- */
-
-
echo "*** Testing image_type_to_mime_type() : usage variations ***\n";
error_reporting(E_ALL ^ E_NOTICE);
mail.add_x_header = On
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : send email without additional headers ***\n";
// Initialise all required variables
mail.add_x_header = Off
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : send email without additional headers ***\n";
// Initialise all required variables
mail.add_x_header = On
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : send email without additional headers ***\n";
// Initialise all required variables
mail.add_x_header = Off
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : basic functionality ***\n";
mail.add_x_header = Off
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message with invalid addtional_headers
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : basic functionality ***\n";
mail.add_x_header = Off
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, mixed additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
error_reporting(-1);
echo "*** Testing mail() : basic functionality ***\n";
************* TEST ******************
-- All Mail Content Parameters --
-Warning: mail(): 'orig-date' header must be at most one header. Array is passed for 'orig-date' in %s on line 59
+Warning: mail(): 'orig-date' header must be at most one header. Array is passed for 'orig-date' in %s on line %d
-Warning: mail(): 'from' header must be at most one header. Array is passed for 'from' in %s on line 59
+Warning: mail(): 'from' header must be at most one header. Array is passed for 'from' in %s on line %d
-Warning: mail(): 'sender' header must be at most one header. Array is passed for 'sender' in %s on line 59
+Warning: mail(): 'sender' header must be at most one header. Array is passed for 'sender' in %s on line %d
-Warning: mail(): 'reply-to' header must be at most one header. Array is passed for 'reply-to' in %s on line 59
+Warning: mail(): 'reply-to' header must be at most one header. Array is passed for 'reply-to' in %s on line %d
-Warning: mail(): Extra header cannot contain 'To' header in %s on line 59
+Warning: mail(): Extra header cannot contain 'To' header in %s on line %d
-Warning: mail(): 'bcc' header must be at most one header. Array is passed for 'bcc' in %s on line 59
+Warning: mail(): 'bcc' header must be at most one header. Array is passed for 'bcc' in %s on line %d
-Warning: mail(): 'message-id' header must be at most one header. Array is passed for 'message-id' in %s on line 59
+Warning: mail(): 'message-id' header must be at most one header. Array is passed for 'message-id' in %s on line %d
-Warning: mail(): 'in-reply-to' header must be at most one header. Array is passed for 'in-reply-to' in %s on line 59
+Warning: mail(): 'in-reply-to' header must be at most one header. Array is passed for 'in-reply-to' in %s on line %d
bool(true)
To: user@example.com
Subject: Test Subject
************* TEST ******************
-- All Mail Content Parameters --
-Warning: mail(): Multiple header key must be numeric index (foo1) in %s on line 84
+Warning: mail(): Multiple header key must be numeric index (foo1) in %s on line %d
-Warning: mail(): Multiple header values must be string (foo2) in %s on line 84
+Warning: mail(): Multiple header values must be string (foo2) in %s on line %d
-Warning: mail(): Multiple header values must be string (foo3) in %s on line 84
+Warning: mail(): Multiple header values must be string (foo3) in %s on line %d
-Warning: mail(): Multiple header values must be string (foo4) in %s on line 84
+Warning: mail(): Multiple header values must be string (foo4) in %s on line %d
-Warning: mail(): Multiple header values must be string (foo5) in %s on line 84
+Warning: mail(): Multiple header values must be string (foo5) in %s on line %d
-Warning: mail(): Multiple header values must be string (foo6) in %s on line 84
+Warning: mail(): Multiple header values must be string (foo6) in %s on line %d
-Warning: mail(): Multiple header values must be string (foo7) in %s on line 84
+Warning: mail(): Multiple header values must be string (foo7) in %s on line %d
bool(true)
To: user@example.com
Subject: Test Subject
************* TEST ******************
-- All Mail Content Parameters --
-Warning: mail(): Header field name (*:foo1) contains invalid chars in %s on line 112
+Warning: mail(): Header field name (*:foo1) contains invalid chars in %s on line %d
-Warning: mail(): Header field name (foo2:::) contains invalid chars in %s on line 112
+Warning: mail(): Header field name (foo2:::) contains invalid chars in %s on line %d
-Warning: mail(): Header field name () contains invalid chars in %s on line 112
+Warning: mail(): Header field name () contains invalid chars in %s on line %d
-Warning: mail(): Header field name (foo7) contains invalid chars in %s on line 112
+Warning: mail(): Header field name (foo7) contains invalid chars in %s on line %d
-Warning: mail(): Header field value (foo10 => abc) contains invalid chars or format in %s on line 112
+Warning: mail(): Header field value (foo10 => abc) contains invalid chars or format in %s on line %d
bool(true)
To: user@example.com
Subject: Test Subject
max_execution_time = 120
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
ini_set("SMTP", "localhost");
ini_set("smtp_port", 25);
ini_set("sendmail_from", "user@example.com");
max_execution_time = 120
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : basic functionality ***\n";
require_once(__DIR__.'/mail_include.inc');
$subject_prefix = "!**PHPT**!";
max_execution_time = 120
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : basic functionality ***\n";
require_once(__DIR__.'/mail_include.inc');
$subject_prefix = "!**PHPT**!";
max_execution_time = 120
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : basic functionality ***\n";
require_once(__DIR__.'/mail_include.inc');
$subject_prefix = "!**PHPT**!";
?>
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : variation ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
echo "*** Testing mail() : basic functionality ***\n";
max_execution_time = 120
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
ini_set("SMTP", "localhost");
ini_set("smtp_port", 2525);
ini_set("sendmail_from", "user@example.com");
max_execution_time = 120
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
ini_set("SMTP", "localplace");
ini_set("smtp_port", 25);
ini_set("sendmail_from", "user@example.com");
max_execution_time = 120
--FILE--
<?php
-/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
- * Description: Send an email message
- * Source code: ext/standard/mail.c
- * Alias to functions:
- */
-
ini_set("SMTP", "localhost");
ini_set("smtp_port", 25);
precision = 14
--FILE--
<?php
-/* Prototype : number abs ( mixed $number )
- * Description: Returns the absolute value of number.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing abs() : basic functionality ***\n";
$values = array(23,
Test abs() function : usage variations - different data types as $number arg
--FILE--
<?php
-/* Prototype : number abs ( mixed $number )
- * Description: Returns the absolute value of number.
- * Source code: ext/standard/math.c
- */
-
/*
* Pass different data types as $number argument to abs() to test behaviour
*/
--FILE--
<?php
/*
- * proto float acos(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float acos(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float acosh(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float acosh(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float asin(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float asin(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float asinh(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float asinh(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float atan(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float atan(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float atanh(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float atanh(float number)
* Function is implemented in ext/standard/math.c
*/
Test base_convert() function : error conditions - incorrect input
--FILE--
<?php
-/* Prototype : string base_convert ( string $number , int $frombase , int $tobase )
- * Description: Convert a number between arbitrary bases.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing base_convert() : error conditions ***\n";
// get a class
Test base_convert() function : usage variations - different data types as $number argument
--FILE--
<?php
-/* Prototype : string base_convert ( string $number , int $frombase , int $tobase )
- * Description: Convert a number between arbitrary bases.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing base_convert() : usage variations ***\n";
//get an unset variable
?>
--FILE--
<?php
-/* Prototype : number bindec ( string $binary_string )
- * Description: Returns the decimal equivalent of the binary number represented by the binary_string argument.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing bindec() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
?>
--FILE--
<?php
-/* Prototype : number bindec ( string $binary_string )
- * Description: Returns the decimal equivalent of the binary number represented by the binary_string argument.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing bindec() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
precision=14
--FILE--
<?php
-/* Prototype : float ceil ( float $value )
- * Description: Round fractions up.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing ceil() : basic functionality ***\n";
$values = array(0,
-0,
precision=14
--FILE--
<?php
-/* Prototype : float ceil ( float $value )
- * Description: Round fractions up.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing ceil() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
--FILE--
<?php
/*
- * proto float cos(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float cos(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float cosh(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float cosh(float number)
* Function is implemented in ext/standard/math.c
*/
?>
--FILE--
<?php
-/* Prototype : string decbin ( int $number )
- * Description: Decimal to binary.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing decbin() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
?>
--FILE--
<?php
-/* Prototype : string decbin ( int $number )
- * Description: Decimal to binary.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing decbin() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
?>
--FILE--
<?php
-/* Prototype : string dechex ( int $number )
- * Description: Returns a string containing a hexadecimal representation of the given number argument.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing dechex() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
?>
--FILE--
<?php
-/* Prototype : string dechex ( int $number )
- * Description: Returns a string containing a hexadecimal representation of the given number argument.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing dechex() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
?>
--FILE--
<?php
-/* Prototype : string decoct ( int $number )
- * Description: Returns a string containing an octal representation of the given number argument.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing decoct() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
?>
--FILE--
<?php
-/* Prototype : string decoct ( int $number )
- * Description: Returns a string containing an octal representation of the given number argument.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing decoct() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
--FILE--
<?php
/*
- * proto float deg2rad(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float deg2rad(float number)
* Function is implemented in ext/standard/math.c
*/
serialize_precision=14
--FILE--
<?php
-/* Prototype : float expm1 ( float $arg )
- * Description: Returns exp(number) - 1, computed in a way that is accurate even
- * when the value of number is close to zero.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing expm1() : basic functionality ***\n";
$values = array(10,
10.3,
precision=14
--FILE--
<?php
-/* Prototype : float floor ( float $value )
- * Description: Round fractions down.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing floor() : basic functionality ***\n";
$values = array(0,
-0,
precision=14
--FILE--
<?php
-/* Prototype : float floor ( float $value )
- * Description: Round fractions down.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing floor() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
?>
--FILE--
<?php
-/* Prototype : number hexdec ( string $hex_string )
- * Description: Returns the decimal equivalent of the hexadecimal number represented by the hex_string argument.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing hexdec() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
?>
--FILE--
<?php
-/* Prototype : number hexdec ( string $hex_string )
- * Description: Returns the decimal equivalent of the hexadecimal number represented by the hex_string argument.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing hexdec() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
--FILE--
<?php
-/* Prototype : float hypot ( float $x , float $y )
- * Description: Calculate the length of the hypotenuse of a right-angle triangle.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing hypot() : basic functionality ***\n";
$valuesy = array(23,
--FILE--
<?php
/*
- * proto float log10(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float log10(float number)
* Function is implemented in ext/standard/math.c
*/
precision=14
--FILE--
<?php
-/* Prototype : float log1p ( float $arg )
- * Description: Returns log(1 + number), computed in a way that is accurate even
- * when the value of number is close to zero
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing log1p() : basic functionality ***\n";
$values = array(23,
precision=14
--FILE--
<?php
-/* Prototype : number octdec ( string $octal_string )
- * Description: Returns the decimal equivalent of the octal number represented by the octal_string argument.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing octdec() : usage variations ***\n";
//get an unset variable
$unset_var = 10;
?>
--FILE--
<?php
-/* Prototype : number pow ( number $base , number $exp )
- * Description: Exponential expression.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing pow() : usage variations ***\n";
//get an unset variable
?>
--FILE--
<?php
-/* Prototype : number pow ( number $base , number $exp )
- * Description: Exponential expression.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing pow() : usage variations ***\n";
//get an unset variable
serialize_precision = 14
--FILE--
<?php
-/* Prototype : number pow ( number $base , number $exp )
- * Description: Exponential expression.
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing pow() : usage variations ***\n";
//get an unset variable
--FILE--
<?php
/*
- * proto float rad2deg(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float rad2deg(float number)
* Function is implemented in ext/standard/math.c
*/
precision=14
--FILE--
<?php
-/* Prototype : float round ( float $val [, int $precision ] )
- * Description: Returns the rounded value of val to specified precision (number of digits
- * after the decimal point)
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing round() : basic functionality ***\n";
$values = array(123456789,
precision=14
--FILE--
<?php
-/* Prototype : float round ( float $val [, int $precision ] )
- * Description: Returns the rounded value of val to specified precision (number of digits
- * after the decimal point)
- * Source code: ext/standard/math.c
- */
-
echo "*** Testing round() : usage variations ***\n";
//get an unset variable
--FILE--
<?php
/*
- * proto float sin(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float sin(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float sinh(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float sinh(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float sqrt(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float sqrt(float number)
* Function is implemented in ext/standard/math.c
*/
Test srand() - basic function test for srand()
--FILE--
<?php
-/* Prototype : void srand ([ int $seed ] )
- * Description: Seed the random number generator.
- * Source code: ext/standard/rand.c
- */
-
echo "*** Testing srand() : basic functionality ***\n";
// Should return NULL if given anything that it can convert to long
--FILE--
<?php
/*
- * proto float tan(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float tan(float number)
* Function is implemented in ext/standard/math.c
*/
--FILE--
<?php
/*
- * proto float tanh(float number)
* Function is implemented in ext/standard/math.c
*/
$file_path = __DIR__;
--FILE--
<?php
/*
- * proto float tanh(float number)
* Function is implemented in ext/standard/math.c
*/
browscap={PWD}/browscap.ini
--FILE--
<?php
-/* Prototype : mixed get_browser([string browser_name [, bool return_array]])
- * Description: Get information about the capabilities of a browser.
- * If browser_name is omitted or null, HTTP_USER_AGENT is used.
- * Returns an object by default; if return_array is true, returns an array.
- *
- * Source code: ext/standard/browscap.c
- * Alias to functions:
- */
-
$browsers = include __DIR__ . DIRECTORY_SEPARATOR . 'browsernames.inc';
echo "*** Testing get_browser() : basic functionality ***\n";
browscap={PWD}/browscap.ini
--FILE--
<?php
-/* Prototype : mixed get_browser([string browser_name [, bool return_array]])
- * Description: Get information about the capabilities of a browser.
- * If browser_name is omitted or null, HTTP_USER_AGENT is used.
- * Returns an object by default; if return_array is true, returns an array.
- *
- * Source code: ext/standard/browscap.c
- * Alias to functions:
- */
-
$browsers = include __DIR__ . DIRECTORY_SEPARATOR . 'browsernames.inc';
echo "*** Testing get_browser() : error functionality ***\n";
browscap={PWD}/browscap.ini
--FILE--
<?php
-/* Prototype : mixed get_browser([string browser_name [, bool return_array]])
- * Description: Get information about the capabilities of a browser.
- * If browser_name is omitted or null, HTTP_USER_AGENT is used.
- * Returns an object by default; if return_array is true, returns an array.
- *
- * Source code: ext/standard/browscap.c
- * Alias to functions:
- */
-
$browsers = include __DIR__ . DIRECTORY_SEPARATOR . 'browsernames.inc';
echo "*** Testing get_browser() : variation functionality: extra browser names ***\n";
Test closelog() function : basic functionality
--FILE--
<?php
-/* Prototype : bool closelog(void)
- * Description: Close connection to system logger
- * Source code: ext/standard/syslog.c
- * Alias to functions:
- */
-
echo "*** Testing closelog() : basic functionality ***\n";
// Zero arguments
Test fsockopen() function : basic functionality
--FILE--
<?php
-/* Prototype : proto resource fsockopen(string hostname, int port [, int errno [, string errstr [, float timeout]]])
- * Description: Open Internet or Unix domain socket connection
- * Source code: ext/standard/fsock.c
- * Alias to functions:
- */
-
echo "*** Testing fsockopen() : basic functionality ***\n";
echo "Open a server socket\n";
Test fsockopen() function : error conditions
--FILE--
<?php
-/* Prototype : proto resource fsockopen(string hostname, int port [, int errno [, string errstr [, float timeout]]])
- * Description: Open Internet or Unix domain socket connection
- * Source code: ext/standard/fsock.c
- * Alias to functions:
- */
-
-
echo "*** Testing fsockopen() : basic error conditions ***\n";
echo "\n-- Attempting to connect to a non-existent socket --\n";
Test gethostbyaddr() function : basic functionality
--FILE--
<?php
-/* Prototype : string gethostbyaddr ( string $ip_address )
- * Description: Get the Internet host name corresponding to a given IP address
- * Source code: ext/standard/dns.c
-*/
-
echo "*** Testing gethostbyaddr() : basic functionality ***\n";
echo gethostbyaddr("127.0.0.1")."\n";
Test gethostbyaddr() function : error conditions
--FILE--
<?php
-/* Prototype : proto string gethostbyaddr(string ip_address)
- * Description: Get the Internet host name corresponding to a given IP address
- * Source code: ext/standard/dns.c
- * Alias to functions:
- */
-
-
echo "Testing gethostbyaddr : error conditions\n";
echo "\n-- Testing gethostbyaddr function with invalid addresses --\n";
Test gethostbyname() function : basic functionality
--FILE--
<?php
-/* Prototype : string gethostbyname ( string $hostname )
- * Description: Get the IPv4 address corresponding to a given Internet host name
- * Source code: ext/standard/dns.c
-*/
-
echo "*** Testing gethostbyname() : basic functionality ***\n";
echo gethostbyname("localhost")."\n";
Test gethostbynamel() function : basic functionality
--FILE--
<?php
-/* Prototype : array gethostbynamel ( string $hostname )
- * Description: Get a list of IPv4 addresses corresponding to a given Internet host name
- * Source code: ext/standard/dns.c
-*/
-
echo "*** Testing gethostbynamel() : basic functionality ***\n";
var_dump(gethostbynamel("localhost"));
?>
<?php if (strtolower(substr(PHP_OS, 0, 3)) == 'aix') {die('skip not for AIX');} ?>
--FILE--
<?php
-/* Prototype : int ip2long(string ip_address)
- * Description: Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address
- * Source code: ext/standard/basic_functions.c
- * Alias to functions:
- */
-
$ips = array(
"1.1.011.011",
"127.0.0.1",
?>
--FILE--
<?php
-/* Prototype : int ip2long(string ip_address)
- * Description: Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address
- * Source code: ext/standard/basic_functions.c
- * Alias to functions:
- */
-
$ips = array(
"1.1.011.011",
"127.0.0.1",
Test syslog() function : basic functionality
--FILE--
<?php
-/* Prototype : bool syslog(int priority, string message)
- * Description: Generate a system log message
- * Source code: ext/standard/syslog.c
- * Alias to functions:
- */
-
echo "*** Testing syslog() : basic functionality ***\n";
serialize_precision=100
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "\n--- Testing Circular reference of an array ---\n";
echo "-- Normal array --\n";
serialization: arrays with references amongst elements
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
function check(&$a) {
var_dump($a);
$ser = serialize($a);
serialization: arrays with references to an external variable
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
function check(&$a) {
var_dump($a);
$ser = serialize($a);
serialization: arrays with references to the containing array
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
function check(&$a) {
var_dump($a);
$ser = serialize($a);
serialization: arrays with references, nested
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
function check(&$a) {
var_dump($a);
$ser = serialize($a);
Test unserialize(): error is indistinguishable from deserialized boolean
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "*** Testing unserialize() error/boolean distinction ***\n";
$garbage = "obvious non-serialized data";
*** Testing unserialize() error/boolean distinction ***
string(4) "b:0;"
-Notice: unserialize(): Error at offset 0 of 27 bytes in %s%eserialization_error_002.php on line 20
+Notice: unserialize(): Error at offset 0 of 27 bytes in %s on line %d
bool(false)
bool(false)
unserialize error and deserialized false are identical? 1
serialize_precision=100
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "\n--- Testing Abstract Class ---\n";
// abstract class
abstract class Name
Test serialize() & unserialize() functions: objects - ensure that COW references of objects are not serialized separately (unlike other types).
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
$x = new stdClass;
$ref = &$x;
var_dump(serialize(array($x, $x)));
Check behaviour of incomplete class
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
$serialized = 'O:1:"C":1:{s:1:"p";i:1;}';
$incomplete = unserialize($serialized);
Behaviour of incomplete class is preserved even when it was not created by unserialize().
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
$a = new __PHP_Incomplete_Class;
var_dump($a);
var_dump($a->p);
Ensure __autoload is called twice if unserialize_callback_func is defined.
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
spl_autoload_register(function ($name) {
echo "in autoload($name)\n";
});
in check(FOO)
in autoload(FOO)
-Warning: unserialize(): Function check() hasn't defined the class it was called for in %s on line 23
+Warning: unserialize(): Function check() hasn't defined the class it was called for in %s on line %d
object(__PHP_Incomplete_Class)#%d (1) {
["__PHP_Incomplete_Class_Name"]=>
string(3) "FOO"
Bad unserialize_callback_func
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
ini_set('unserialize_callback_func','Nonexistent');
$o = unserialize('O:3:"FOO":0:{}');
var_dump($o);
echo "Done";
?>
--EXPECTF--
-Warning: unserialize(): defined (Nonexistent) but not found in %s on line 14
+Warning: unserialize(): defined (Nonexistent) but not found in %s on line %d
object(__PHP_Incomplete_Class)#%d (1) {
["__PHP_Incomplete_Class_Name"]=>
string(3) "FOO"
Custom unserialization of classes with no custom unserializer.
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
$ser = 'C:1:"C":6:{dasdas}';
$a = unserialize($ser);
eval('class C {}');
Serialize() must return a string or NULL
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
Class C implements Serializable {
public function serialize() {
return $this;
Object serialization / unserialization with inherited and hidden properties.
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
Class A {
private $APriv = "A.APriv";
protected $AProt = "A.AProt";
Object serialization / unserialization: real references and COW references
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "\n\nArray containing same object twice:\n";
$obj = new stdclass;
$a[0] = $obj;
Object serialization / unserialization: references amongst properties
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
function check(&$obj) {
var_dump($obj);
$ser = serialize($obj);
Object serialization / unserialization: references to external values
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
function check(&$obj) {
var_dump($obj);
$ser = serialize($obj);
serialize_precision=10
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
var_dump(serialize(0.1));
?>
--EXPECT--
serialize_precision=75
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
var_dump(serialize(0.1));
?>
--EXPECT--
Test serialize() & unserialize() functions: resources
--FILE--
<?php
-/* Prototype : proto string serialize(mixed variable)
- * Description: Returns a string representation of variable (which can later be unserialized)
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-/* Prototype : proto mixed unserialize(string variable_representation)
- * Description: Takes a string representation of variable and recreates it
- * Source code: ext/standard/var.c
- * Alias to functions:
- */
-
echo "\n--- Testing Resource ---\n";
$file_handle = fopen( __FILE__, "r" );
$serialized_data = serialize( $file_handle );
Test stream_get_meta_data() function : error conditions
--FILE--
<?php
-/* Prototype : proto array stream_get_meta_data(resource fp)
- * Description: Retrieves header/meta data from streams/file pointers
- * Source code: ext/standard/streamsfuncs.c
- * Alias to functions: socket_get_status
- */
-
echo "*** Testing stream_get_meta_data() : error conditions ***\n";
echo "\n-- Testing stream_get_meta_data() function with closed stream resource --\n";
Test stream_set_timeout() function : error conditions
--FILE--
<?php
-/* Prototype : proto bool stream_set_timeout(resource stream, int seconds, int microseconds)
- * Description: Set timeout on stream read to seconds + microseonds
- * Source code: ext/standard/streamsfuncs.c
- * Alias to functions: socket_set_timeout
- */
-
echo "*** Testing stream_set_timeout() : error conditions ***\n";
for ($i=0; $i<100; $i++) {
Test addslashes() function : basic functionality
--FILE--
<?php
-/* Prototype : string addslashes ( string $str )
- * Description: Returns a string with backslashes before characters (single quotes, double quote,
- * backslash and nul character) that need to be quoted in database queries etc.
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing addslashes() with strings containing characters that can be prefixed with backslash
* by the function
Test addslashes() function : usage variations - strings with characters to be backslashed
--FILE--
<?php
-/* Prototype : string addslashes ( string $str )
- * Description: Returns a string with backslashes before characters that need to be quoted in database queries etc.
- * Source code: ext/standard/string.c
-*/
-
/*
* Test addslashes() with various strings containing characters that can be backslashed
*/
?>
--FILE--
<?php
-/* Prototype: string basename ( string $path [, string $suffix] );
- Description: Given a string containing a path to a file,
- this function will return the base name of the file.
- If the filename ends in suffix this will also be cut off.
-*/
-
setlocale(LC_CTYPE, "C");
var_dump(bin2hex(basename("\xff")));
var_dump(bin2hex(basename("a\xffb")));
?>
--FILE--
<?php
-/* Prototype: string basename ( string $path [, string $suffix] );
- Description: Given a string containing a path to a file,
- this function will return the base name of the file.
- If the filename ends in suffix this will also be cut off.
-*/
-
var_dump(basename("\377"));
echo "Done\n";
Test basename() function : usage variations
--FILE--
<?php
-/* Prototype: string basename ( string $path [, string $suffix] );
- Description: Given a string containing a path to a file,
- this function will return the base name of the file.
- If the filename ends in suffix this will also be cut off.
-*/
$file_path_variations = array (
/* paths with shortcut home dir char, with suffix variation */
array("~/home/user/bar"),
--FILE--
<?php
-/* Prototype : string bin2hex ( string $str )
- * Description: Convert binary data into hexadecimal representation
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing bin2hex() : basic functionality ***\n";
// array with different values for $string
Bug #47481 (natcasesort() does not sort extended ASCII characters correctly)
--FILE--
<?php
-/* Prototype : bool natcasesort(array &$array_arg)
- * Description: Sort an array using case-insensitive natural sort
- * Source code: ext/standard/array.c
- */
-
/*
* Test natcasesort() with extended ASCII characters
*/
Test chop() function : usage variations - miscellaneous arguments
--FILE--
<?php
-/* Prototype : string chop ( string $str [, string $charlist] )
- * Description: Strip whitespace (or other characters) from the end of a string
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing chop() : with miscellaneous arguments
*/
--FILE--
<?php
-/* Prototype : string chr ( int $ascii )
- * Description: Return a specific character
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing chr() : basic functionality ***\n";
echo chr(72). chr(101) . chr(108) . chr(108). chr(111); // Hello
--FILE--
<?php
-/* Prototype : string chr ( int $ascii )
- * Description: Return a specific character
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing chr() : error conditions ***\n";
echo "\n-- Testing chr() function with no arguments --\n";
--FILE--
<?php
-/* Prototype : string chr ( int $ascii )
- * Description: Return a specific character
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing chr() function: with unexpected inputs for 'ascii' argument ***\n";
//get an unset variable
Test chunk_split() function : basic functionality
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions:
-*/
-
/*
* Testing chunk_split() for basic functionality by passing all possible
* arguments as well as with default arguments chunklen and ending
Test chunk_split() function : usage variations - different single quoted strings for 'ending' argument
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* passing different single quoted strings for 'ending' arguments to chunk_split()
* 'chunklen' is set to 9.2 for this testcase
Test chunk_split() function : usage variations - different strings for 'ending' with heredoc 'str'
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* passing different strings for 'ending' and heredoc string as 'str' to chunk_split()
* 'chunklen' is set to 6E0 for this testcase
Test chunk_split() function : usage variations - different heredoc strings for 'ending' argument
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* passing different heredoc strings as 'ending' argument to chunk_split()
* 'chunklen' argument is set to 10
Test chunk_split() function : usage variations - default 'chunklen' with long string as 'str'argument
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions:
-*/
-
/*
* passing long string as 'str' and testing default value of chunklen which is 76
*/
?>
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
echo "*** Testing chunk_split() : unexpected large 'end' string argument variation 1 ***\n";
$a=str_repeat("B", 65535);
?>
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
echo "*** Testing chunk_split() : unexpected large 'end' string argument variation 2 ***\n";
$a=str_repeat("B", 65537);
?>
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
$chunk_length = 1;
echo "*** Testing chunk_split() : unexpected large 'end' string argument variation 2 ***\n";
Test chunk_split() function : usage variations - different heredoc strings as 'str' argument
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Passing different heredoc strings as 'str' argument to the chunk_split()
* with 'chunklen' 4 and default value of 'ending' that is "\r\n"
Test chunk_split() function : usage variations - single quoted strings for 'str' argument
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* passing different single quoted strings as 'str' argument to the function
* 'chunklen' is set to 7 and 'ending' is '):('
?>
--FILE--
<?php
-/* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
- * Description: Returns split line
- * Source code: ext/standard/string.c
- * Alias to functions:
-*/
-
/*
* passing different integer values for 'chunklen' and heredoc string for 'str' to chunk_split()
*/
--FILE--
<?php
-/* Prototype : string convert_uudecode ( string $data )
- * Description: Decode a uuencoded string
- * Source code: ext/standard/uuencode.c
-*/
-
echo "*** Testing convert_uudecode() : basic functionality ***\n";
// array with different values for $string
--FILE--
<?php
-/* Prototype : string convert_uuencode ( string $data )
- * Description: Uuencode a string
- * Source code: ext/standard/uuencode.c
-*/
-
echo "*** Testing convert_uuencode() : basic functionality ***\n";
// array with different values for $string
--FILE--
<?php
-/* Prototype : mixed count_chars ( string $string [, int $mode ] )
- * Description: Return information about characters used in a string
- * Source code: ext/standard/string.c
-*/
-
-
echo "*** Testing count_chars() : basic functionality ***\n";
$string = "Return information about characters used in a string";
Test crc32() function : basic functionality
--FILE--
<?php
-/* Prototype : string crc32(string $str)
- * Description: Calculate the crc32 polynomial of a string
- * Source code: ext/standard/crc32.c
- * Alias to functions: none
-*/
-
/*
* Testing crc32() : basic functionality
*/
?>
--FILE--
<?php
-/* Prototype : string crc32(string $str)
- * Description: Calculate the crc32 polynomial of a string
- * Source code: ext/standard/crc32.c
- * Alias to functions: none
-*/
-
/*
* Testing crc32() : with different strings in single quotes passed to the function
*/
?>
--FILE--
<?php
-/* Prototype : string crc32(string $str)
- * Description: Calculate the crc32 polynomial of a string
- * Source code: ext/standard/crc32.c
- * Alias to functions: none
-*/
-
/*
* Testing crc32() : with different strings in double quotes passed to the function
*/
?>
--FILE--
<?php
-/* Prototype : string crc32(string $str)
- * Description: Calculate the crc32 polynomial of a string
- * Source code: ext/standard/crc32.c
- * Alias to functions: none
-*/
-
/*
* Testing crc32() : with different heredoc strings passed to the str argument
*/
Test dirname() function : basic functionality
--FILE--
<?php
-/* Prototype: string dirname ( string $path );
- Description: Returns directory name component of path.
-*/
$file_paths = array (
/* simple paths */
"bar",
Test dirname() function : error conditions
--FILE--
<?php
-/* Prototype: string dirname ( string $path );
- Description: Returns directory name component of path.
-*/
echo "*** Testing error conditions ***\n";
// Bad arg
?>
--FILE--
<?php
-/* Prototype: string dirname ( string $path [, int nb]);
- Description: Returns directory name component of path.
-*/
for ($i=0 ; $i<5 ; $i++) {
try {
var_dump(dirname("/foo/bar/baz", $i));
?>
--FILE--
<?php
-/* Prototype: string dirname ( string $path [, int nb]);
- Description: Returns directory name component of path.
-*/
-
for ($i=0 ; $i<5 ; $i++) {
try {
var_dump(dirname("/foo/bar/baz", $i));
Test dirname() function : usage variations
--FILE--
<?php
-/* Prototype: string dirname ( string $path );
- Description: Returns directory name component of path.
-*/
class temp
{
function __toString() {
precision=14
--FILE--
<?php
-/* Prototype: array explode ( string $delimiter, string $string [, int $limit] );
- Description: Returns an array of strings, each of which is a substring of string
- formed by splitting it on boundaries formed by the string delimiter.
- If limit is set, the returned array will contain a maximum of limit
- elements with the last element containing the rest of string.
-*/
-
echo "*** Testing explode() for basic operations ***\n";
$delimiters = array (
"", // len=0
--FILE--
<?php
-/* Prototype : array explode ( string $delimiter , string $string [, int $limit ] )
- * Description: Split a string by string.
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing explode() function: match longer string ***\n";
$pizza = "piece1 piece2 piece3 piece4 piece5 piece6 p";
--FILE--
<?php
-/* Prototype : array explode ( string $delimiter , string $string [, int $limit ] )
- * Description: Split a string by string.
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing explode() function: positive and negative limits ***\n";
$str = 'one||two||three||four';
--FILE--
<?php
-/* Prototype : array explode ( string $delimiter , string $string [, int $limit ] )
- * Description: Split a string by string.
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing explode() function: misc tests ***\n";
$str = "one\x00two\x00three\x00four";
--FILE--
<?php
-/* Prototype : array explode ( string $delimiter , string $string [, int $limit ] )
- * Description: Split a string by string.
- * Source code: ext/standard/string.c
-*/
-
var_dump(count(explode('|', implode('|', range(1,65)), -1)));
?>
Test get_html_translation_table() function : basic functionality - with default args
--FILE--
<?php
-/* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] )
- * Description: Returns the internal translation table used by htmlspecialchars and htmlentities
- * Source code: ext/standard/html.c
-*/
-
/* Test get_html_translation_table() when table is specified as HTML_ENTITIES */
Test get_html_translation_table() function : basic functionality - table as HTML_ENTITIES & diff quote_style
--FILE--
<?php
-/* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] )
- * Description: Returns the internal translation table used by htmlspecialchars and htmlentities
- * Source code: ext/standard/html.c
-*/
-
/* Test get_html_translation_table() when table is specified as HTML_ENTITIES */
//set locale to en_US.UTF-8
Test get_html_translation_table() function : basic functionality - table as HTML_SPECIALCHARS
--FILE--
<?php
-/* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] )
- * Description: Returns the internal translation table used by htmlspecialchars and htmlentities
- * Source code: ext/standard/html.c
-*/
-
/* test get_html_translation_table() when $table argument is specified as HTML_SPECIALCHARS */
echo "*** Testing get_html_translation_table() : basic functionality ***\n";
Test get_html_translation_table() function : basic functionality - charset WINDOWS-1252
--FILE--
<?php
-/* Prototype : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] )
- * Description: Returns the internal translation table used by htmlspecialchars and htmlentities
- * Source code: ext/standard/html.c
-*/
-
-
echo "*** Testing get_html_translation_table() : basic functionality/Windows-1252 ***\n";
echo "-- with table = HTML_ENTITIES --\n";
--FILE--
<?php
-/* Prototype : string hebrev ( string $hebrew_text [, int $max_chars_per_line ] )
- * Description: Convert logical Hebrew text to visual text
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing hebrev() : basic functionality ***\n";
$hebrew_text = "The hebrev function converts logical Hebrew text to visual text.\nThe function tries to avoid breaking words.\n";
Test htmlspecialchars() function
--FILE--
<?php
-/* Prototype: string htmlspecialchars ( string $string [, int $quote_style [, string $charset]] );
- Description: Convert special characters to HTML entities
-*/
-
/* retrieving htmlspecialchars from the ANSI character table */
echo "*** Retrieving htmlspecialchars for 256 characters ***\n";
for($i=0; $i<256; $i++)
Test htmlspecialchars() function : basic functionality
--FILE--
<?php
-/* Prototype : string htmlspecialchars ( string $string [, int $quote_style [, string $charset [, bool $double_encode ]]] )
- * Description: Convert special characters to HTML entities
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing htmlspecialchars() : basic functionality ***\n";
$s1 = "abc<>\"&\n";
Test htmlspecialchars_decode() function : basic functionality
--FILE--
<?php
-/* Prototype : string htmlspecialchars_decode(string $string [, int $quote_style])
- * Description: Convert special HTML entities back to characters
- * Source code: ext/standard/html.c
-*/
-
echo "*** Testing htmlspecialchars_decode() : basic functionality ***\n";
Test htmlspecialchars_decode() function : usage variations - heredoc strings for 'string' argument
--FILE--
<?php
-/* Prototype : string htmlspecialchars_decode(string $string [, int $quote_style])
- * Description: Convert special HTML entities back to characters
- * Source code: ext/standard/html.c
-*/
-
/*
* testing htmlspecialchars_decode() with various heredoc strings as argument for $string
*/
Test htmlspecialchars_decode() function : usage variations - single quoted strings for 'string' argument
--FILE--
<?php
-/* Prototype : string htmlspecialchars_decode(string $string [, int $quote_style])
- * Description: Convert special HTML entities back to characters
- * Source code: ext/standard/html.c
-*/
-
/*
* Testing htmlspecialchars_decode() with various single quoted strings as argument for $string
*/
Test htmlspecialchars_decode() function : usage variations - double quoted strings for 'string' argument
--FILE--
<?php
-/* Prototype : string htmlspecialchars_decode(string $string [, int $quote_style])
- * Description: Convert special HTML entities back to characters
- * Source code: ext/standard/html.c
-*/
-
/*
* testing htmlspecialchars_decode() for various double quoted strings as argument for $string
*/
Adam Gegotek <adam [dot] gegotek [at] gmail [dot] com>
--FILE--
<?php
-/* Prototype : string http_build_query ( mixed $query_data [, string $numeric_prefix [, string $arg_separator [, int $enc_type = PHP_QUERY_RFC1738 ]]] )
- * Description: Generates a URL-encoded query string from the associative (or indexed) array provided.
- * Source code: ext/standard/http.c
-*/
-
class UrlBuilder
{
public $name = 'homepage';
Adam Gegotek <adam [dot] gegotek [at] gmail [dot] com>
--FILE--
<?php
-/* Prototype : string http_build_query ( mixed $query_data [, string $numeric_prefix [, string $arg_separator [, int $enc_type = PHP_QUERY_RFC1738 ]]] )
- * Description: Generates a URL-encoded query string from the associative (or indexed) array provided.
- * Source code: ext/standard/http.c
-*/
-
$mDimensional = array(
20,
5 => 13,
Adam Gegotek <adam [dot] gegotek [at] gmail [dot] com>
--FILE--
<?php
-/* Prototype : string http_build_query ( mixed $query_data [, string $numeric_prefix [, string $arg_separator [, int $enc_type = PHP_QUERY_RFC1738 ]]] )
- * Description: Generates a URL-encoded query string from the associative (or indexed) array provided.
- * Source code: ext/standard/http.c
-*/
-
$oDimensional = array(
"name" => "main page",
"sort" => "desc,admin",
Test join() function : basic functionality
--FILE--
<?php
-/* Prototype : string join( string $glue, array $pieces )
- * Description: Join array elements with a string
- * Source code: ext/standard/string.c
- * Alias of function: implode()
-*/
-
echo "*** Testing join() : basic functionality ***\n";
// Initialize all required variables
Test join() function: error conditions
--FILE--
<?php
-/* Prototype : string join( string $glue, array $pieces )
- * Description: Join array elements with a string
- * Source code: ext/standard/string.c
- * Alias of function: implode()
-*/
-
echo "*** Testing join() : error conditions ***\n";
// Less than expected number of arguments
Test join() function : usage variations - unexpected values for 'glue' argument
--FILE--
<?php
-/* Prototype : string join( string $glue, array $pieces )
- * Description: Join array elements with a string
- * Source code: ext/standard/string.c
- * Alias of function: implode()
-*/
-
/*
* testing join() by passing different unexpected value for glue argument
*/
Test join() function : usage variations - unexpected values for 'pieces' argument(Bug#42789)
--FILE--
<?php
-/* Prototype : string join( string $glue, array $pieces )
- * Description: Join array elements with a string
- * Source code: ext/standard/string.c
- * Alias of function: implode()
-*/
-
/*
* test join() by passing different unexpected value for pieces argument
*/
Test join() function : usage variations - different values for 'pieces' argument
--FILE--
<?php
-/* Prototype : string join( string $glue, array $pieces )
- * Description: Join array elements with a string
- * Source code: ext/standard/string.c
- * Alias of function: implode()
-*/
-
/*
* test join() by giving different pieces values
*/
Test join() function : usage variations - sub array as argument
--FILE--
<?php
-/* Prototype : string join( string $glue, array $pieces )
- * Description: Join array elements with a string
- * Source code: ext/standard/string.c
- * Alias of function: implode()
-*/
-
/*
* test join() by passing pieces as array containing sub array(s)
*/
--FILE--
<?php
-/* Prototype : string ltrim ( string $str [, string $charlist ] )
- * Description: Strip whitespace (or other characters) from the beginning of a string.
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing ltrim() : basic functionality ***\n";
$text = " \t\r\n\0\x0B ---These are a few words--- ";
--FILE--
<?php
-/* Prototype : string ltrim ( string $str [, string $charlist ] )
- * Description: Strip whitespace (or other characters) from the beginning of a string.
- * Source code: ext/standard/string.c
-*/
-
-
echo "*** Testing ltrim() : error conditions ***\n";
$hello = " Hello World\n";
Test md5() function : basic functionality
--FILE--
<?php
-/* Prototype : string md5 ( string $str [, bool $raw_output= false ] )
- * Description: Calculate the md5 hash of a string
- * Source code: ext/standard/md5.c
-*/
-
echo "*** Testing md5() : basic functionality ***\n";
var_dump(md5("apple"));
?>
Test md5() function : basic functionality - with raw output
--FILE--
<?php
-/* Prototype : string md5 ( string $str [, bool $raw_output= false ] )
- * Description: Calculate the md5 hash of a string
- * Source code: ext/standard/md5.c
-*/
-
echo "*** Testing md5() : basic functionality - with raw output***\n";
$str = "Hello World";
$md5_raw = md5($str, true);
Test nl2br() function : usage variations - double quoted strings for 'str' argument
--FILE--
<?php
-/* Prototype : string nl2br(string $str);
- * Description: Inserts HTML line breaks before all newlines in a string
- * Source code: ext/standard/string.c
-*/
-
/* Test nl2br() function by passing double quoted strings containing various
* combinations of new line chars to 'str' argument
*/
Test nl2br() function : usage variations - single quoted strings for 'str' argument
--FILE--
<?php
-/* Prototype : string nl2br(string $str);
- * Description: Inserts HTML line breaks before all newlines in a string
- * Source code: ext/standard/string.c
-*/
-
/* Test nl2br() function by passing single quoted strings containing various
* combinations of new line chars to 'str' argument
*/
Test nl2br() function : usage variations - heredoc strings for 'str' argument
--FILE--
<?php
-/* Prototype : string nl2br(string $str);
- * Description: Inserts HTML line breaks before all newlines in a string.
- * Source code: ext/standard/string.c
-*/
-
/* Test nl2br() function by passing heredoc strings containing various
* combinations of new line chars to 'str' argument
*/
Test nl2br() function : usage variations - html values for 'str' argument
--FILE--
<?php
-/* Prototype : string nl2br(string $str)
- * Description: Inserts HTML line breaks before all newlines in a string.
- * Source code: ext/standard/string.c
-*/
-
/*
* Test nl2br() function by passing html string inputs containing line breaks and
* new line chars for 'str'
--FILE--
<?php
-/* Prototype : string nl_langinfo ( int $item )
- * Description: Query language and locale information
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing nl_langinfo() : basic functionality ***\n";
$original = setlocale(LC_ALL, 'C');
Test number_format() - basic function test number_format()
--FILE--
<?php
-/* Prototype : string number_format ( float $number [, int $decimals ] )
- * string number_format ( float $number , int $decimals , string $dec_point , string $thousands_sep )
- * Description: Format a number with grouped thousands
- * Source code: ext/standard/string.c
- */
-
echo "*** Testing number_format() : basic functionality ***\n";
$values = array(1234.5678,
--FILE--
<?php
-/* Prototype : int ord ( string $string )
- * Description: Return ASCII value of character
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing ord() : basic functionality ***\n";
var_dump(ord("a"));
--FILE--
<?php
-/* Prototype : void parse_str ( string $str , array &$arr )
- * Description: Parses the string into variables
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing parse_str() : basic functionality ***\n";
echo "\nBasic test WITH undefined var for result arg\n";
arg_separator.input = "/"
--FILE--
<?php
-/* Prototype : void parse_str ( string $str [, array &$arr ] )
- * Description: Parses the string into variables
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing parse_str() : non-default arg_separator.input specified ***\n";
$s1 = "first=val1/second=val2/third=val3";
Test parse_str() function : test with badly formed strings
--FILE--
<?php
-/* Prototype : void parse_str ( string $str [, array &$arr ] )
- * Description: Parses the string into variables
- * Source code: ext/standard/string.c
-*/
-
echo "\nTest string with badly formed strings\n";
$str = "arr[1=sid&arr[4][2=fred";
var_dump(parse_str($str, $res));
--FILE--
<?php
-/* Prototype : int print ( string $arg )
- * Description: Output a string
- * Source code: n/a, print is a language construct not an extension function
- * Test based on php.net manual example.
-*/
-
echo "*** Testing print() : basic functionality ***\n";
echo "\n-- Iteration 1 --\n";
--FILE--
<?php
-/* Prototype : int print ( string $arg )
- * Description: Output a string
- * Source code: n/a, print is a language construct not an extension function
- * Test based on php.net manual example.
-*/
-
echo "*** Testing print() function: with unexpected inputs for 'arg' argument ***\n";
//get an unset variable
Test printf() function : basic functionality - string format
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : basic functionality - using string format ***\n";
// Initialise all required variables
Test printf() function : basic functionality - integer format
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : basic functionality - using integer format ***\n";
Test printf() function : basic functionality - float format
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : basic functionality - using float format ***\n";
Test printf() function : basic functionality - bool format
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : basic functionality - using bool format ***\n";
Test printf() function : basic functionality - char format
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : basic functionality - using char format ***\n";
Test printf() function : basic functionality - exponential format
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : basic functionality - using exponential format ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : basic functionality - using unsigned format ***\n";
?>
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : basic functionality - using octal format ***\n";
// Initialise all required variables
Test printf() function : basic functionality - hexadecimal format
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : basic functionality - using hexadecimal format ***\n";
// Initialise all required variables
Test printf() function : error conditions
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : error conditions ***\n";
// Zero arguments
Test printf() function : usage variations - unexpected values for format argument
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
/*
* Testing printf() : with different unexpected values for format argument other than the strings
*/
Test printf() function : usage variations - with all types of values for arg1 argument
--FILE--
<?php
-/* Prototype : int printf ( string $format [, mixed $args [, mixed $... ]] )
- * Description: Produces output according to format .
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing printf() : with different types of values passed for arg1 argument ***\n";
// initialing required variables
Test quoted_printable_decode() function : basic functionality
--FILE--
<?php
-/* Prototype : string quoted_printable_decode ( string $str )
- * Description: Convert a quoted-printable string to an 8 bit string
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing quoted_printable_decode() : basic functionality ***\n";
$str = "=FAwow-factor=C1=d0=D5=DD=C5=CE=CE=D9=C5=0A=
--FILE--
<?php
-/* Prototype : string quotemeta ( string $str )
- * Description: Quote meta characters
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing quotemeta() : basic functionality ***\n";
var_dump(quotemeta("Hello how are you ?"));
--FILE--
<?php
-/* Prototype : string rtrim ( string $str [, string $charlist ] )
- * Description: Strip whitespace (or other characters) from the end of a string.
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing rtrim() : basic functionality ***\n";
$text = "---These are a few words--- \t\r\n\0\x0B ";
--FILE--
<?php
-/* Prototype : string rtrim ( string $str [, string $charlist ] )
- * Description: Strip whitespace (or other characters) from the end of a string.
- * Source code: ext/standard/string.c
-*/
-
-
echo "*** Testing rtrim() : error conditions ***\n";
$hello = " Hello World\n";
?>
--FILE--
<?php
-/* Prototype : string setlocale (int $category , string $locale [,string $..] )
- : string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale ,
- * or FALSE if locale functionality is not implemented in this platform.
- * Source code: ext/standard/string.c
-*/
-
/* test setlocale by specifying a specific locale as input */
-/* Prototype : array list_system_locales( void )
- Description: To get the currently installed locle in this platform
- Arguments : Nil
- Returns : set of locale as array
-*/
function list_system_locales() {
// start the buffering of next command to internal output buffer
ob_start();
?>
--FILE--
<?php
-/* Prototype : string setlocale (int $category , string $locale [,string $..] )
- : string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale , or FALSE
- if locale functionality is not implemented in this platform.
- * Source code: ext/standard/string.c
-*/
-
/* Test the setlocale() when an array is provided as input containing list of locales */
-/* Prototype : array list_system_locales( void )
- * Description: To get the currently installed locle in this platform
- * Arguments : Nil
- * Returns : set of locale as array
-*/
function list_system_locales() {
// start the buffering of next command to internal output buffer
ob_start();
?>
--FILE--
<?php
-/* Prototype : string setlocale (int $category , string $locale [,string $..] )
- : string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale , or FALSE
- if locale functionality is not implemented in this platform.
- * Source code: ext/standard/string.c
-*/
-
/* Test the setlocale() when multiple locales are provided as argument */
-/* Prototype : array list_system_locales( void )
- Description: To get the currently installed locle in this platform
- Arguments : Nil
- Returns : set of locale as array
-*/
function list_system_locales() {
// start the buffering of next command to internal output buffer
ob_start();
?>
--FILE--
<?php
-/* Prototype : string setlocale (int $category , string $locale [,string $..] )
- : string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale , or FALSE if locale functionality is not implemented in this platform.
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing setlocale() : error conditions ***\n";
echo "\n-- Testing setlocale() function with invalid locale array, 'category' = LC_ALL --\n";
?>
--FILE--
<?php
-/* Prototype : string setlocale (int $category , string $locale [,string $..] )
- : string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale , or FALSE
- if locale functionality is not implemented in this platform.
- * Source code: ext/standard/string.c
-*/
-
/* Test the setlocale() when multiple valid/invalid locales are provided as argument */
-/* Prototype : array list_system_locales( void )
- Description: To get the currently installed locle in this platform
- Arguments : Nil
- Returns : set of locale as array
-*/
function list_system_locales() {
// start the buffering of next command to internal output buffer
ob_start();
?>
--FILE--
<?php
-/* Prototype : string setlocale (int $category , string $locale [,string $..] )
- : string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale , or FALSE
- if locale functionality is not implemented in this platform.
- * Source code: ext/standard/string.c
-*/
-
/* setlocale() to set all available locales in the system and check the success count */
echo "*** Testing setlocale() : usage variations ***\n";
return $locale !== 'tt_RU@iqtelif.UTF-8' && $locale !== 'no_NO.ISO-8859-1';
}
-/* Prototype : array list_system_locales( void )
- * Description: To get the currently installed locle in this platform
- * Arguments : Nil
- * Returns : set of locale as array
-*/
function list_system_locales() {
// start the buffering of next command to internal output buffer
ob_start();
?>
--FILE--
<?php
-/* Prototype : string setlocale (int $category , string $locale [,string $..] )
- * : string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale , or FALSE
- * if locale functionality is not implemented in this platform.
- * Source code: ext/standard/string.c
-*/
-
/* If locale is "0", the locale setting is not affected, only the current setting is returned */
echo "*** Testing setlocale() : usage variations - setting system locale = 0 ***\n";
LC_ALL=en_US.utf8;
--FILE--
<?php
-/* Prototype : string setlocale (int $category , string $locale [,string $..] )
- * : string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale , or FALSE
- * if locale functionality is not implemented in this platform.
- * Source code: ext/standard/string.c
-*/
-
/*If locale is NULL, the locale names will be set from the values of environment variables with the same names as the above ENV settings */
echo "*** Testing setlocale() : usage variations - Setting system locale = null ***\n";
LC_ALL=en_US.utf8;
--FILE--
<?php
-/* Prototype : string setlocale (int $category , string $locale [,string $..] )
- * : string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale , or FALSE
- * if locale functionality is not implemented in this platform.
- * Source code: ext/standard/string.c
-*/
-
/* If locale is empty string "", the locale names will be set from the values of environment variables with the same names as from ENV */
echo "*** Testing setlocale() : usage variations - setting system locale = \"\" ***\n";
--FILE--
<?php
-/* Prototype: string sha1 ( string $str [, bool $raw_output ] )
- * Description: Calculate the sha1 hash of a string
- */
echo "*** Testing sha1() : basic functionality ***\n";
--FILE--
<?php
-/* Prototype: string sha1_file( string filename[, bool raw_output] )
- * Description: Calculate the sha1 hash of a file
- */
echo "*** Testing sha1_file() : basic functionality ***\n";
precision=14
--FILE--
<?php
-/* Prototype : proto int similar_text(string str1, string str2 [, float percent])
-* Description: Calculates the similarity between two strings
-* Source code: ext/standard/string.c
-*/
var_dump(similar_text("abcdefgh", "efg"));
var_dump(similar_text("abcdefgh", "mno"));
var_dump(similar_text("abcdefghcc", "c"));
Test soundex() function : basic functionality
--FILE--
<?php
-/* Prototype : string soundex ( string $str )
- * Description: Calculate the soundex key of a string
- * Source code: ext/standard/string.c
-*/
echo "*** Testing soundex() : basic functionality ***\n";
var_dump(soundex("Euler"));
Test sprintf() function : basic functionality - string format
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : basic functionality - using string format ***\n";
// Initialise all required variables
Test sprintf() function : basic functionality - integer format
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : basic functionality - using integer format ***\n";
Test sprintf() function : basic functionality - float format
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : basic functionality - using float format ***\n";
Test sprintf() function : basic functionality - bool format
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing sprintf() : basic functionality - using bool format ***\n";
Test sprintf() function : basic functionality - char format
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing sprintf() : basic functionality - using char format ***\n";
Test sprintf() function : basic functionality - exponential format
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing sprintf() : basic functionality - using exponential format ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing sprintf() : basic functionality - using unsigned format ***\n";
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing sprintf() : basic functionality - using unsigned format ***\n";
?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing sprintf() : basic functionality - using octal format ***\n";
// Initialise all required variables
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing sprintf() : basic functionality - using octal format ***\n";
// Initialise all required variables
Test sprintf() function : basic functionality - hexadecimal format
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing sprintf() : basic functionality - using hexadecimal format ***\n";
// Initialise all required variables
Test sprintf() function : error conditions
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
- */
-
echo "*** Testing sprintf() : error conditions ***\n";
// Zero arguments
Test sprintf() function : usage variations - unexpected values for format argument
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Testing sprintf() : with different unexpected values for format argument other than the strings
*/
Test sprintf() function : usage variations - float formats with integer values
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : float formats with integer values ***\n";
// array of int type values
Test sprintf() function : usage variations - with all types of values for arg1 argument
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : with different types of values passed for arg1 argument ***\n";
// initialing required variables
?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : octal formats with integer values ***\n";
// array of integer values
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : octal formats with integer values ***\n";
// array of integer values
Test sprintf() function : usage variations - int formats with int values
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : integer formats with integer values ***\n";
// different valid integer values
?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : hexa formats with integer values ***\n";
// array of integer values
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : hexa formats with integer values ***\n";
// array of integer values
?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : unsigned formats with integer values ***\n";
// array of integer values
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : unsigned formats with integer values ***\n";
// array of integer values
Test sprintf() function : usage variations - scientific formats with integer values
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : scientific formats with integer values ***\n";
// array of integer values
Test sprintf() function : usage variations - scientific formats with float values
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : scientific formats with float values ***\n";
// array of float values
Test sprintf() function : usage variations - typical format strings
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : with typical format strings ***\n";
// initialising required variables
Test sprintf() function : usage variations - with whitespaces in format strings
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : with white spaces in format strings ***\n";
// initializing the format array
Test sprintf() function : usage variations - float formats with float values
--FILE--
<?php
-/* Prototype : string sprintf(string $format [, mixed $arg1 [, mixed ...]])
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing sprintf() : float formats with float values ***\n";
// array of float type values
Test sscanf() function : basic functionality - string format
--FILE--
<?php
-/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] )
- * Description: Parses input from a string according to a format
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing sscanf() : basic functionality
*/
Test sscanf() function : basic functionality - integer format
--FILE--
<?php
-/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] )
- * Description: Parses input from a string according to a format
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing sscanf() : basic functionality
*/
--FILE--
<?php
-/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] )
- * Description: Parses input from a string according to a format
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing sscanf() : basic functionality -- using float format ***\n";
$str = "Part: Widget Length: 111.53 Width: 22.345 Depth: 12.4";
--FILE--
<?php
-/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] )
- * Description: Parses input from a string according to a format
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing sscanf() : basic functionality - using char format ***\n";
$str = "X = A + B - C";
--FILE--
<?php
-/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] )
- * Description: Parses input from a string according to a format
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing sscanf() : basic functionality -using exponential format ***\n";
$str = "10.12345 10.12345E3 10.12345e3 -10.12345e4" ;
--FILE--
<?php
-/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] )
- * Description: Parses input from a string according to a format
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing sscanf() : basic functionality - using unsigned format ***\n";
$str = "-11 +11 11 -11.234 +11.234 11.234";
--FILE--
<?php
-/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] )
- * Description: Parses input from a string according to a format
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing sscanf() : basic functionality - using octal format ***\n";
$str = "0123 -0123 +0123 0129 -0129 +0129";
--FILE--
<?php
-/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] )
- * Description: Parses input from a string according to a format
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing sscanf() : basic functionality - - using hexadecimal format ***\n";
$str = "129 12F 123B -123B 01ABC 1G";
--FILE--
<?php
-/* Prototype : mixed sscanf ( string $str , string $format [, mixed &$... ] )
- * Description: Parses input from a string according to a format
- * Source code: ext/standard/string.c
-*/
echo "*** Testing sscanf() : error conditions ***\n";
$str = "Hello World";
Test str_contains() function
--FILE--
<?php
-/* Prototype: str_contains ( string $haystack , string $needle ) : bool
- Description: Check if a string contains another string
- Source code: ext/standard/string.c
-*/
var_dump(str_contains("test string", "test"));
var_dump(str_contains("test string", "string"));
var_dump(str_contains("test string", "strin"));
str_ends_with() function - unit tests for str_ends_with()
--FILE--
<?php
-/* Prototype: bool str_ends_with (string $haystack, string $needle);
- Description: Determine if $haystack ends with $needle
-*/
$testStr = "beginningMiddleEnd";
var_dump(str_ends_with($testStr, "End"));
var_dump(str_ends_with($testStr, "end"));
?>
--FILE--
<?php
-/* Prototype : string str_pad ( string $input , int $pad_length [, string $pad_string [, int $pad_type ]] )
- * Description: Pad a string to a certain length with another string
- * Source code: ext/standard/string.c
-*/
-
/* Test str_pad() function: with unexpected inputs for '$pad_length'
* and expected type for '$input'
*/
?>
--FILE--
<?php
-/* Prototype : string str_pad ( string $input , int $pad_length [, string $pad_string [, int $pad_type ]] )
- * Description: Pad a string to a certain length with another string
- * Source code: ext/standard/string.c
-*/
-
/* Test str_pad() function: with unexpected inputs for '$pad_length'
* and expected type for '$input'
*/
precision=14
--FILE--
<?php
-/*
- Prototype: mixed str_replace(mixed $search, mixed $replace,
- mixed $subject [, int &$count]);
- Description: Replace all occurrences of the search string with
- the replacement string
-*/
-
echo "\n*** Testing str_replace() on basic operations ***\n";
var_dump( str_replace("", "", "") );
precision=14
--FILE--
<?php
-/*
- Prototype: mixed str_replace(mixed $search, mixed $replace,
- mixed $subject [, int &$count]);
- Description: Replace all occurrences of the search string with
- the replacement string
-*/
-
-
echo "\n*** Testing str_replace() with various search values ***";
$search_arr = array( TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL,
array(), "php", "");
--FILE--
<?php
/*
- Prototype: mixed str_replace(mixed $search, mixed $replace,
- mixed $subject [, int &$count]);
Description: Replace all occurrences of the search string with
the replacement string
*/
Test soundex() function : basic functionality
--FILE--
<?php
-/* Prototype : string str_rot13 ( string $str )
- * Description: Perform the rot13 transform on a string
- * Source code: ext/standard/string.c
-*/
echo "*** Testing str_rot13() : basic functionality ***\n";
echo "\nBasic tests\n";
Test str_shuffle() function : basic functionality
--FILE--
<?php
-/* Prototype : string str_shuffle ( string $str )
- * Description: Randomly shuffles a string
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing str_shuffle() : basic functionality
*/
Test str_split() function : basic functionality
--FILE--
<?php
-/* Prototype : array str_split(string $str [, int $split_length])
- * Description: Convert a string to an array. If split_length is
- specified, break the string down into chunks each
- split_length characters long.
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
echo "*** Testing str_split() : basic functionality ***\n";
// Initialise all required variables
Test str_split() function : usage variations - different single quoted strings for 'str' argument
--FILE--
<?php
-/* Prototype : array str_split(string $str [, int $split_length])
- * Description: Convert a string to an array. If split_length is
- specified, break the string down into chunks each
- split_length characters long.
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* passing different single quoted strings as 'str' argument to str_split()
* split_length is set to 5
Test str_split() function : usage variations - different heredoc strings as 'str' argument
--FILE--
<?php
-/* Prototype : array str_split(string $str [, int $split_length] )
- * Description: Convert a string to an array. If split_length is
- specified, break the string down into chunks each
- split_length characters long.
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Passing different heredoc strings as 'str' argument to the str_split()
* with 'split_length' 10
?>
--FILE--
<?php
-/* Prototype : array str_split(string $str [, int $split_length])
- * Description: Convert a string to an array. If split_length is
- specified, break the string down into chunks each
- split_length characters long.
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* passing different integer values for 'split_length' argument to str_split()
*/
?>
--FILE--
<?php
-/* Prototype : array str_split(string $str [, int $split_length])
- * Description: Convert a string to an array. If split_length is
- specified, break the string down into chunks each
- split_length characters long.
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* passing different integer values for 'split_length' argument to str_split()
*/
?>
--FILE--
<?php
-/* Prototype : array str_split(string $str [, int $split_length])
- * Description: Convert a string to an array. If split_length is
- specified, break the string down into chunks each
- split_length characters long.
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* passing different integer values for 'split_length' and heredoc string as 'str' argument to str_split()
*/
?>
--FILE--
<?php
-/* Prototype : array str_split(string $str [, int $split_length])
- * Description: Convert a string to an array. If split_length is
- specified, break the string down into chunks each
- split_length characters long.
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* passing different integer values for 'split_length' and heredoc string as 'str' argument to str_split()
*/
str_starts_with() function - unit tests for str_starts_with()
--FILE--
<?php
-/* Prototype: bool str_starts_with (string $haystack, string $needle);
- Description: Determine if $haystack begins with $needle
-*/
$testStr = "beginningMiddleEnd";
var_dump(str_starts_with($testStr, "beginning"));
var_dump(str_starts_with($testStr, "Beginning"));
Test strcspn() function : basic functionality
--FILE--
<?php
-/* Prototype : proto int strcspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters not found in mask.
- If start or/and length is provided, it works like strcspn(substr($s,$start,$len),$bad_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strcspn() : basic functionality
*/
Test strcspn() function : usage variations - with varying mask & default start and len args
--FILE--
<?php
-/* Prototype : proto int strcspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters not found in mask.
- If start or/and length is provided works like strcspn(substr($s,$start,$len),$bad_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strcspn() : with varying mask and default start and len arguments
*/
Test strcspn() function : usage variations - with varying start and default len args
--FILE--
<?php
-/* Prototype : proto int strcspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters not found in mask.
- If start or/and length is provided works like strcspn(substr($s,$start,$len),$bad_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strcspn() : with varying start and default len arguments
*/
Test strcspn() function : usage variations - with varying start and len args
--FILE--
<?php
-/* Prototype : proto int strcspn(string str, string mask [,int start [,int len]])
- * Description: Finds length of initial segment consisting entirely of characters not found in mask.
- If start or/and length is provided works like strcspn(substr($s,$start,$len),$bad_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strcspn() : with varying start and len arguments
*/
Test strcspn() function : usage variations - with heredoc strings, varying mask & default start and len args
--FILE--
<?php
-/* Prototype : proto int strcspn(string str, string mask [,int start [,int len]])
- * Description: Finds length of initial segment consisting entirely of characters not found in mask.
- If start or/and length is provided works like strcspn(substr($s,$start,$len),$bad_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strcspn() : with heredoc string, varying mask and default start and len arguments
*/
Test strcspn() function : usage variations - with heredoc strings, varying start and default len args
--FILE--
<?php
-/* Prototype : proto int strcspn(string str, string mask [, int start [,int len]])
- * Description: Finds length of initial segment consisting entirely of characters not found in mask.
- If start or/and length is provided works like strcspn(substr($s,$start,$len),$bad_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strcspn() : with heredoc string, varying start and default len arguments
*/
Test strcspn() function : usage variations - with heredoc strings, varying start and len args
--FILE--
<?php
-/* Prototype : proto int strcspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters not found in mask.
- If start or/and length is provided works like strcspn(substr($s,$start,$len),$bad_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strcspn() : with heredoc string, varying start and len arguments
*/
Test strip_tags() function : basic functionality - with default arguments
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strip_tags() : basic functionality ***\n";
// array of arguments
Test strip_tags() function : basic functionality - with all arguments
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strip_tags() : basic functionality ***\n";
// Calling strip_tags() with all possible arguments
Test strip_tags() function : usage variations - single quoted strings
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
/*
* testing functionality of strip_tags() by giving single quoted strings as values for $str argument
*/
Test strip_tags() function : usage variations - unexpected values for 'allowable_tags'
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
/*
* testing functionality of strip_tags() by giving unexpected values for $allowable_tags argument
*/
Test strip_tags() function : usage variations - invalid values for 'str' and valid 'allowable_tags'
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
/*
* testing functionality of strip_tags() by giving invalid values for $str and valid values for $allowable_tags argument
*/
Test strip_tags() function : usage variations - heredoc strings
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
-
/*
* testing functionality of strip_tags() by giving heredoc strings as values for $str argument
*/
Test strip_tags() function : usage variations - binary safe checking
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
/*
* testing whether strip_tags() is binary safe or not
*/
Test strip_tags() function : usage variations - invalid values for 'str' and 'allowable_tags'
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
/*
* testing functionality of strip_tags() by giving invalid values for $str and $allowable_tags argument
*/
Test strip_tags() function : usage variations - valid value for 'str' and invalid values for 'allowable_tags'
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
/*
* testing functionality of strip_tags() by giving valid value for $str and invalid values for $allowable_tags argument
*/
Test strip_tags() function : usage variations - double quoted strings
--FILE--
<?php
-/* Prototype : string strip_tags(string $str [, string $allowable_tags])
- * Description: Strips HTML and PHP tags from a string
- * Source code: ext/standard/string.c
-*/
-
/*
* testing functionality of strip_tags() by giving double quoted strings as values for $str argument
*/
--FILE--
<?php
-/* Prototype : string stripcslashes ( string $str )
- * Description: Returns a string with backslashes stripped off. Recognizes C-like \n, \r ...,
- * octal and hexadecimal representation.
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing stripcslashes() : basic functionality ***\n";
var_dump(stripcslashes('\H\e\l\l\o \W\or\l\d'));
var_dump(stripcslashes('Hello World\\r\\n'));
Test stripos() function : basic functionality - with default arguments
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing stripos() function: basic functionality ***\n";
$heredoc_str = <<<Identifier
Hello, World
Test stripos() function : basic functionality - with all arguments
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing stripos() function: basic functionality ***\n";
$heredoc_str = <<<Identifier
Hello, World
Test stripos() function : error conditions
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing stripos() function: error conditions ***\n";
echo "\n-- Offset beyond the end of the string --\n";
Test stripos() function : usage variations - double quoted strings for 'haystack' & 'needle' arguments
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function by passing double quoted strings for 'haystack' & 'needle' arguments */
echo "*** Testing stripos() function: with double quoted strings ***\n";
Test stripos() function : usage variations - unexpected inputs for 'needle' argument
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function with unexpected inputs for 'needle' and
* an expected type of input for 'haystack' argument
*/
Test stripos() function : usage variations - unexpected inputs for 'haystack' and 'needle' arguments
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function with unexpected inputs for 'haystack' and 'needle' arguments */
echo "*** Testing stripos() function with unexpected values for haystack and needle ***\n";
Test stripos() function : usage variations - null terminated strings for 'haystack' argument
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function with null terminated strings for 'haystack' argument
* in order to check the binary safe
*/
Test stripos() function : usage variations - null terminated strings for 'needle' argument
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function with null terminated strings for 'needle' argument
* in order to check binary safe
*/
Test stripos() function : usage variations - single quoted strings for 'haystack' & 'needle' arguments
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function by passing single quoted strings to 'haystack' & 'needle' arguments */
echo "*** Testing stripos() function: with single quoted strings ***\n";
Test stripos() function : usage variations - multi line heredoc string for 'haystack' argument
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function by passing multi-line heredoc string for haystack and
* with various needles & offsets
*/
Test stripos() function : usage variations - heredoc string containing special chars for 'haystack' argument
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function by passing heredoc string containing special chars for haystack
* and with various needles & offsets
*/
Test stripos() function : usage variations - heredoc string containing escape chars for 'haystack' argument
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function by passing heredoc string containing escape chars for haystack
* and with various needles & offsets
*/
Test stripos() function : usage variations - heredoc string containing quotes for 'haystack' argument
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function by passing heredoc string containing quotes for haystack
* and with various needles & offsets
*/
Test stripos() function : usage variations - empty heredoc string for 'haystack' argument
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function by passing empty heredoc string for haystack
* and with various needles & offsets
*/
Test stripos() function : usage variations - repetitive chars for 'haystack' argument
--FILE--
<?php
-/* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of first occurrence of a case-insensitive string
- * Source code: ext/standard/string.c
-*/
-
/* Test stripos() function with strings containing repetitive chars for haystak
* and with various needles & offsets
*/
Test stripslashes() function : usage variations - strings with newline and tab characters
--FILE--
<?php
-/* Prototype : string stripslashes ( string $str )
- * Description: Returns an un-quoted string
- * Source code: ext/standard/string.c
-*/
-
/*
* Test stripslashes() with strings containing newline and tab characters.
*/
Test stripslashes() function : usage variations - double dimensional arrays
--FILE--
<?php
-/* Prototype : string stripslashes ( string $str )
- * Description: Returns an un-quoted string
- * Source code: ext/standard/string.c
-*/
-
/*
* Test stripslashes() with double dimensional arrays
*/
Test stristr() function : basic functionality
--FILE--
<?php
-/* Prototype: string stristr ( string $haystack , mixed $needle [, bool $before_needle ] )
- Description: Case-insensitive strstr().
-*/
echo "*** Testing stristr() : basic functionality ***\n";
--FILE--
<?php
-/* Prototype: string stristr ( string $haystack, string $needle );
- Description: Case-insensitive strstr().
-*/
-
echo "*** Testing stristr() function: with unexpected inputs for 'needle' argument ***\n";
//get an unset variable
--FILE--
<?php
-/* Prototype : int strlen ( string $string )
- * Description: Get string length
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strlen() : basic functionality ***\n";
var_dump(strlen("abcdef"));
var_dump(strlen(" ab de "));
Felix De Vliegher <felix.devliegher@gmail.com>
--FILE--
<?php
-/* Prototype : int strnatcasecmp(string s1, string s2)
- * Description: Returns the result of case-insensitive string comparison using 'natural' algorithm
- * Source code: ext/standard/string.c
- * Alias to functions:
- */
-
function str_dump($one, $two) {
var_dump(strnatcasecmp($one, $two));
}
Felix De Vliegher <felix.devliegher@gmail.com>
--FILE--
<?php
-/* Prototype : int strnatcasecmp(string s1, string s2)
- * Description: Returns the result of case-insensitive string comparison using 'natural' algorithm
- * Source code: ext/standard/string.c
- * Alias to functions:
- */
-
/* Preparation */
class a
{
Test strnatcmp() function : basic functionality
--FILE--
<?php
-/* Prototype : int strnatcmp ( string $str1 , string $str2 )
- * Description: String comparisons using a "natural order" algorithm
- * Source code: ext/standard/string.c
-*/
echo "*** Testing strnatcmp() : basic functionality ***\n";
$a1 = "abc1";
Sol Richardson <sr5732358@hotmail.com>
--FILE--
<?php
-/* Prototype : int strnatcmp ( string $str1 , string $str2 )
-* Description: String comparisons using a "natural order" algorithm
-* Source code: ext/standard/string.c
-*/
-
echo "-- Testing strnatcmp() function whitespace, left-align, digit --\n";
echo "-- Leading whitespace, digits, string 1 longer --\n";
$str1 = " 00";
Test strncasecmp() function : basic functionality
--FILE--
<?php
-/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-insensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
echo "*** Testing strncasecmp() function: basic functionality ***\n";
echo "-- Testing strncasecmp() with single quoted string --\n";
Test strncasecmp() function : error conditions
--FILE--
<?php
-/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-insensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
echo "*** Testing strncasecmp() function: error conditions ***\n";
$str1 = 'string_val';
$str2 = 'string_val';
Test strncasecmp() function: usage variations - case-sensitivity
--FILE--
<?php
-/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-insensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncasecmp() function with upper-case and lower-case alphabets as inputs for 'str1' and 'str2' */
echo "*** Test strncasecmp() function: with alphabets ***\n";
Test strncasecmp() function: usage variations - double quoted strings
--FILE--
<?php
-/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-insensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncasecmp() function with various double quoted strings for 'str1', 'str2' */
echo "*** Test strncasecmp() function: with double quoted strings ***\n";
Test strncasecmp() function: usage variations - various lengths
--FILE--
<?php
-/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-insensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncasecmp() with various lengths */
echo "*** Test strncasecmp() function: with different lengths ***\n";
Test strncasecmp() function : usage variations - binary safe - all ASCII chars
--FILE--
<?php
-/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-insensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncasecmp() function with binary values passed to 'str1' & 'str2' */
echo "*** Test strncasecmp() function: with binary inputs ***\n";
Test strncasecmp() function : usage variations - binary safe
--FILE--
<?php
-/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-insensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncasecmp() function with null terminated strings and binary values passed to 'str1' & 'str2' */
echo "*** Test strncasecmp() function: with null terminated strings and binary inputs ***\n";
Test strncasecmp() function: usage variations - single quoted strings
--FILE--
<?php
-/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-insensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncasecmp() function with various single quoted strings for 'str1', 'str2' */
echo "*** Test strncasecmp() function: with single quoted strings ***\n";
Test strncasecmp() function: usage variations - heredoc strings
--FILE--
<?php
-/* Prototype : int strncasecmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-insensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncasecmp() function with here-doc strings for 'str1', 'str2' */
echo "*** Test strncasecmp() function: with here-doc strings ***\n";
Test strncmp() function : basic functionality
--FILE--
<?php
-/* Prototype : int strncmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-sensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
echo "*** Testing strncmp() function: basic functionality ***\n";
echo "-- Testing strncmp() with single quoted string --\n";
Test strncmp() function : error conditions
--FILE--
<?php
-/* Prototype : int strncmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-sensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncmp() function with more/less number of args and invalid args */
echo "*** Testing strncmp() function: error conditions ***\n";
Test strncmp() function: usage variations - case-sensitivity
--FILE--
<?php
-/* Prototype : int strncmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-sensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncmp() function with upper-case and lower-case alphabets as inputs for 'str1' and 'str2' */
echo "*** Test strncmp() function: with alphabets ***\n";
Test strncmp() function: usage variations - double quoted strings
--FILE--
<?php
-/* Prototype : int strncmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-sensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncmp() function with double quoted strings for 'str1', 'str2' */
echo "*** Test strncmp() function: with double quoted strings ***\n";
Test strncmp() function: usage variations - different lengths
--FILE--
<?php
-/* Prototype : int strncmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-sensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncmp() with various lengths */
echo "*** Test strncmp() function: with different lengths ***\n";
Test strncmp() function : usage variations - binary safe(null terminated strings)
--FILE--
<?php
-/* Prototype : int strncmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-sensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncmp() function with binary values passed to 'str1' & 'str2' and with the null terminated strings */
echo "*** Test strncmp() function: Checking with the null terminated strings ***\n";
Test strncmp() function: usage variations - single quoted strings
--FILE--
<?php
-/* Prototype : int strncmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-sensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncmp() function with single quoted strings for 'str1', 'str2' */
echo "*** Test strncmp() function: with single quoted strings ***\n";
Test strncmp() function: usage variations - different inputs(heredoc strings)
--FILE--
<?php
-/* Prototype : int strncmp ( string $str1, string $str2, int $len );
- * Description: Binary safe case-sensitive string comparison of the first n characters
- * Source code: Zend/zend_builtin_functions.c
-*/
-
/* Test strncmp() function with different strings for 'str1', 'str2' and considering case sensitive */
echo "*** Test strncmp() function: with different input strings ***\n";
Test strpbrk() function : basic functionality
--FILE--
<?php
-/* Prototype : array strpbrk(string haystack, string char_list)
- * Description: Search a string for any of a set of characters
- * Source code: ext/standard/string.c
- * Alias to functions:
- */
-
echo "*** Testing strpbrk() : basic functionality ***\n";
// Initialise all required variables
Test strpbrk() function : error conditions
--FILE--
<?php
-/* Prototype : array strpbrk(string haystack, string char_list)
- * Description: Search a string for any of a set of characters
- * Source code: ext/standard/string.c
- * Alias to functions:
- */
-
$haystack = 'This is a Simple text.';
echo "-- Testing strpbrk() function with empty second argument --\n";
Test strrchr() function : basic functionality
--FILE--
<?php
-/* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strrchr() function: basic functionality ***\n";
var_dump( strrchr("Hello, World", "H") ); //needle as single char
var_dump( strrchr("Hello, World", "Hello") ); //needle as a first word of haystack
Test strrchr() function : usage variations - unexpected inputs for needle
--FILE--
<?php
-/* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrchr() function: with unexpected inputs for needle
* and expected type for haystack
*/
Test strrchr() function : usage variations - unexpected inputs for haystack and needle
--FILE--
<?php
-/* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrchr() function with unexpected inputs for haystack and needle */
echo "*** Testing strrchr() function: with unexpected inputs for haystack and needle ***\n";
Test strrchr() function : usage variations - single quoted strings
--FILE--
<?php
-/* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrchr() function by passing various single quoted strings to 'haystack' & 'needle' */
echo "*** Testing strrchr() function: with various single quoted strings ***";
Test strrchr() function : usage variations - multi line heredoc string for 'haystack'
--FILE--
<?php
-/* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrchr() function by passing multi-line heredoc string for haystack and
* with various needles
*/
Test strrchr() function : usage variations - heredoc string containing special chars for 'haystack'
--FILE--
<?php
-/* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrchr() function by passing heredoc string containing special chars for haystack
* and with various needles
*/
Test strrchr() function : usage variations - heredoc string containing quote chars for 'haystack'
--FILE--
<?php
-/* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrchr() function by passing heredoc string containing quote chars for haystack
* and with various needles
*/
Test strrchr() function : usage variations - heredoc string containing blank line for 'haystack'
--FILE--
<?php
-/* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrchr() function by passing heredoc string containing
* blank-line for haystack and with various needles
*/
Test strrchr() function : usage variations - empty heredoc string for 'haystack'
--FILE--
<?php
-/* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrchr() function by passing empty heredoc string for haystack
* and with various needles
*/
Test strrev() function : basic functionality
--FILE--
<?php
-/* Prototype : string strrev(string $str);
- * Description: Reverse a string
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strrev() : basic functionality ***\n";
$heredoc = <<<EOD
Hello, world
Test strripos() function : basic functionality - with default arguments
--FILE--
<?php
-/* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strripos() function: basic functionality ***\n";
$heredoc_str = <<<EOD
Hello, World
Test strripos() function : basic functionality - with all arguments
--FILE--
<?php
-/* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strripos() function: basic functionality ***\n";
$heredoc_str = <<<EOD
Hello, World
Test strripos() function : usage variations - double quoted strings for 'haystack' & 'needle' arguments
--FILE--
<?php
-/* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
- * Source code: ext/standard/string.c
-*/
-
/* Test strripos() function by passing double quoted strings for 'haystack' & 'needle' arguments */
echo "*** Testing strripos() function: with double quoted strings ***\n";
Test strripos() function : usage variations - single quoted strings for 'haystack' & 'needle' arguments
--FILE--
<?php
-/* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
- * Source code: ext/standard/string.c
-*/
-
/* Test strripos() function by passing single quoted strings to 'haystack' & 'needle' arguments */
echo "*** Testing strripos() function: with single quoted strings ***\n";
Test strripos() function : usage variations - multi line heredoc string for 'haystack' argument
--FILE--
<?php
-/* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
- * Source code: ext/standard/string.c
-*/
-
/* Test strripos() function by passing multi-line heredoc string for haystack and
* with various needles & offsets
*/
Test strripos() function : usage variations - heredoc string containing special chars for 'haystack' argument
--FILE--
<?php
-/* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
- * Source code: ext/standard/string.c
-*/
-
/* Test strripos() function by passing heredoc string containing special chars for haystack
* and with various needles & offsets
*/
Test strripos() function : usage variations - heredoc string containing escape chars for 'haystack' argument
--FILE--
<?php
-/* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
- * Source code: ext/standard/string.c
-*/
-
/* Test strripos() function by passing heredoc string containing escape chars for haystack
* and with various needles & offsets
*/
Test strrpos() function : basic functionality - with default arguments
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strrpos() function: basic functionality ***\n";
$heredoc_str = <<<EOD
Hello, World
Test strrpos() function : basic functionality - with all arguments
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strrpos() function: basic functionality ***\n";
$heredoc_str = <<<EOD
Hello, World
Test strrpos() function : usage variations - double quoted strings for 'haystack' & 'needle' arguments
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function by passing double quoted strings for 'haystack' & 'needle' arguments */
echo "*** Testing strrpos() function: with double quoted strings ***\n";
Test strrpos() function : usage variations - unexpected inputs for 'needle' argument
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function with unexpected inputs for 'needle' and
* an expected type of input for 'haystack' argument
*/
Test strrpos() function : usage variations - unexpected inputs for 'haystack' and 'needle' arguments
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function with unexpected inputs for 'haystack' and 'needle' arguments */
echo "*** Testing strrpos() function with unexpected values for haystack and needle ***\n";
Test strrpos() function : usage variations - checking binary safe with 'haystack' argument
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function with null terminated strings for 'haystack' argument
* in order to check the binary safe
*/
Test strrpos() function : usage variations - checking bianry safe with 'needle' argument
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function with null terminated strings for 'needle' argument
* in order to check binary safe
*/
Test strrpos() function : usage variations - single quoted strings for 'haystack' & 'needle' arguments
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function by passing single quoted strings to 'haystack' & 'needle' arguments */
echo "*** Testing strrpos() function: with single quoted strings ***\n";
Test strrpos() function : usage variations - multi line heredoc string for 'haystack' argument
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function by passing multi-line heredoc string for haystack and
* with various needles & offsets
*/
Test strrpos() function : usage variations - heredoc string containing special chars for 'haystack' argument
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function by passing heredoc string containing special chars for haystack
* and with various needles & offsets
*/
Test strrpos() function : usage variations - heredoc string containing escape chars for 'haystack' argument
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function by passing heredoc string containing escape chars for haystack
* and with various needles & offsets
*/
Test strrpos() function : usage variations - heredoc string containing quotes for 'haystack' argument
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function by passing heredoc string containing quotes for haystack
* and with various needles & offsets
*/
Test strrpos() function : usage variations - empty heredoc string for 'haystack' argument
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function by passing empty heredoc string for haystack
* and with various needles & offsets
*/
Test strrpos() function : usage variations - repetitive chars for 'haystack' argument
--FILE--
<?php
-/* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
- * Description: Find position of last occurrence of 'needle' in 'haystack'.
- * Source code: ext/standard/string.c
-*/
-
/* Test strrpos() function with strings containing multiple occurrences of 'needle' in the 'haystack'
* and with various needles & offsets
*/
Test strspn() function : basic functionality
--FILE--
<?php
-/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters found in mask.
- If start or/and length is provided, it works like strspn(substr($s,$start,$len),$good_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strspn() : basic functionality
*/
Test strspn() function : usage variations - with varying mask & default start and len args
--FILE--
<?php
-/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters found in mask.
- If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strspn() : with varying mask and default start and len arguments
*/
Test strspn() function : usage variations - with varying start and default len args
--FILE--
<?php
-/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters found in mask.
- If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strspn() : with varying start and default len arguments
*/
Test strspn() function : usage variations - with varying start and len args
--FILE--
<?php
-/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters found in mask.
- If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strspn() : with varying start and len arguments
*/
Test strspn() function : usage variations - with heredoc strings, varying mask & default start and len args
--FILE--
<?php
-/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters found in mask.
- If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strspn() : with heredoc string, varying mask and default start and len arguments
*/
Test strspn() function : usage variations - with heredoc strings, varying start and default len args
--FILE--
<?php
-/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters found in mask.
- If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strspn() : with heredoc string, varying start and default len arguments
*/
Test strspn() function : usage variations - with heredoc strings, varying start and len args
--FILE--
<?php
-/* Prototype : proto int strspn(string str, string mask [, int start [, int len]])
- * Description: Finds length of initial segment consisting entirely of characters found in mask.
- If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)
- * Source code: ext/standard/string.c
- * Alias to functions: none
-*/
-
/*
* Testing strspn() : with heredoc string, varying start and len arguments
*/
Test strtok() function : basic functionality
--FILE--
<?php
-/* Prototype : string strtok ( str $str, str $token )
- * Description: splits a string (str) into smaller strings (tokens), with each token being delimited by any character from token
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing strtok() : basic functionality
*/
Test strtok() function : usage variations - with heredoc strings
--FILE--
<?php
-/* Prototype : string strtok ( str $str, str $token )
- * Description: splits a string (str) into smaller strings (tokens), with each token being delimited by any character from token
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing strtok() : with heredoc strings
*/
Test strtok() function : usage variations - with embedded nulls in the strings
--FILE--
<?php
-/* Prototype : string strtok ( str $str, str $token )
- * Description: splits a string (str) into smaller strings (tokens), with each token being delimited by any character from token
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing strtok() : with embedded nulls in the strings
*/
Test strtok() function : usage variations - miscellaneous inputs
--FILE--
<?php
-/* Prototype : string strtok ( str $str, str $token )
- * Description: splits a string (str) into smaller strings (tokens), with each token being delimited by any character from token
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing strtok() : with miscellaneous combinations of string and token
*/
Test strtok() function : usage variations - invalid escape sequences as tokens
--FILE--
<?php
-/* Prototype : string strtok ( str $str, str $token )
- * Description: splits a string (str) into smaller strings (tokens), with each token being delimited by any character from token
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing strtok() : with invalid escape sequences in token
*/
Test strtok() function : usage variations - modifying the input string while tokenising
--FILE--
<?php
-/* Prototype : string strtok ( str $str, str $token )
- * Description: splits a string (str) into smaller strings (tokens), with each token being delimited by any character from token
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing strtok() : modifying the input string while it is getting tokenised
*/
Test strtr() function : basic functionality
--FILE--
<?php
-/* Prototype : string strtr(string $str, string $from[, string $to]);
- * Description: Translates characters in str using given translation pairs
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing strtr() : basic functionality ***\n";
//definitions of required input variables
$trans1_arr = array("t" => "T", "e" => "E", "st" => "ST");
Test strtr() function : usage variations - regular & numeric strings for 'str' argument
--FILE--
<?php
-/* Prototype : string strtr(string $str, string $from[, string $to]);
- string strtr(string $str, array $replace_pairs);
- * Description: Translates characters in str using given translation tables
- * Source code: ext/standard/string.c
-*/
-
/* Testing strtr() function by passing the
* combination of numeric & regular strings for 'str' argument and
* corresponding translation pair of chars for 'from', 'to' & 'replace_pairs' arguments
Test strtr() function : usage variations - string containing special chars for 'str' argument
--FILE--
<?php
-/* Prototype : string strtr(string $str, string $from[, string $to]);
- string strtr(string $str, array $replace_pairs);
- * Description: Translates characters in str using given translation tables
- * Source code: ext/standard/string.c
-*/
-
/* Testing strtr() function by passing the
* string containing various special characters for 'str' argument and
* corresponding translation pair of chars for 'from', 'to' & 'replace_pairs' arguments
Test strtr() function : usage variations - string containing escape sequences for 'str' argument
--FILE--
<?php
-/* Prototype : string strtr(string $str, string $from[, string $to]);
- string strtr(string $str, array $replace_pairs);
- * Description: Translates characters in str using given translation tables
- * Source code: ext/standard/string.c
-*/
-
/* Testing strtr() function by passing the
* string containing various escape sequences for 'str' argument and
* corresponding translation pair of chars for 'from', 'to' & 'replace_pairs' arguments
Test strtr() function : usage variations - empty string & null for 'str' argument
--FILE--
<?php
-/* Prototype : string strtr(string $str, string $from[, string $to]);
- string strtr(string $str, array $replace_pairs);
- * Description: Translates characters in str using given translation tables
- * Source code: ext/standard/string.c
-*/
-
/* Testing strtr() function by passing the
* empty string & null for 'str' argument and
* corresponding translation pair of chars for 'from', 'to' & 'replace_pairs' arguments
Test strtr() function : usage variations - unexpected inputs for 'from' argument
--FILE--
<?php
-/* Prototype : string strtr(string $str, string $from[, string $to]);
- string strtr(string $str, array $replace_pairs);
- * Description: Translates characters in str using given translation tables
- * Source code: ext/standard/string.c
-*/
-
/* Test strtr() function: with unexpected inputs for 'from'
* and expected type for 'str' & 'to' arguments
*/
Test strtr() function : usage variations - unexpected inputs for 'replace_pairs' argument
--FILE--
<?php
-/* Prototype : string strtr(string $str, string $from[, string $to]);
- string strtr(string $str, array $replace_pairs);
- * Description: Translates characters in str using given translation tables
- * Source code: ext/standard/string.c
-*/
-
/* Test strtr() function: with unexpected inputs for 'replace_pairs'
* and expected type for 'str' arguments
*/
Test strval() function : basic functionality
--FILE--
<?php
-/* Prototype : string strval ( mixed $var )
- * Description: Get the string value of a variable.
- * Source code: ext/standard/string.c
- */
-
echo "*** Testing strval() : basic variations ***\n";
error_reporting(E_ALL ^ E_NOTICE);
Test strval() function : usage variations - error conditions
--FILE--
<?php
-/* Prototype : string strval ( mixed $var )
- * Description: Get the string value of a variable.
- * Source code: ext/standard/string.c
- */
-
echo "*** Testing strval() : error conditions ***\n";
error_reporting(E_ALL ^ E_NOTICE);
Test strval() function : usage variations - Pass different data types as strval
--FILE--
<?php
-/* Prototype : string strval ( mixed $var )
- * Description: Get the string value of a variable.
- * Source code: ext/standard/string.c
- */
-
echo "*** Testing strval() : usage variations ***\n";
//get an unset variable
Test strval() function : usage variations - Pass all valid char codes
--FILE--
<?php
-/* Prototype : string strval ( mixed $var )
- * Description: Get the string value of a variable.
- * Source code: ext/standard/string.c
- */
-
echo "*** Testing strval() : usage variations - Pass all valid char codes ***\n";
$s0 = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f";
Test substr_replace() function : error conditions
--FILE--
<?php
-/* Prototype : mixed substr_replace ( mixed $string , string $replacement , int $start [, int $length ] )
- * Description: Replace text within a portion of a string
- * Source code: ext/standard/string.c
-*/
-
/*
* Testing substr_replace() for error conditions
*/
--FILE--
<?php
-/* Prototype : string trim ( string $str [, string $charlist ] )
- * Description: Strip whitespace (or other characters) from the beginning and end of a string.
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing trim() : basic functionality ***\n";
$text = " \t\r\n\0\x0B ---These are a few words--- \t\r\n\0\x0B ";
--FILE--
<?php
-/* Prototype : string trim ( string $str [, string $charlist ] )
- * Description: Strip whitespace (or other characters) from the beginning and end of a string.
- * Source code: ext/standard/string.c
-*/
-
-
echo "*** Testing trim() : error conditions ***\n";
$hello = " Hello World\n";
Test ucwords() function : basic functionality
--FILE--
<?php
-/* Prototype : string ucwords ( string $str )
- * Description: Uppercase the first character of each word in a string
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing ucwords() : basic functionality ***\n";
// lines with different whitespace character
Test ucwords() function : usage variations - heredoc strings
--FILE--
<?php
-/* Prototype : string ucwords ( string $str )
- * Description: Uppercase the first character of each word in a string
- * Source code: ext/standard/string.c
-*/
-
/*
* test ucwords() with different string prepared using heredoc
*/
Test ucwords() function : usage variations - single quoted string
--FILE--
<?php
-/* Prototype : string ucwords ( string $str )
- * Description: Uppercase the first character of each word in a string
- * Source code: ext/standard/string.c
-*/
-
/*
* test ucwords() with different string prepared using single quote
*/
Test ucwords() function : usage variations - double quoted string
--FILE--
<?php
-/* Prototype : string ucwords ( string $str )
- * Description: Uppercase the first character of each word in a string
- * Source code: ext/standard/string.c
-*/
-
/*
* test ucwords() with different string prepared using double quote
*/
Test ucwords() function : usage variations - custom delimiters
--FILE--
<?php
-/* Prototype : string ucwords ( string $str )
- * Description: Uppercase the first character of each word in a string
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing ucwords() : usage variations ***\n";
var_dump(ucwords('testing-dashed-words', '-'));
--FILE--
<?php
-/* Prototype : array unpack ( string $format , string $data )
- * Description: Unpack data from binary string
- * Source code: ext/standard/pack.c
-*/
-
echo "*** Testing unpack() : error conditions ***\n";
echo "\n-- Testing unpack() function with invalid format character --\n";
precision=14
--FILE--
<?php
-/* Prototype : int vfprintf(resource stream, string format, array args)
- * Description: Output a formatted string into a stream
- * Source code: ext/standard/formatted_print.c
- * Alias to functions:
- */
-
function writeAndDump($fp, $format, $args)
{
ftruncate( $fp, 0 );
Test vfprintf() function : basic functionality - string format
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vfprintf() : basic functionality - using string format ***\n";
// Initialise all required variables
Test vfprintf() function : basic functionality - integer format
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Testing vfprintf() : basic functionality - using integer format
*/
Test vfprintf() function : basic functionality - float format
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vfprintf() : basic functionality - using float format ***\n";
// Initialise all required variables
Test vfprintf() function : basic functionality - bool format
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vfprintf() : basic functionality - using bool format ***\n";
// Initialise all required variables
Test vfprintf() function : basic functionality - char format
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vfprintf() : basic functionality - using char format ***\n";
// Initialise all required variables
Test vfprintf() function : basic functionality - exponential format
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
-
echo "*** Testing vfprintf() : basic functionality - using exponential format ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vfprintf() : basic functionality - using unsigned format ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vfprintf() : basic functionality - using unsigned format ***\n";
// Initialise all required variables
Test vfprintf() function : basic functionality - octal format
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vfprintf() : basic functionality - using octal format ***\n";
// Initialise all required variables
Test vfprintf) function : basic functionality - hexadecimal format
--FILE--
<?php
-/* Prototype : int vfprintf ( resource $handle , string $format , array $args )
- * Description: Write a formatted string to a stream
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vfprintf) : basic functionality - using hexadecimal format ***\n";
// Initialising different format strings
precision=14
--FILE--
<?php
-/* Prototype : int vfprintf(resource stream, string format, array args)
- * Description: Output a formatted string into a stream
- * Source code: ext/standard/formatted_print.c
- * Alias to functions:
- */
-
// Open handle
$file = 'vfprintf_error1.txt';
$fp = fopen( $file, "a+" );
precision=14
--FILE--
<?php
-/* Prototype : int vfprintf(resource stream, string format, array args)
- * Description: Output a formatted string into a stream
- * Source code: ext/standard/formatted_print.c
- * Alias to functions:
- */
-
// Open handle
$file = 'vfprintf_error3.txt';
$fp = fopen( $file, "a+" );
precision=14
--FILE--
<?php
-/* Prototype : int vfprintf(resource stream, string format, array args)
- * Description: Output a formatted string into a stream
- * Source code: ext/standard/formatted_print.c
- * Alias to functions:
- */
-
// Open handle
$file = 'vfprintf_error4.txt';
$fp = fopen( $file, "a+" );
precision=14
--FILE--
<?php
-/* Prototype : int vfprintf(resource stream, string format, array args)
- * Description: Output a formatted string into a stream
- * Source code: ext/standard/formatted_print.c
- * Alias to functions:
- */
-
echo "*** Testing vfprintf() : variation functionality ***\n";
// Open handle
Test vprintf() function : basic functionality - string format
--FILE--
<?php
-/* Prototype : int vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : basic functionality - using string format ***\n";
// Initialise all required variables
Test vprintf() function : basic functionality - integer format
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Testing vprintf() : basic functionality - using integer format
*/
Test vprintf() function : basic functionality - float format
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : basic functionality - using float format ***\n";
// Initialise all required variables
Test vprintf() function : basic functionality - bool format
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : basic functionality - using bool format ***\n";
// Initialise all required variables
Test vprintf() function : basic functionality - char format
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : basic functionality - using char format ***\n";
// Initialise all required variables
Test vprintf() function : basic functionality - exponential format
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : basic functionality - using exponential format ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : basic functionality - using unsigned format ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : basic functionality - using unsigned format ***\n";
// Initialise all required variables
Test vprintf() function : basic functionality - octal format
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : basic functionality - using octal format ***\n";
// Initialise all required variables
Test vprintf() function : basic functionality - hexadecimal format
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : basic functionality - using hexadecimal format ***\n";
// Initialising different format strings
Test vprintf() function : usage variations - unexpected values for the format argument
--FILE--
<?php
-/* Prototype : string vprintf(string $format, array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different unexpected format strings are passed to
* the '$format' argument of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different octal formats and octal values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different octal formats and octal values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different octal formats and non-octal values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different octal formats and non-octal values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different hexa formats and hexa values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different hexa formats and hexa values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different hexa formats and non-hexa values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different hexa formats and non-hexa values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different unsigned formats and unsigned values
* are passed to the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different unsigned formats and unsigned values
* are passed to the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different unsigned formats and signed values and other types of values
* are passed to the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different unsigned formats and signed values and other types of values
* are passed to the '$format' and '$args' arguments of the function
Test vsprintf() function : usage variations - scientific formats with scientific values
--FILE--
<?php
-/* Prototype : string vsprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different scientific formats and scientific values
* are passed to the '$format' and '$args' arguments of the function
Test vprintf() function : usage variations - scientific formats with non-scientific values
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different scientific formats and non-scientific values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : with white spaces in format strings ***\n";
// initializing the format array
?>
--FILE--
<?php
-/* Prototype : string vprintf(string $format , array $args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vprintf() : with white spaces in format strings ***\n";
// initializing the format array
Test vprintf() function : usage variations - unexpected values for args argument
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different unexpected values are passed to
* the '$args' arguments of the function
Test vprintf() function : usage variations - int formats with int values
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different int formats and int values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different int formats and non-int values are passed to
* the '$format' and '$args' arguments of the function
?>
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different int formats and non-int values are passed to
* the '$format' and '$args' arguments of the function
Test vprintf() function : usage variations - float formats with float values
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different float formats and float values are passed to
* the '$format' and '$args' arguments of the function
Test vprintf() function : usage variations - float formats with non-float values
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Output a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different float formats and non-float values are passed to
* the '$format' and '$args' arguments of the function
Test vprintf() function : usage variations - string formats with non-string values
--FILE--
<?php
-/* Prototype : string vprintf(string format, array args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Test vprintf() when different string formats and non-string values are passed to
* the '$format' and '$args' arguments of the function
Test vsprintf() function : basic functionality - string format
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vsprintf() : basic functionality - using string format ***\n";
// Initialise all required variables
Test vsprintf() function : basic functionality - integer format
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
/*
* Testing vsprintf() : basic functionality - using integer format
*/
Test vsprintf() function : basic functionality - float format
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vsprintf() : basic functionality - using float format ***\n";
// Initialise all required variables
Test vsprintf() function : basic functionality - bool format
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vsprintf() : basic functionality - using bool format ***\n";
// Initialise all required variables
Test vsprintf() function : basic functionality - char format
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vsprintf() : basic functionality - using char format ***\n";
// Initialise all required variables
Test vsprintf() function : basic functionality - exponential format
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vsprintf() : basic functionality - using exponential format ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vsprintf() : basic functionality - using unsigned format ***\n";
// Initialise all required variables
?>
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vsprintf() : basic functionality - using unsigned format ***\n";
// Initialise all required variables
Test vsprintf() function : basic functionality - octal format
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vsprintf() : basic functionality - using octal format ***\n";
// Initialise all required variables
Test vsprintf() function : basic functionality - hexadecimal format
--FILE--
<?php
-/* Prototype : string vsprintf(string $format , array $args)
- * Description: Return a formatted string
- * Source code: ext/standard/formatted_print.c
-*/
-
echo "*** Testing vsprintf() : basic functionality - using hexadecimal format ***\n";
// Initialising different format strings
Test wordwrap() function : basic functionality
--FILE--
<?php
-/* Prototype : string wordwrap ( string $str [, int $width [, string $break [, bool $cut]]] )
- * Description: Wraps buffer to selected number of characters using string break char
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing wordwrap() : basic functionality ***\n";
// Initialize all required variables
Test wordwrap() function : error conditions
--FILE--
<?php
-/* Prototype : string wordwrap ( string $str [, int $width [, string $break [, bool $cut]]] )
- * Description: Wraps buffer to selected number of characters using string break char
- * Source code: ext/standard/string.c
-*/
-
echo "*** Testing wordwrap() : error conditions ***\n";
$str = 'testing wordwrap function';
Test wordwrap() function : usage variations - valid break arguments(spaces)
--FILE--
<?php
-/* Prototype : string wordwrap ( string $str [, int $width [, string $break [, bool $cut]]] )
- * Description: Wraps buffer to selected number of characters using string break char
- * Source code: ext/standard/string.c
-*/
-
/*
*test wordwrap() with break arguments as single spaces
*/
?>
--FILE--
<?php
-/* Prototype : array strptime ( string $date , string $format )
- * Description: Parse a time/date generated with strftime()
- * Source code: ext/standard/datetime.c
-*/
-
$orig = setlocale(LC_ALL, 'C');
date_default_timezone_set("GMT");
?>
--FILE--
<?php
-/* Prototype : array strptime ( string $date , string $format )
- * Description: Parse a time/date generated with strftime()
- * Source code: ext/standard/datetime.c
- * Alias to functions:
- */
-
//Set the default time zone
date_default_timezone_set("Europe/London");
?>
--FILE--
<?php
-/* Prototype : array strptime ( string $date , string $format )
- * Description: Parse a time/date generated with strftime()
- * Source code: ext/standard/datetime.c
-*/
-
$orig = setlocale(LC_ALL, 'C');
date_default_timezone_set("GMT");
putenv("TZ=GMT");
Test base64_decode() function : basic functionality - ensure all base64 alphabet is supported.
--FILE--
<?php
-/* Prototype : proto string base64_decode(string str[, bool strict])
- * Description: Decodes string using MIME base64 algorithm
- * Source code: ext/standard/base64.c
- * Alias to functions:
- */
-
echo "Decode an input string containing the whole base64 alphabet:\n";
$allbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/VV==";
var_dump(bin2hex(base64_decode($allbase64)));
Test base64_decode() function : basic functionality - strict vs non-strict with non-base64 chars.
--FILE--
<?php
-/* Prototype : proto string base64_decode(string str[, bool strict])
- * Description: Decodes string using MIME base64 algorithm
- * Source code: ext/standard/base64.c
- * Alias to functions:
- */
-
echo "Decode 'hello world!':\n";
$noWhiteSpace = "aGVsbG8gd29ybGQh";
var_dump(base64_decode($noWhiteSpace));
Test base64_decode() function : basic functionality - padding and whitespace
--FILE--
<?php
-/* Prototype : proto string base64_decode(string str[, bool strict])
- * Description: Decodes string using MIME base64 algorithm
- * Source code: ext/standard/base64.c
- * Alias to functions:
- */
-
echo "Test base64_decode (output as JSON):\n";
$data = [
"", "=", "==", "===", "====",
Test base64_encode() function : basic functionality
--FILE--
<?php
-/* Prototype : proto string base64_encode(string str)
- * Description: Encodes string using MIME base64 algorithm
- * Source code: ext/standard/base64.c
- * Alias to functions:
- */
-
/*
* Test base64_encode with single byte values.
*/
Test base64_encode() function : basic functionality - check algorithm round trips
--FILE--
<?php
-/* Prototype : proto string base64_encode(string str)
- * Description: Encodes string using MIME base64 algorithm
- * Source code: ext/standard/base64.c
- * Alias to functions:
- */
-
/*
* Test base64_encode with single byte values.
*/
Test parse_url() function: Parse a load of URLs without specifying the component
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* Parse a load of URLs without specifying the component
*/
Test parse_url() function: Parse a load of URLs without specifying PHP_URL_SCHEME as the URL component
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* Parse a load of URLs without specifying PHP_URL_SCHEME as the URL component
*/
Test parse_url() function: Parse a load of URLs without specifying PHP_URL_HOST as the URL component
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* Parse a load of URLs without specifying PHP_URL_HOST as the URL component
*/
Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PORT as the URL component
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* Parse a load of URLs without specifying PHP_URL_PORT as the URL component
*/
Test parse_url() function: Parse a load of URLs without specifying PHP_URL_USER as the URL component
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* Parse a load of URLs without specifying PHP_URL_USER as the URL component
*/
Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PASS as the URL component
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* Parse a load of URLs without specifying PHP_URL_PASS as the URL component
*/
Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PATH as the URL component
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* Parse a load of URLs without specifying PHP_URL_PATH as the URL component
*/
Test parse_url() function: Parse a load of URLs without specifying PHP_URL_QUERY as the URL component
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* Parse a load of URLs without specifying PHP_URL_QUERY as the URL component
*/
Test parse_url() function: Parse a load of URLs without specifying PHP_URL_FRAGMENT as the URL component
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* Parse a load of URLs without specifying PHP_URL_FRAGMENT as the URL component
*/
Test parse_url() function : check values of URL related constants
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
/*
* check values of URL related constants
*/
Test parse_url() function: url component specifier out of range
--FILE--
<?php
-/* Prototype : proto mixed parse_url(string url, [int url_component])
- * Description: Parse a URL and return its components
- * Source code: ext/standard/url.c
- * Alias to functions:
- */
-
echo "*** Testing parse_url() : error conditions: url component specifier out of range ***\n";
$url = 'http://secret:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123';
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description : splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
echo "*** Testing token_get_all() : basic functionality ***\n";
// with php open/close tags
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Using different types of constants in 'source' string to check them for token
* integer const - T_LNUMBER(305)
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Using different control structure keywords
* if..else, elseif - T_IF(301), T_ELSEIF(302), T_ELSE(303)
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Testing token_get_all() with following predefined language constants:
* __FILE__ - T_FILE
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Testing token_get_all() with different class/object keywords
* scope related :
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Testing token_get_all() with 'source' string containing invalid/unknown token value
* unknown tokens - T_UNKNOWN(307)
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Testing token_get_all() with heredoc 'source' string with all different types of token and heredoc string within
* <<<EOT - T_START_HEREDOC(371)
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Testing token_get_all() with different function keywords
* function - T_FUNCTION(333), return - T_RETURN(335)
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Testing token_get_all() with different exception keywords
* try - T_TRY(336),
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Testing token_get_all() with source string containing HTML code with PHP
* HTML tags are considered to be T_INLINE_HTML(311)
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Passing 'source' argument with different arithmetic operators to test them for token
* Arithmetic operators: +, -, *, /, % are not listed as specific operator tokens,
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Passing 'source' argument with different logical operators to test them for tokens
* and - T_AND_LOGICAL_AND(265),
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Passing 'source' argument with different comparison operators to test them for tokens
* == - T_IS_EQUAL(283), === - T_IS_IDENTICAL(281),
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Passing 'source' argument with different assignment operators to test them for tokens
* += - T_PLUS_EQUAL(277), -= - T_MINUS-EQUAL(276),
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Passing 'source' argument with different bitwise operators to test them for token
* << - T_SL(287)
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Passing 'source' argument with different increment/decrement operators to test them for token
* ++ - T_INC(297)
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Passing 'source' argument with different type casting operators to test them for token
* (int)/(integer) - T_INT_CAST(295), (float)/(real)/(double) - T_DOUBLE_CAST(294),
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
-/* Prototype : array token_get_all(string $source)
- * Description: splits the given source into an array of PHP language tokens
- * Source code: ext/tokenizer/tokenizer.c
-*/
-
/*
* Passing 'source' argument with different style of comments
*/
?>
--FILE--
<?php
-/* Prototype : proto int xml_parse_into_struct(resource parser, string data, array &struct, array &index)
- * Description: Parsing a XML document
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
echo "*** Testing xml_parse_into_struct() : variation ***\n";
$simple = "<main><para><note>simple note</note></para><para><note>simple note</note></para></main>";
?>
--FILE--
<?php
-/* Prototype : proto bool xml_set_notation_decl_handler ( resource $parser , callback $handler )
- * Description: Sets the notation declaration handler function for the XML parser.
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
echo "Simple testcase for xml_parser_get_option() function\n";
$parser = xml_parser_create_ns();
?>
--FILE--
<?php
-/* Prototype : proto int xml_parser_set_option(resource parser, int option, mixed value)
- * Description: Set options in an XML parser
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
echo "*** Testing xml_parser_set_option() : usage variations ***\n";
class aClass {
?>
--FILE--
<?php
-/* Prototype : proto bool xml_set_notation_decl_handler ( resource $parser , callback $handler )
- * Description: Sets the notation declaration handler function for the XML parser.
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
class XML_Parser
{
?>
--FILE--
<?php
-/* Prototype : proto bool xml_set_processing_instruction_handler ( resource $parser , callback $handler )
- * Description: Sets the processing instruction (PI) handler function for the XML parser.
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
class XML_Parser
{
?>
--FILE--
<?php
-/* Prototype : bool xml_set_start_namespace_decl_handler ( resource $parser , callback $handler )
- * Description: Set up start namespace declaration handler.
- * Source code: ext/xml/xml.c
- * Alias to functions:
- */
-
$xml = <<<HERE
<aw1:book xmlns:aw1="http://www.somewhere.com/namespace1"
xmlns:aw2="file:/DTD/somewhere.dtd">
?>
--FILE--
<?php
-/* Prototype : string gzcompress(string data [, int level, [int encoding]])
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
/*
* add a comment here to say what the test is supposed to do
*/
?>
--FILE--
<?php
-/* Prototype : string gzcompress(string data [, int level, [int encoding]])
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
/*
* add a comment here to say what the test is supposed to do
*/
?>
--FILE--
<?php
-/* Prototype : string gzcompress(string data [, int level, [int encoding]])
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
include(__DIR__ . '/data.inc');
echo "*** Testing gzcompress() : variation ***\n";
?>
--FILE--
<?php
-/* Prototype : string gzdeflate(string data [, int level, [int encoding]])
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
/*
* add a comment here to say what the test is supposed to do
*/
?>
--FILE--
<?php
-/* Prototype : string gzdeflate(string data [, int level, [int encoding]])
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
/*
* add a comment here to say what the test is supposed to do
*/
?>
--FILE--
<?php
-/* Prototype : string gzdeflate(string data [, int level])
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
include(__DIR__ . '/data.inc');
echo "*** Testing gzdeflate() : variation ***\n";
?>
--FILE--
<?php
-/* Prototype : string gzencode ( string $data [, int $level [, int $encoding_mode ]] )
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
/*
* Test basic function of gzencode
*/
?>
--FILE--
<?php
-/* Prototype : string gzencode ( string $data [, int $level [, int $encoding_mode ]] )
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
/*
* Test error cases for gzencode
*/
?>
--FILE--
<?php
-/* Prototype : string gzencode ( string $data [, int $level [, int $encoding_mode ]] )
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
if(!function_exists("gzdecode")) {
function gzdecode($data)
{
?>
--FILE--
<?php
-/* Prototype : string gzencode ( string $data [, int $level [, int $encoding_mode ]] )
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
include(__DIR__ . '/data.inc');
echo "*** Testing gzencode() : variation ***\n";
?>
--FILE--
<?php
-/* Prototype : string gzencode ( string $data [, int $level [, int $encoding_mode ]] )
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
echo "*** Testing gzencode() : variation ***\n";
$data = "A small string to encode\n";
?>
--FILE--
<?php
-/* Prototype : string gzencode ( string $data [, int $level [, int $encoding_mode ]] )
- * Description: Gzip-compress a string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
echo "*** Testing gzencode() : variation ***\n";
$data = "A small string to encode\n";
?>
--FILE--
<?php
-/* Prototype : string gzinflate(string data [, int length])
- * Description: Unzip a gzip-compressed string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
include(__DIR__ . '/data.inc');
echo "*** Testing gzinflate() : error conditions ***\n";
?>
--FILE--
<?php
-/* Prototype : resource gzopen(string filename, string mode [, int use_include_path])
- * Description: Open a .gz-file and return a .gz-file pointer
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
echo "*** Testing gzopen() : basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype : resource gzopen(string filename, string mode [, int use_include_path])
- * Description: Open a .gz-file and return a .gz-file pointer
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
echo "*** Testing gzopen() : basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype : resource gzopen(string filename, string mode [, int use_include_path])
- * Description: Open a .gz-file and return a .gz-file pointer
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
echo "*** Testing gzopen() : usage variation ***\n";
$testName = 'gzopen_variation4';
?>
--FILE--
<?php
-/* Prototype : resource gzopen(string filename, string mode [, int use_include_path])
- * Description: Open a .gz-file and return a .gz-file pointer
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
require_once('gzopen_include_path.inc');
echo "*** Testing gzopen() : variation ***\n";
?>
--FILE--
<?php
-/* Prototype : resource gzopen(string filename, string mode [, int use_include_path])
- * Description: Open a .gz-file and return a .gz-file pointer
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
echo "*** Testing gzopen() : variation ***\n";
$absfile = __FILE__.'.tmp';
$relfile = "gzopen_variation6.tmp";
?>
--FILE--
<?php
-/* Prototype : resource gzopen(string filename, string mode [, int use_include_path])
- * Description: Open a .gz-file and return a .gz-file pointer
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
echo "*** Testing gzopen() : variation ***\n";
$data = <<<EOT
?>
--FILE--
<?php
-/* Prototype : resource gzopen(string filename, string mode [, int use_include_path])
- * Description: Open a .gz-file and return a .gz-file pointer
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
echo "*** Testing gzopen() : variation ***\n";
$modes = array('r+', 'rf', 'w+' , 'e');
?>
--FILE--
<?php
-/* Prototype : string gzuncompress(string data [, int length])
- * Description: Unzip a gzip-compressed string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
include(__DIR__ . '/data.inc');
echo "*** Testing gzuncompress() : basic functionality ***\n";
?>
--FILE--
<?php
-/* Prototype : string gzuncompress(string data [, int length])
- * Description: Unzip a gzip-compressed string
- * Source code: ext/zlib/zlib.c
- * Alias to functions:
- */
-
echo "*** Testing gzuncompress() : error conditions ***\n";
echo "\n-- Testing with a buffer that is too small --\n";
--FILE--
<?php
/*
- * proto void flush(void)
* Function is implemented in ext/standard/basic_functions.c.
*/
Test ob_clean() function : basic functionality
--FILE--
<?php
-/* Prototype : proto bool ob_clean(void)
- * Description: Clean (delete) the current output buffer
- * Source code: main/output.c
- * Alias to functions:
- */
-
echo "*** Testing ob_clean() : basic functionality ***\n";
// Zero arguments
-- Testing ob_clean() function with Zero arguments --
-Notice: ob_clean(): Failed to delete buffer. No buffer to delete in %s on line 12
+Notice: ob_clean(): Failed to delete buffer. No buffer to delete in %s on line %d
bool(false)
string(61) "bool(true)
Ensure the buffer is still active after the clean."
--FILE--
<?php
/*
- * proto bool ob_end_clean(void)
* Function is implemented in main/output.c
*/
?>
--EXPECTF--
-Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in %s on line 7
+Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in %s on line %d
bool(false)
bool(true)
bool(true)
-Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in %s on line 16
+Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in %s on line %d
bool(false)
Test ob_end_flush() function : basic functionality
--FILE--
<?php
-/* Prototype : proto bool ob_end_flush(void)
- * Description: Flush (send) the output buffer, and delete current output buffer
- * Source code: main/output.c
- * Alias to functions:
- */
-
echo "*** Testing ob_end_flush() : basic functionality ***\n";
// Zero arguments
-- Testing ob_end_flush() function with Zero arguments --
-Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %s on line 12
+Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %s on line %d
bool(false)
bool(true)
Hello
bool(true)
-Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %s on line 21
+Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %s on line %d
bool(false)
Done
Test ob_flush() function : basic functionality
--FILE--
<?php
-/* Prototype : proto bool ob_flush(void)
- * Description: Flush (send) contents of the output buffer. The last buffer content is sent to next buffer
- * Source code: main/output.c
- * Alias to functions:
- */
-
echo "*** Testing ob_flush() : basic functionality ***\n";
// Zero arguments
-- Testing ob_flush() function with Zero arguments --
-Notice: ob_flush(): Failed to flush buffer. No buffer to flush in %s on line 12
+Notice: ob_flush(): Failed to flush buffer. No buffer to flush in %s on line %d
bool(false)
This should get flushed.
bool(true)
--FILE--
<?php
/*
- * proto bool ob_get_clean(void)
* Function is implemented in main/output.c
*/
--FILE--
<?php
/*
- * proto bool ob_get_clean(void)
* Function is implemented in main/output.c
*/
Iain Lewis <ilewis@php.net>
--FILE--
<?php
-/* Prototype : proto string ob_get_contents(void)
- * Description: Return the contents of the output buffer
- * Source code: main/output.c
- * Alias to functions:
- */
-
-
echo "*** Testing ob_get_contents() : basic functionality ***\n";
// Zero arguments
--FILE--
<?php
/*
- * proto int ob_get_length(void)
* Function is implemented in main/output.c
*/
Test ob_get_level() function : basic functionality
--FILE--
<?php
-/* Prototype : proto int ob_get_level(void)
- * Description: Return the nesting level of the output buffer
- * Source code: main/output.c
- * Alias to functions:
- */
-
echo "*** Testing ob_get_level() : basic functionality ***\n";
// Zero arguments
int(1)
int(0)
-Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %s on line 26
+Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %s on line %d
int(0)
Done
Test ob_implicit_flush() function : check return value (always null).
--FILE--
<?php
-/* Prototype : proto void ob_implicit_flush([int flag])
- * Description: Turn implicit flush on/off and is equivalent to calling flush() after every output call
- * Source code: main/output.c
- * Alias to functions:
- */
-
echo "*** Testing ob_implicit_flush() : check return value ***\n";
var_dump(ob_implicit_flush());
Test ob_implicit_flush() function : ensure implicit flushing does not apply to user buffers.
--FILE--
<?php
-/* Prototype : proto void ob_implicit_flush([int flag])
- * Description: Turn implicit flush on/off and is equivalent to calling flush() after every output call
- * Source code: main/output.c
- * Alias to functions:
- */
-
echo "*** Testing ob_implicit_flush() : ensure implicit flushing does not apply to user buffers. ***\n";
// Start a user buffer
--FILE--
<?php
/*
- * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
--FILE--
<?php
/*
- * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
// In HEAD, $chunk_size value of 1 should not have any special behaviour (http://marc.info/?l=php-internals&m=123476465621346&w=2).
--FILE--
<?php
/*
- * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
--FILE--
<?php
/*
- * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
checkAndClean();
?>
--EXPECTF--
- ---> Test arrays:
+---> Test arrays:
-Warning: ob_start(): array must have exactly two members in %s on line 44
+Warning: ob_start(): array must have exactly two members in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 44
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
Array
(
)
-Warning: ob_start(): class 'f' not found in %s on line 47
+Warning: ob_start(): class 'f' not found in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 47
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
Array
(
)
-Warning: ob_start(): array must have exactly two members in %s on line 50
+Warning: ob_start(): array must have exactly two members in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 50
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
Array
(
)
-Warning: ob_start(): array must have exactly two members in %s on line 53
+Warning: ob_start(): array must have exactly two members in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 53
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
Array
(
)
-Warning: ob_start(): array must have exactly two members in %s on line 56
+Warning: ob_start(): array must have exactly two members in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 56
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
Array
(
)
-Warning: ob_start(): array must have exactly two members in %s on line 68
+Warning: ob_start(): array must have exactly two members in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 68
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
Array
(
--FILE--
<?php
/*
- * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
--EXPECTF--
Arg 1 wrong type
-Warning: ob_start(): no array or string given in %s on line 17
+Warning: ob_start(): no array or string given in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 17
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
--FILE--
<?php
/*
- * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
echo "done"
?>
--EXPECTF--
-Warning: ob_start(): class 'nonExistent' not found in %s on line 13
+Warning: ob_start(): class 'nonExistent' not found in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 13
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
-Warning: ob_start(): class 'C' does not have a method 'nonExistent' in %s on line 14
+Warning: ob_start(): class 'C' does not have a method 'nonExistent' in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 14
+Notice: ob_start(): Failed to create buffer in %s on line 13
bool(false)
-Warning: ob_start(): class 'C' does not have a method 'no' in %s on line 15
+Warning: ob_start(): class 'C' does not have a method 'no' in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 15
+Notice: ob_start(): Failed to create buffer in %s on line 14
bool(false)
-Warning: ob_start(): function 'no' not found or invalid function name in %s on line 16
+Warning: ob_start(): function 'no' not found or invalid function name in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 16
+Notice: ob_start(): Failed to create buffer in %s on line 15
bool(false)
done
--FILE--
<?php
/*
- * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
--EXPECTF--
Warning: ob_start(): array must have exactly two members in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 11
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
done
--FILE--
<?php
/*
- * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
--EXPECTF--
Warning: ob_start(): class 'C' does not have a method 'f' in %s on line %d
-Notice: ob_start(): Failed to create buffer in %s on line 11
+Notice: ob_start(): Failed to create buffer in %s on line %d
bool(false)
done
<?php
/*
- * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
* Function is implemented in main/output.c
*/
echo "done";
?>
--EXPECTF--
-Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line 9
+Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line %d