Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion Zend/tests/001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var_dump(func_num_args());

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
int(0)
int(1)
Exception: Too few arguments to function test2(), 0 passed in %s001.php on line 18 and exactly 1 expected
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var_dump(func_get_arg(1));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
bool(false)

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var_dump(func_get_args());

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
array(0) {
}
array(1) {
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var_dump(strncmp("qwerty", "qwerty123", 7));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: strncmp() expects exactly 3 parameters, 2 given in %s on line %d
NULL
int(0)
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/005.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var_dump(strcasecmp("01", "01"));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: strcasecmp() expects exactly 2 parameters, 1 given in %s on line %d
NULL
int(0)
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/006.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var_dump(strncasecmp("01", "01", 1000));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: strncasecmp() expects exactly 3 parameters, 1 given in %s on line %d
NULL

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/007.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var_dump(each($a));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: each() expects exactly 1 parameter, 0 given in %s on line %d
NULL

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var_dump(constant("test const"));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: define() expects at least 2 parameters, 0 given in %s on line %d
NULL

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/009.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $f1->testNull();

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Deprecated: Non-static method foo::bar() should not be called statically in %s on line %d
string(3) "foo"

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/010.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var_dump(get_parent_class(1));

echo "Done\n";
?>
--EXPECT--
--EXPECT--
bool(false)
bool(false)
string(3) "foo"
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/011.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ $bar->test();

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: property_exists() expects exactly 2 parameters, 0 given in %s on line %d
NULL

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/012.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var_dump(class_exists("stdClass"));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: class_exists() expects at least 1 parameter, 0 given in %s on line %d
NULL
bool(false)
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/013.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var_dump(interface_exists("stdClass"));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: interface_exists() expects at least 1 parameter, 0 given in %s on line %d
NULL
bool(false)
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/014.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var_dump(get_included_files());

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
array(1) {
[0]=>
string(%d) "%s"
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/015.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var_dump(trigger_error("error", E_USER_DEPRECATED));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: trigger_error() expects at least 1 parameter, 0 given in %s on line %d
NULL

Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/016.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ isset() with object properties when operating on non-object
--FILE--
<?php

$foo = NULL;
$foo = NULL;
isset($foo->bar->bar);

echo "Done\n";
?>
--EXPECT--
--EXPECT--
Done
2 changes: 1 addition & 1 deletion Zend/tests/017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var_dump(count(get_extension_funcs("zend")));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: get_resource_type() expects exactly 1 parameter, 0 given in %s on line %d
NULL

Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/018.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var_dump(constant("TEST_CONST2"));

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: constant() expects exactly 1 parameter, 0 given in %s on line %d
NULL

Expand Down
68 changes: 34 additions & 34 deletions Zend/tests/019.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo "*** Testing unset(), empty() & isset() with scalar variables ***\n";

// testing scalar variables
$scalar_variables = array(
0,
0,
1,
+1
-1,
Expand Down Expand Up @@ -52,23 +52,23 @@ foreach ($scalar_variables as $scalar_var) {
echo "-- Iteration $loop_counter --\n"; $loop_counter++;

// checking with isset before unsetting, expected: bool(true)
var_dump( isset($scalar_var) );
var_dump( isset($scalar_var, $set_var) );
var_dump( isset($scalar_var) );
var_dump( isset($scalar_var, $set_var) );
// checking if the var is empty, expected: bool(false) on most
// except "", 0, "0", NULL, FALSE
var_dump( empty($scalar_var) );
var_dump( empty($scalar_var) );

// destroy the variable using unset
unset( $scalar_var );
unset( $scalar_var );
// dump and see if its destroyed, expcted: NULL
var_dump( $scalar_var );
var_dump( $scalar_var );

// check using isset to see if unset, expected: bool(false)
var_dump( isset($scalar_var) );
var_dump( isset($scalar_var, $set_var) );
var_dump( isset($scalar_var) );
var_dump( isset($scalar_var, $set_var) );

// empty to check if empty, expecting bool(true)
var_dump( empty($scalar_var) );
var_dump( empty($scalar_var) );

// isset() with two args, one arg only unset, expected: bool(false)
var_dump( isset($scalar_var, $set_var) );
Expand All @@ -90,16 +90,16 @@ $array_variables = array(
array(1 => "One", 2 => "two"),
array("Name" => "Jack", "Age" => "30"),
array(1,2, "One" => "1", 2 => "two", ""=>"empty", "" => '')
);
);

$outer_loop_counter = 1;
foreach ($array_variables as $array_var) {
echo "--- Outerloop Iteration $outer_loop_counter ---\n";

// check the isset and unset on non existing key
$var = 1; // a var which is defined
// try to unset the element which is non-existent
unset($array_var['non_existent']);
unset($array_var['non_existent']);
// check using isset() & empty() on a non_existent element in the array
var_dump( isset($array_var['non_existent']) );
var_dump( isset($array_var['non_existent'], $var) );
Expand All @@ -115,19 +115,19 @@ foreach ($array_variables as $array_var) {
// unset each element in the array and see the working of unset, isset & empty
$inner_loop_counter = 1;
foreach ($keys as $key_value) {
echo "-- Innerloop Iteration $inner_loop_counter of Outerloop Iteration $outer_loop_counter --\n";
echo "-- Innerloop Iteration $inner_loop_counter of Outerloop Iteration $outer_loop_counter --\n";
$inner_loop_counter++;

// unset the element
unset($array_var[$key_value]);
unset($array_var[$key_value]);
// dump the array after element was unset
var_dump($array_var);
// check using isset for the element that was unset
var_dump( isset($array_var[$key_val]) ); // expected: bool(false)
// calling isset with more args
var_dump( isset($array_var[$key_val], $array_var) ); //expected: bool(false)

// calling empty, expected bool(true)
// calling empty, expected bool(true)
var_dump( empty($array_var[$key_val]) );

// dump the array to see that that array did not get modified
Expand All @@ -144,7 +144,7 @@ foreach ($array_variables as $array_var) {
// use isset to see that array is not set
var_dump( isset($array_var) ); //expected: bool(false)
var_dump( isset($array_var, $array_var[$key_val]) ); // expected: bool(false)

// empty() to see if the array is empty
var_dump( empty($array_var) ); // expected: bool(true)
}
Expand Down Expand Up @@ -183,7 +183,7 @@ foreach ($resources as $resource) {
unset($temp_var);
// now the isset() with both the args as unset
var_dump( isset($resource, $temp_var) ); // expected: bool(false);

// dump the resource to see if there any effect on it
var_dump($resource);
}
Expand All @@ -200,12 +200,12 @@ class Point
var $x;
var $y;
var $lable;

function __construct($x, $y) {
$this->x = $x;
$this->y = $y;
}

function setLable($lable) {
$this->lable = $lable;
}
Expand Down Expand Up @@ -281,25 +281,25 @@ echo "\n*** Testing possible variation in operation for isset(), empty() & unset
echo "\n** Testing unset() variation 1: unset on static variable inside a function **\n";
function test_unset1() {
static $static_var;

// increment the value of the static. this change is in function context
$static_var ++;
echo "value of static_var before unset: $static_var\n";

echo "value of static_var before unset: $static_var\n";
// check using isset and empty
var_dump( isset($static_var) );
var_dump( empty($static_var) );

// unset the static var
unset($static_var);
echo "value of static_var after unset: $static_var\n";
echo "value of static_var after unset: $static_var\n";
// check using isset and empty
var_dump( isset($static_var) );
var_dump( empty($static_var) );

// assign a value to static var
$static_var = 20;
echo "value of static_var after new assignment: $static_var\n";
echo "value of static_var after new assignment: $static_var\n";
}
// call the functiont
test_unset1();
Expand Down Expand Up @@ -329,7 +329,7 @@ var_dump($value);
test_unset2($value);
var_dump($value);


echo "\n** Testing unset() variation 3: unset on a global variable inside of a function **\n";
/* unset() variation2: unset on a global variable inside a function
* If a globalized variable is unset() inside of a function, only the
Expand All @@ -340,17 +340,17 @@ $global_var = 10;

function test_unset3() {
global $global_var;

// check the $global_var using isset and empty
var_dump( isset($global_var) );
var_dump( empty($global_var) );
var_dump( isset($global_var) );
var_dump( empty($global_var) );

// unset the global var
unset($global_var);

// check the $global_var using isset and empty
var_dump( isset($global_var) );
var_dump( empty($global_var) );
var_dump( isset($global_var) );
var_dump( empty($global_var) );
}

var_dump($global_var);
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/020.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ foo(1,2);

echo "Done\n";
?>
--EXPECTF--
--EXPECTF--
Warning: func_get_arg() expects exactly 1 parameter, 3 given in %s on line %d
NULL

Expand Down
8 changes: 4 additions & 4 deletions Zend/tests/030.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ class foo {
public $test = 0;
private $test_2 = 1;
protected $test_3 = 2;

public function bar() {
try {
throw new Exception('foo');
} catch (Exception $this) {
var_dump($this);
}

$this->baz();
$this->baz();
}

public function baz() {
foreach ($this as $k => $v) {
printf("'%s' => '%s'\n", $k, $v);
}
}
print "ok\n";
}
}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/031.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Testing array with '[]' passed as argument by value
--FILE--
<?php
<?php

function test($var) { }
test($arr[]);
Expand Down
Loading