summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/bug38469.phpt26
-rwxr-xr-xZend/tests/bug42802.phpt19
-rwxr-xr-xZend/tests/bug42819.phpt150
-rwxr-xr-xZend/tests/bug42820.phpt20
-rwxr-xr-xZend/tests/bug42859.phpt6
-rwxr-xr-xZend/tests/bug43128.phpt2
-rwxr-xr-xZend/tests/bug43183.phpt4
-rw-r--r--Zend/tests/bug43332_1.phpt4
-rw-r--r--Zend/tests/bug43332_2.phpt4
-rw-r--r--Zend/tests/bug43343.phpt2
-rw-r--r--Zend/tests/bug43344_10.phpt2
-rw-r--r--Zend/tests/bug43344_11.phpt2
-rw-r--r--Zend/tests/bug43344_12.phpt2
-rw-r--r--Zend/tests/bug43344_13.phpt2
-rw-r--r--Zend/tests/bug43344_2.phpt2
-rw-r--r--Zend/tests/bug43344_3.phpt2
-rw-r--r--Zend/tests/bug43344_4.phpt2
-rw-r--r--Zend/tests/bug43344_5.phpt2
-rw-r--r--Zend/tests/bug43344_6.phpt4
-rw-r--r--Zend/tests/bug43344_7.phpt4
-rw-r--r--Zend/tests/bug43344_8.phpt4
-rw-r--r--Zend/tests/bug43344_9.phpt4
-rw-r--r--Zend/tests/bug43651.phpt26
-rw-r--r--Zend/tests/bug44653.phpt14
-rw-r--r--Zend/tests/class_alias_012.phpt16
-rw-r--r--Zend/tests/class_alias_013.phpt14
-rw-r--r--Zend/tests/class_alias_015.phpt6
-rw-r--r--Zend/tests/class_alias_016.phpt8
-rw-r--r--Zend/tests/class_alias_019.phpt4
-rw-r--r--Zend/tests/class_alias_020.phpt16
-rw-r--r--Zend/tests/class_alias_021.phpt14
-rw-r--r--Zend/tests/class_constants_004.phpt12
-rw-r--r--Zend/tests/class_exists_001.phpt8
-rw-r--r--Zend/tests/closure_027.phpt2
-rw-r--r--Zend/tests/constants_003.phpt2
-rw-r--r--Zend/tests/constants_004.phpt2
-rw-r--r--Zend/tests/constants_006.phpt4
-rw-r--r--Zend/tests/constants_009.phpt8
-rw-r--r--Zend/tests/hex_overflow_32bit.phpt2
-rw-r--r--Zend/tests/inter_02.phpt2
-rw-r--r--Zend/tests/interface_exists_002.phpt4
-rw-r--r--Zend/tests/lsb_014.phpt4
-rwxr-xr-xZend/tests/ns_001.phpt18
-rwxr-xr-xZend/tests/ns_002.phpt24
-rwxr-xr-xZend/tests/ns_003.phpt4
-rwxr-xr-xZend/tests/ns_004.phpt8
-rwxr-xr-xZend/tests/ns_005.phpt4
-rwxr-xr-xZend/tests/ns_006.phpt6
-rwxr-xr-xZend/tests/ns_007.phpt2
-rwxr-xr-xZend/tests/ns_008.phpt4
-rwxr-xr-xZend/tests/ns_009.phpt2
-rwxr-xr-xZend/tests/ns_010.phpt24
-rwxr-xr-xZend/tests/ns_011.phpt14
-rwxr-xr-xZend/tests/ns_012.phpt32
-rwxr-xr-xZend/tests/ns_013.phpt4
-rwxr-xr-xZend/tests/ns_014.phpt2
-rwxr-xr-xZend/tests/ns_015.phpt4
-rwxr-xr-xZend/tests/ns_016.phpt6
-rwxr-xr-xZend/tests/ns_017.phpt2
-rwxr-xr-xZend/tests/ns_018.phpt4
-rwxr-xr-xZend/tests/ns_019.phpt2
-rwxr-xr-xZend/tests/ns_020.phpt14
-rwxr-xr-xZend/tests/ns_021.phpt10
-rwxr-xr-xZend/tests/ns_022.phpt10
-rwxr-xr-xZend/tests/ns_023.phpt6
-rwxr-xr-xZend/tests/ns_025.phpt14
-rwxr-xr-xZend/tests/ns_026.phpt23
-rwxr-xr-xZend/tests/ns_027.inc2
-rwxr-xr-xZend/tests/ns_027.phpt8
-rwxr-xr-xZend/tests/ns_028.phpt16
-rwxr-xr-xZend/tests/ns_029.phpt2
-rwxr-xr-xZend/tests/ns_030.phpt4
-rwxr-xr-xZend/tests/ns_031.phpt8
-rwxr-xr-xZend/tests/ns_032.phpt4
-rwxr-xr-xZend/tests/ns_034.phpt15
-rwxr-xr-xZend/tests/ns_035.phpt6
-rwxr-xr-xZend/tests/ns_036.phpt19
-rwxr-xr-xZend/tests/ns_037.phpt24
-rwxr-xr-xZend/tests/ns_038.phpt4
-rw-r--r--Zend/tests/ns_040.phpt12
-rw-r--r--Zend/tests/ns_041.phpt6
-rw-r--r--Zend/tests/ns_042.phpt12
-rw-r--r--Zend/tests/ns_043.phpt2
-rw-r--r--Zend/tests/ns_044.phpt2
-rw-r--r--Zend/tests/ns_045.phpt4
-rw-r--r--Zend/tests/ns_046.phpt4
-rw-r--r--Zend/tests/ns_047.phpt2
-rw-r--r--Zend/tests/ns_048.phpt4
-rw-r--r--Zend/tests/ns_049.phpt2
-rw-r--r--Zend/tests/ns_050.phpt2
-rw-r--r--Zend/tests/ns_051.phpt2
-rw-r--r--Zend/tests/ns_052.phpt4
-rw-r--r--Zend/tests/ns_053.phpt6
-rwxr-xr-xZend/tests/ns_054.phpt12
-rwxr-xr-xZend/tests/ns_055.phpt13
-rwxr-xr-xZend/tests/ns_056.phpt7
-rwxr-xr-xZend/tests/ns_057.phpt33
-rwxr-xr-xZend/tests/ns_058.phpt31
-rw-r--r--Zend/tests/ns_060.phpt12
-rw-r--r--Zend/tests/ns_061.phpt2
-rw-r--r--Zend/tests/ns_062.phpt6
-rw-r--r--Zend/tests/ns_064.phpt2
-rwxr-xr-xZend/tests/ns_065.inc4
-rwxr-xr-xZend/tests/ns_065.phpt10
-rw-r--r--Zend/tests/ns_066.phpt4
-rw-r--r--Zend/tests/ns_067.inc2
-rw-r--r--Zend/tests/ns_067.phpt2
-rw-r--r--Zend/tests/zend_strtod.phpt2
108 files changed, 487 insertions, 511 deletions
diff --git a/Zend/tests/bug38469.phpt b/Zend/tests/bug38469.phpt
index 6afcaf5fd3..db507df357 100644
--- a/Zend/tests/bug38469.phpt
+++ b/Zend/tests/bug38469.phpt
@@ -8,16 +8,6 @@ var_dump($a);
$b = array(array());
$b[0][0] = $b;
var_dump($b);
-
-function f() {
- $a = array();
- $a[0] = $a;
- var_dump($a);
- $b = array(array());
- $b[0][0] = $b;
- var_dump($b);
-}
-f();
?>
--EXPECT--
array(1) {
@@ -36,19 +26,3 @@ array(1) {
}
}
}
-array(1) {
- [0]=>
- array(0) {
- }
-}
-array(1) {
- [0]=>
- array(1) {
- [0]=>
- array(1) {
- [0]=>
- array(0) {
- }
- }
- }
-}
diff --git a/Zend/tests/bug42802.phpt b/Zend/tests/bug42802.phpt
index 2aa7061f35..80ae02ba5e 100755
--- a/Zend/tests/bug42802.phpt
+++ b/Zend/tests/bug42802.phpt
@@ -11,30 +11,35 @@ function test1(bar $bar) {
echo "ok\n";
}
-function test2(\foo\bar $bar) {
+function test2(foo::bar $bar) {
echo "ok\n";
}
-function test3(\foo\bar $bar) {
+function test3(::foo::bar $bar) {
echo "ok\n";
}
-function test4(\Exception $e) {
+function test4(::Exception $e) {
echo "ok\n";
}
-function test5(\bar $bar) {
+function test5(Exception $e) {
+ echo "ok\n";
+}
+function test6(::bar $bar) {
echo "bug\n";
}
$x = new bar();
-$y = new \Exception();
+$y = new Exception();
test1($x);
test2($x);
test3($x);
test4($y);
-test5($x);
+test5($y);
+test6($x);
--EXPECTF--
ok
ok
ok
ok
+ok
-Catchable fatal error: Argument 1 passed to foo\test5() must be an instance of bar, instance of foo\bar given, called in %sbug42802.php on line %d and defined in %sbug42802.php on line %d
+Catchable fatal error: Argument 1 passed to foo::test6() must be an instance of bar, instance of foo::bar given, called in %sbug42802.php on line 23
diff --git a/Zend/tests/bug42819.phpt b/Zend/tests/bug42819.phpt
index f4387eb93b..565a019fac 100755
--- a/Zend/tests/bug42819.phpt
+++ b/Zend/tests/bug42819.phpt
@@ -4,100 +4,88 @@ Bug #42819 (namespaces in indexes of constant arrays)
<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
<?php
-namespace foo\foo;
-
-const C = "foo\\foo\\C\n";
-const I = 12;
-
-class foo {
-const I = 32;
-const C = "foo\\foo\\foo::C\n";
-}
-
namespace foo;
-use \ArrayObject;
-const C = "foo\\C\n";
+const C = "foo::C\n";
const I = 11;
class foo {
- const C = "foo\\foo::C\n";
+ const C = "foo::foo::C\n";
const I = 22;
const C1 = C;
- const C2 = foo\C;
- const C3 = foo\foo::C;
- const C4 = \foo\C;
- const C5 = \foo\foo::C;
+ const C2 = foo::C;
+ const C3 = foo::foo::C;
+ const C4 = ::foo::C;
+ const C5 = ::foo::foo::C;
const C6 = ArrayObject::STD_PROP_LIST;
const C7 = E_ERROR;
}
class bar1 {
static $a1 = array(I => 0);
- static $a2 = array(foo\I => 0);
- static $a3 = array(foo\foo::I => 0);
- static $a4 = array(\foo\I => 0);
- static $a5 = array(\foo\foo::I => 0);
+ static $a2 = array(foo::I => 0);
+ static $a3 = array(foo::foo::I => 0);
+ static $a4 = array(::foo::I => 0);
+ static $a5 = array(::foo::foo::I => 0);
static $a6 = array(ArrayObject::STD_PROP_LIST => 0);
static $a7 = array(E_ERROR => 0);
}
class bar2 {
static $a1 = array(I => I);
- static $a2 = array(foo\I => I);
- static $a3 = array(foo\foo::I => I);
- static $a4 = array(\foo\I => I);
- static $a5 = array(\foo\foo::I => I);
+ static $a2 = array(foo::I => I);
+ static $a3 = array(foo::foo::I => I);
+ static $a4 = array(::foo::I => I);
+ static $a5 = array(::foo::foo::I => I);
static $a6 = array(ArrayObject::STD_PROP_LIST => I);
static $a7 = array(E_ERROR => I);
}
class bar3 {
- static $a1 = array(I => foo\I);
- static $a2 = array(foo\I => foo\I);
- static $a3 = array(foo\foo::I => foo\I);
- static $a4 = array(\foo\I => foo\I);
- static $a5 = array(\foo\foo::I => foo\I);
- static $a6 = array(ArrayObject::STD_PROP_LIST => foo\I);
- static $a7 = array(E_ERROR => foo\I);
+ static $a1 = array(I => foo::I);
+ static $a2 = array(foo::I => foo::I);
+ static $a3 = array(foo::foo::I => foo::I);
+ static $a4 = array(::foo::I => foo::I);
+ static $a5 = array(::foo::foo::I => foo::I);
+ static $a6 = array(ArrayObject::STD_PROP_LIST => foo::I);
+ static $a7 = array(E_ERROR => foo::I);
}
class bar4 {
static $a1 = array(I => ArrayObject::STD_PROP_LIST);
- static $a2 = array(foo\I => ArrayObject::STD_PROP_LIST);
- static $a3 = array(foo\foo::I => ArrayObject::STD_PROP_LIST);
- static $a4 = array(\foo\I => ArrayObject::STD_PROP_LIST);
- static $a5 = array(\foo\foo::I => ArrayObject::STD_PROP_LIST);
+ static $a2 = array(foo::I => ArrayObject::STD_PROP_LIST);
+ static $a3 = array(foo::foo::I => ArrayObject::STD_PROP_LIST);
+ static $a4 = array(::foo::I => ArrayObject::STD_PROP_LIST);
+ static $a5 = array(::foo::foo::I => ArrayObject::STD_PROP_LIST);
static $a6 = array(ArrayObject::STD_PROP_LIST => ArrayObject::STD_PROP_LIST);
static $a7 = array(E_ERROR => ArrayObject::STD_PROP_LIST);
}
class bar5 {
static $a1 = array(I => E_ERROR);
- static $a2 = array(foo\I => E_ERROR);
- static $a3 = array(foo\foo::I => E_ERROR);
- static $a4 = array(\foo\I => E_ERROR);
- static $a5 = array(\foo\foo::I => E_ERROR);
+ static $a2 = array(foo::I => E_ERROR);
+ static $a3 = array(foo::foo::I => E_ERROR);
+ static $a4 = array(::foo::I => E_ERROR);
+ static $a5 = array(::foo::foo::I => E_ERROR);
static $a6 = array(ArrayObject::STD_PROP_LIST => E_ERROR);
static $a7 = array(E_ERROR => E_ERROR);
}
-echo "first\n";
echo C;
-echo foo\C;
-echo foo\foo::C;
echo foo::C;
-echo \foo\foo::C;
+echo foo::foo::C;
+echo ::foo::C;
+echo ::foo::foo::C;
echo ArrayObject::STD_PROP_LIST . "\n";
echo E_ERROR . "\n";
-echo "second\n";
-echo \foo\foo::C1;
-echo \foo\foo::C2;
-echo \foo\foo::C3;
-echo \foo\foo::C4;
-echo \foo\foo::C5;
-echo \foo\foo::C6 . "\n";
-echo \foo\foo::C7 . "\n";
+
+echo foo::foo::C1;
+echo foo::foo::C2;
+echo foo::foo::C3;
+echo foo::foo::C4;
+echo foo::foo::C5;
+echo foo::foo::C6 . "\n";
+echo foo::foo::C7 . "\n";
print_r(bar1::$a1);
print_r(bar1::$a2);
@@ -138,24 +126,20 @@ print_r(bar5::$a4);
print_r(bar5::$a5);
print_r(bar5::$a6);
print_r(bar5::$a7);
-function oops($a = array(foo\unknown)){}
-oops();
?>
---EXPECTF--
-first
-foo\C
-foo\foo\C
-foo\foo\foo::C
-foo\foo::C
-foo\foo::C
+--EXPECT--
+foo::C
+foo::C
+foo::foo::C
+foo::C
+foo::foo::C
1
1
-second
-foo\C
-foo\foo\C
-foo\foo\foo::C
-foo\C
-foo\foo::C
+foo::C
+foo::C
+foo::foo::C
+foo::C
+foo::foo::C
1
1
Array
@@ -164,11 +148,11 @@ Array
)
Array
(
- [12] => 0
+ [11] => 0
)
Array
(
- [32] => 0
+ [22] => 0
)
Array
(
@@ -192,11 +176,11 @@ Array
)
Array
(
- [12] => 11
+ [11] => 11
)
Array
(
- [32] => 11
+ [22] => 11
)
Array
(
@@ -216,31 +200,31 @@ Array
)
Array
(
- [11] => 12
+ [11] => 11
)
Array
(
- [12] => 12
+ [11] => 11
)
Array
(
- [32] => 12
+ [22] => 11
)
Array
(
- [11] => 12
+ [11] => 11
)
Array
(
- [22] => 12
+ [22] => 11
)
Array
(
- [1] => 12
+ [1] => 11
)
Array
(
- [1] => 12
+ [1] => 11
)
Array
(
@@ -248,11 +232,11 @@ Array
)
Array
(
- [12] => 1
+ [11] => 1
)
Array
(
- [32] => 1
+ [22] => 1
)
Array
(
@@ -276,11 +260,11 @@ Array
)
Array
(
- [12] => 1
+ [11] => 1
)
Array
(
- [32] => 1
+ [22] => 1
)
Array
(
@@ -298,5 +282,3 @@ Array
(
[1] => 1
)
-
-Fatal error: Undefined constant 'foo\foo\unknown' in %sbug42819.php on line %d \ No newline at end of file
diff --git a/Zend/tests/bug42820.phpt b/Zend/tests/bug42820.phpt
index 921f0090a9..0a6c7d7876 100755
--- a/Zend/tests/bug42820.phpt
+++ b/Zend/tests/bug42820.phpt
@@ -7,16 +7,16 @@ const ok = 0;
class foo {
const ok = 0;
}
-var_dump(defined('ns\\ok'));
-var_dump(defined('ns\\bug'));
-var_dump(defined('\\ns\\ok'));
-var_dump(defined('\\ns\\bug'));
-var_dump(defined('ns\\foo::ok'));
-var_dump(defined('ns\\foo::bug'));
-var_dump(defined('\\ns\\foo::ok'));
-var_dump(defined('\\ns\\foo::bug'));
-var_dump(defined('ns\\bar::bug'));
-var_dump(defined('\\ns\\bar::bug'));
+var_dump(defined('ns::ok'));
+var_dump(defined('ns::bug'));
+var_dump(defined('::ns::ok'));
+var_dump(defined('::ns::bug'));
+var_dump(defined('ns::foo::ok'));
+var_dump(defined('ns::foo::bug'));
+var_dump(defined('::ns::foo::ok'));
+var_dump(defined('::ns::foo::bug'));
+var_dump(defined('ns::bar::bug'));
+var_dump(defined('::ns::bar::bug'));
--EXPECT--
bool(true)
bool(false)
diff --git a/Zend/tests/bug42859.phpt b/Zend/tests/bug42859.phpt
index 755f41f8d6..931e7fe0f7 100755
--- a/Zend/tests/bug42859.phpt
+++ b/Zend/tests/bug42859.phpt
@@ -5,8 +5,8 @@ Bug #42859 (import always conflicts with internal classes)
namespace Foo;
class Ex {}
-use Blah\Exception;
-use Blah\Ex;
+use Blah::Exception;
+use Blah::Ex;
?>
--EXPECTF--
-Fatal error: Cannot use Blah\Ex as Ex because the name is already in use in %sbug42859.php on line 6
+Fatal error: Cannot use Blah::Ex as Ex because the name is already in use in %sbug42859.php on line 6
diff --git a/Zend/tests/bug43128.phpt b/Zend/tests/bug43128.phpt
index 629f46c594..2832acaeb8 100755
--- a/Zend/tests/bug43128.phpt
+++ b/Zend/tests/bug43128.phpt
@@ -1,7 +1,5 @@
--TEST--
Bug #43128 (Very long class name causes segfault)
---INI--
-memory_limit=128000000
--FILE--
<?php
diff --git a/Zend/tests/bug43183.phpt b/Zend/tests/bug43183.phpt
index a8ca698e9f..61313eb2c6 100755
--- a/Zend/tests/bug43183.phpt
+++ b/Zend/tests/bug43183.phpt
@@ -3,10 +3,10 @@ Bug #43183 ("use" of the same class in difference scripts results in a fatal err
--FILE--
<?php
namespace Test;
-use Test\Foo;
+use Test::Foo;
class Foo {}
class Bar {}
-use Test\Bar;
+use Test::Bar;
echo "ok\n";
--EXPECT--
ok \ No newline at end of file
diff --git a/Zend/tests/bug43332_1.phpt b/Zend/tests/bug43332_1.phpt
index 807c6cb545..ef32162100 100644
--- a/Zend/tests/bug43332_1.phpt
+++ b/Zend/tests/bug43332_1.phpt
@@ -10,6 +10,6 @@ class foo {
$foo = new foo;
$foo->bar($foo); // Ok!
-$foo->bar(new \stdclass); // Error, ok!
+$foo->bar(new stdclass); // Error, ok!
--EXPECTF--
-Catchable fatal error: Argument 1 passed to foobar\foo::bar() must be an instance of foobar\foo, instance of stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php on line 5
+Catchable fatal error: Argument 1 passed to foobar::foo::bar() must be an instance of foobar::foo, instance of stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php on line 5
diff --git a/Zend/tests/bug43332_2.phpt b/Zend/tests/bug43332_2.phpt
index b8adef3b13..916f6fa354 100644
--- a/Zend/tests/bug43332_2.phpt
+++ b/Zend/tests/bug43332_2.phpt
@@ -5,11 +5,11 @@ Bug #43332.2 (self and parent as type hint in namespace)
namespace foobar;
class foo {
- public function bar(\self $a) { }
+ public function bar(::self $a) { }
}
$foo = new foo;
$foo->bar($foo); // Ok!
$foo->bar(new stdclass); // Error, ok!
--EXPECTF--
-Fatal error: '\self' is an invalid class name in %sbug43332_2.php on line 5
+Fatal error: '::self' is a wrong class name in %sbug43332_2.php on line 5
diff --git a/Zend/tests/bug43343.phpt b/Zend/tests/bug43343.phpt
index 12f64fbd24..fa1d993ab8 100644
--- a/Zend/tests/bug43343.phpt
+++ b/Zend/tests/bug43343.phpt
@@ -8,4 +8,4 @@ $foo = 'bar';
var_dump(new namespace::$foo);
?>
--EXPECTF--
-Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_NS_SEPARATOR in %sbug43343.php on line 5
+Fatal error: Cannot use 'namespace' as a class name in %sbug43343.php on line 5
diff --git a/Zend/tests/bug43344_10.phpt b/Zend/tests/bug43344_10.phpt
index e9f918cd61..d80a06ba05 100644
--- a/Zend/tests/bug43344_10.phpt
+++ b/Zend/tests/bug43344_10.phpt
@@ -2,7 +2,7 @@
Bug #43344.10 (Wrong error message for undefined namespace constant)
--FILE--
<?php
-echo namespace\bar."\n";
+echo namespace::bar."\n";
?>
--EXPECTF--
Fatal error: Undefined constant 'bar' in %sbug43344_10.php on line %d
diff --git a/Zend/tests/bug43344_11.phpt b/Zend/tests/bug43344_11.phpt
index b55cdccdea..4daa236f87 100644
--- a/Zend/tests/bug43344_11.phpt
+++ b/Zend/tests/bug43344_11.phpt
@@ -2,7 +2,7 @@
Bug #43344.11 (Wrong error message for undefined namespace constant)
--FILE--
<?php
-function f($a=namespace\bar) {
+function f($a=namespace::bar) {
return $a;
}
echo f()."\n";
diff --git a/Zend/tests/bug43344_12.phpt b/Zend/tests/bug43344_12.phpt
index 4d1e154f31..79dfc65cea 100644
--- a/Zend/tests/bug43344_12.phpt
+++ b/Zend/tests/bug43344_12.phpt
@@ -2,7 +2,7 @@
Bug #43344.12 (Wrong error message for undefined namespace constant)
--FILE--
<?php
-function f($a=array(namespace\bar)) {
+function f($a=array(namespace::bar)) {
return $a[0];
}
echo f()."\n";
diff --git a/Zend/tests/bug43344_13.phpt b/Zend/tests/bug43344_13.phpt
index c6aaf92fb3..d4fff4ffdd 100644
--- a/Zend/tests/bug43344_13.phpt
+++ b/Zend/tests/bug43344_13.phpt
@@ -2,7 +2,7 @@
Bug #43344.13 (Wrong error message for undefined namespace constant)
--FILE--
<?php
-function f($a=array(namespace\bar=>0)) {
+function f($a=array(namespace::bar=>0)) {
reset($a);
return key($a);
}
diff --git a/Zend/tests/bug43344_2.phpt b/Zend/tests/bug43344_2.phpt
index 57766afa94..1c55559e26 100644
--- a/Zend/tests/bug43344_2.phpt
+++ b/Zend/tests/bug43344_2.phpt
@@ -6,4 +6,4 @@ namespace Foo;
echo Foo::bar."\n";
?>
--EXPECTF--
-Fatal error: Class 'Foo\Foo' not found in %sbug43344_2.php on line %d
+Fatal error: Class 'Foo::Foo' not found in %sbug43344_2.php on line %d
diff --git a/Zend/tests/bug43344_3.phpt b/Zend/tests/bug43344_3.phpt
index 579ed81ada..26a6b46a3b 100644
--- a/Zend/tests/bug43344_3.phpt
+++ b/Zend/tests/bug43344_3.phpt
@@ -9,4 +9,4 @@ function f($a=Foo::bar) {
echo f()."\n";
?>
--EXPECTF--
-Fatal error: Class 'Foo\Foo' not found in %sbug43344_3.php on line %d
+Fatal error: Class 'Foo::Foo' not found in %sbug43344_3.php on line %d
diff --git a/Zend/tests/bug43344_4.phpt b/Zend/tests/bug43344_4.phpt
index 97e08b3664..20feaf9afe 100644
--- a/Zend/tests/bug43344_4.phpt
+++ b/Zend/tests/bug43344_4.phpt
@@ -9,4 +9,4 @@ function f($a=array(Foo::bar)) {
echo f()."\n";
?>
--EXPECTF--
-Fatal error: Class 'Foo\Foo' not found in %sbug43344_4.php on line %d
+Fatal error: Class 'Foo::Foo' not found in %sbug43344_4.php on line %d
diff --git a/Zend/tests/bug43344_5.phpt b/Zend/tests/bug43344_5.phpt
index 645ef33e7f..2ccd029825 100644
--- a/Zend/tests/bug43344_5.phpt
+++ b/Zend/tests/bug43344_5.phpt
@@ -10,4 +10,4 @@ function f($a=array(Foo::bar=>0)) {
echo f()."\n";
?>
--EXPECTF--
-Fatal error: Class 'Foo\Foo' not found in %sbug43344_5.php on line %d
+Fatal error: Class 'Foo::Foo' not found in %sbug43344_5.php on line %d
diff --git a/Zend/tests/bug43344_6.phpt b/Zend/tests/bug43344_6.phpt
index 38e1961aad..0597b585e0 100644
--- a/Zend/tests/bug43344_6.phpt
+++ b/Zend/tests/bug43344_6.phpt
@@ -3,7 +3,7 @@ Bug #43344.6 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
-echo namespace\bar."\n";
+echo namespace::bar."\n";
?>
--EXPECTF--
-Fatal error: Undefined constant 'Foo\bar' in %sbug43344_6.php on line %d
+Fatal error: Undefined constant 'Foo::bar' in %sbug43344_6.php on line %d
diff --git a/Zend/tests/bug43344_7.phpt b/Zend/tests/bug43344_7.phpt
index 94e00d9e1f..fab79feec2 100644
--- a/Zend/tests/bug43344_7.phpt
+++ b/Zend/tests/bug43344_7.phpt
@@ -3,10 +3,10 @@ Bug #43344.7 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
-function f($a=namespace\bar) {
+function f($a=namespace::bar) {
return $a;
}
echo f()."\n";
?>
--EXPECTF--
-Fatal error: Undefined constant 'Foo\bar' in %sbug43344_7.php on line %d
+Fatal error: Undefined constant 'Foo::bar' in %sbug43344_7.php on line %d
diff --git a/Zend/tests/bug43344_8.phpt b/Zend/tests/bug43344_8.phpt
index eb694f7118..a9272d7472 100644
--- a/Zend/tests/bug43344_8.phpt
+++ b/Zend/tests/bug43344_8.phpt
@@ -3,10 +3,10 @@ Bug #43344.8 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
-function f($a=array(namespace\bar)) {
+function f($a=array(namespace::bar)) {
return $a[0];
}
echo f()."\n";
?>
--EXPECTF--
-Fatal error: Undefined constant 'Foo\bar' in %sbug43344_8.php on line %d
+Fatal error: Undefined constant 'Foo::bar' in %sbug43344_8.php on line %d
diff --git a/Zend/tests/bug43344_9.phpt b/Zend/tests/bug43344_9.phpt
index 31604e7a94..b3c5dfbdb7 100644
--- a/Zend/tests/bug43344_9.phpt
+++ b/Zend/tests/bug43344_9.phpt
@@ -3,11 +3,11 @@ Bug #43344.9 (Wrong error message for undefined namespace constant)
--FILE--
<?php
namespace Foo;
-function f($a=array(namespace\bar=>0)) {
+function f($a=array(namespace::bar=>0)) {
reset($a);
return key($a);
}
echo f()."\n";
?>
--EXPECTF--
-Fatal error: Undefined constant 'Foo\bar' in %sbug43344_9.php on line %d
+Fatal error: Undefined constant 'Foo::bar' in %sbug43344_9.php on line %d
diff --git a/Zend/tests/bug43651.phpt b/Zend/tests/bug43651.phpt
index ea70cf1039..bce0601abe 100644
--- a/Zend/tests/bug43651.phpt
+++ b/Zend/tests/bug43651.phpt
@@ -6,22 +6,22 @@ class Test {
static function foo() {}
}
-var_dump(is_callable("\\\\"));
-var_dump(is_callable("\\"));
-var_dump(is_callable("x\\"));
-var_dump(is_callable("\\x"));
-var_dump(is_callable("x\\x"));
-var_dump(is_callable("x\\\\"));
-var_dump(is_callable("\\x"));
-var_dump(is_callable("x\\\\x"));
+var_dump(is_callable("::"));
+var_dump(is_callable(":"));
+var_dump(is_callable("x:"));
+var_dump(is_callable(":x"));
+var_dump(is_callable("x:x"));
+var_dump(is_callable("x::"));
+var_dump(is_callable("::x"));
+var_dump(is_callable("x::x"));
var_dump(is_callable("cd"));
-var_dump(is_callable("Test\\"));
-var_dump(is_callable("\\Test"));
-var_dump(is_callable("\\Test\\"));
+var_dump(is_callable("Test::"));
+var_dump(is_callable("::Test"));
+var_dump(is_callable("::Test::"));
var_dump(is_callable("Test::foo"));
-var_dump(is_callable("\\Test::foo"));
+var_dump(is_callable("::Test::foo"));
var_dump(is_callable("is_string"));
-var_dump(is_callable("\\is_string"));
+var_dump(is_callable("::is_string"));
--EXPECT--
bool(false)
bool(false)
diff --git a/Zend/tests/bug44653.phpt b/Zend/tests/bug44653.phpt
index 1abf9747c7..defdba810a 100644
--- a/Zend/tests/bug44653.phpt
+++ b/Zend/tests/bug44653.phpt
@@ -14,17 +14,13 @@ class B {
static function fooBar() { echo "bag2\n"; }
}
function fooBar() { echo __FUNCTION__ . PHP_EOL; }
-var_dump(\A\XX);
+var_dump(A::XX);
A::fooBar();
-\A\fooBar();
-B::fooBar();
fooBar();
-\B\fooBar();
+B::fooBar();
?>
--EXPECT--
int(1)
-bag1
-A\fooBar
-bag2
-B\fooBar
-B\fooBar
+A::fooBar
+B::fooBar
+B::fooBar
diff --git a/Zend/tests/class_alias_012.phpt b/Zend/tests/class_alias_012.phpt
index dd1c9b1072..01839668b8 100644
--- a/Zend/tests/class_alias_012.phpt
+++ b/Zend/tests/class_alias_012.phpt
@@ -3,31 +3,31 @@ Testing dynamic alias name
--FILE--
<?php
-namespace test\baz;
+namespace test::baz;
class foo {
}
new foo;
-class_alias(__NAMESPACE__ .'\foo', __NAMESPACE__ .'\T');
+class_alias(__NAMESPACE__ .'::foo', __NAMESPACE__ .'::T');
var_dump(new foo);
var_dump(new T);
-$var = __NAMESPACE__ .'\foo';
+$var = __NAMESPACE__ .'::foo';
var_dump(new $var);
-$var = __NAMESPACE__ .'\T';
+$var = __NAMESPACE__ .'::T';
var_dump(new $var);
?>
--EXPECTF--
-object(test\baz\foo)#%d (0) {
+object(test::baz::foo)#%d (0) {
}
-object(test\baz\foo)#%d (0) {
+object(test::baz::foo)#%d (0) {
}
-object(test\baz\foo)#%d (0) {
+object(test::baz::foo)#%d (0) {
}
-object(test\baz\foo)#%d (0) {
+object(test::baz::foo)#%d (0) {
}
diff --git a/Zend/tests/class_alias_013.phpt b/Zend/tests/class_alias_013.phpt
index 4991d0fd31..d032e26541 100644
--- a/Zend/tests/class_alias_013.phpt
+++ b/Zend/tests/class_alias_013.phpt
@@ -3,24 +3,24 @@ Testing alias of alias
--FILE--
<?php
-namespace test\baz;
+namespace test::baz;
class foo {
}
new foo;
-$alias1 = __NAMESPACE__ .'\T';
-class_alias(__NAMESPACE__ .'\foo', $alias1);
+$alias1 = __NAMESPACE__ .'::T';
+class_alias(__NAMESPACE__ .'::foo', $alias1);
-$alias2 = $alias1 .'\BAR';
+$alias2 = $alias1 .'::BAR';
class_alias($alias1, $alias2);
-var_dump(new \test\baz\foo, new \test\baz\T\BAR);
+var_dump(new test::baz::foo, new test::baz::T::BAR);
?>
--EXPECTF--
-object(test\baz\foo)#%d (0) {
+object(test::baz::foo)#%d (0) {
}
-object(test\baz\foo)#%d (0) {
+object(test::baz::foo)#%d (0) {
}
diff --git a/Zend/tests/class_alias_015.phpt b/Zend/tests/class_alias_015.phpt
index c79c077187..d694e10752 100644
--- a/Zend/tests/class_alias_015.phpt
+++ b/Zend/tests/class_alias_015.phpt
@@ -8,11 +8,11 @@ namespace foo;
class bar {
}
-class_alias('foo\bar', 'foo\baz');
+class_alias('foo::bar', 'foo::baz');
-var_dump(new namespace\baz);
+var_dump(new namespace::baz);
?>
--EXPECTF--
-object(foo\bar)#%d (0) {
+object(foo::bar)#%d (0) {
}
diff --git a/Zend/tests/class_alias_016.phpt b/Zend/tests/class_alias_016.phpt
index 930f2ee0e4..6e5c0093e8 100644
--- a/Zend/tests/class_alias_016.phpt
+++ b/Zend/tests/class_alias_016.phpt
@@ -8,14 +8,14 @@ namespace foo;
class bar {
}
-class_alias('foo\bar', 'foo');
+class_alias('foo::bar', 'foo');
-var_dump(new \foo);
+var_dump(new ::foo);
var_dump(new foo);
?>
--EXPECTF--
-object(foo\bar)#%d (0) {
+object(foo::bar)#%d (0) {
}
-Fatal error: Class 'foo\foo' not found in %s on line %d
+Fatal error: Class 'foo::foo' not found in %s on line %d
diff --git a/Zend/tests/class_alias_019.phpt b/Zend/tests/class_alias_019.phpt
index a0dd249d55..4bcc5d9d0c 100644
--- a/Zend/tests/class_alias_019.phpt
+++ b/Zend/tests/class_alias_019.phpt
@@ -9,8 +9,8 @@ namespace foo;
class foo {
}
-class_alias(__NAMESPACE__ .'\foo', 'foo');
-class_alias('\foo', 'foo');
+class_alias(__NAMESPACE__ .'::foo', 'foo');
+class_alias('::foo', 'foo');
?>
--EXPECTF--
diff --git a/Zend/tests/class_alias_020.phpt b/Zend/tests/class_alias_020.phpt
index e2c7d9245e..1c2452cd7f 100644
--- a/Zend/tests/class_alias_020.phpt
+++ b/Zend/tests/class_alias_020.phpt
@@ -9,25 +9,25 @@ namespace foo;
class foo {
}
-class_alias(__NAMESPACE__ .'\foo', 'foo');
+class_alias(__NAMESPACE__ .'::foo', 'foo');
-namespace foo\bar;
+namespace foo::bar;
class foo {
}
-class_alias(__NAMESPACE__ .'\foo', 'bar');
+class_alias(__NAMESPACE__ .'::foo', 'bar');
-var_dump(new \foo, new \bar);
+var_dump(new ::foo, new ::bar);
-var_dump(new \foo\foo, new \foo\bar);
+var_dump(new foo::foo, new foo::bar);
?>
--EXPECTF--
-object(foo\foo)#1 (0) {
+object(foo::foo)#1 (0) {
}
-object(foo\bar\foo)#2 (0) {
+object(foo::bar::foo)#2 (0) {
}
-Fatal error: Class 'foo\bar' not found in %s on line %d
+Fatal error: Class 'foo::bar' not found in %s on line %d
diff --git a/Zend/tests/class_alias_021.phpt b/Zend/tests/class_alias_021.phpt
index dd90e127f4..79049623f0 100644
--- a/Zend/tests/class_alias_021.phpt
+++ b/Zend/tests/class_alias_021.phpt
@@ -7,19 +7,19 @@ namespace foo;
class bar { }
-class_alias('foo\bar', 'baz');
+class_alias('foo::bar', 'baz');
-use \baz as stdClass;
+use ::baz as stdClass;
-var_dump(new bar);
+var_dump(new foo::bar);
var_dump(new stdClass);
-var_dump(new \baz);
+var_dump(new ::baz);
?>
--EXPECTF--
-object(foo\bar)#%d (0) {
+object(foo::bar)#%d (0) {
}
-object(foo\bar)#%d (0) {
+object(foo::bar)#%d (0) {
}
-object(foo\bar)#%d (0) {
+object(foo::bar)#%d (0) {
}
diff --git a/Zend/tests/class_constants_004.phpt b/Zend/tests/class_constants_004.phpt
index 73a42ede7a..104ceb1bb6 100644
--- a/Zend/tests/class_constants_004.phpt
+++ b/Zend/tests/class_constants_004.phpt
@@ -17,15 +17,15 @@ interface Ifoo {
const foo = 4;
}
-$const = __NAMESPACE__ .'\\foo'; // class
-$const2 = __NAMESPACE__ .'\\Ifoo'; // interface
+$const = __NAMESPACE__ .'::foo'; // class
+$const2 = __NAMESPACE__ .'::Ifoo'; // interface
var_dump( foo,
- \foo\foo,
- namespace\foo,
- \foo\foo::foo,
+ foo::foo,
+ namespace::foo,
+ foo::foo::foo,
$const::foo,
- \foo,
+ ::foo,
constant('foo'),
Ifoo::foo,
$const2::foo
diff --git a/Zend/tests/class_exists_001.phpt b/Zend/tests/class_exists_001.phpt
index 8af96a49fc..4ee1ee2925 100644
--- a/Zend/tests/class_exists_001.phpt
+++ b/Zend/tests/class_exists_001.phpt
@@ -9,13 +9,13 @@ class foo {
}
-class_alias(__NAMESPACE__ .'\foo', 'bar');
+class_alias(__NAMESPACE__ .'::foo', 'bar');
-var_dump(class_exists('\bar'));
+var_dump(class_exists('::bar'));
var_dump(class_exists('bar'));
-var_dump(class_exists('foo\bar'));
-var_dump(class_exists('foo\foo'));
+var_dump(class_exists('foo::bar'));
+var_dump(class_exists('foo::foo'));
var_dump(class_exists('foo'));
?>
diff --git a/Zend/tests/closure_027.phpt b/Zend/tests/closure_027.phpt
index f26e114045..7787f729e5 100644
--- a/Zend/tests/closure_027.phpt
+++ b/Zend/tests/closure_027.phpt
@@ -25,7 +25,7 @@ NULL
Notice: Undefined variable: y in %s on line %d
-Warning: Missing argument 1 for {closure}(), called in %s on line %d and defined in %s on line %d
+Warning: Missing argument 1 for (), called in %s on line %d and defined in %s on line %d
NULL
Catchable fatal error: Argument 1 passed to test() must be an instance of Closure, instance of stdClass given, called in %s on line %d and defined in %s on line %d
diff --git a/Zend/tests/constants_003.phpt b/Zend/tests/constants_003.phpt
index 205f95f036..ec3eb6d4ff 100644
--- a/Zend/tests/constants_003.phpt
+++ b/Zend/tests/constants_003.phpt
@@ -9,7 +9,7 @@ const foo = 1;
define('foo', 2);
-var_dump(foo, namespace\foo, \foo\foo, \foo, constant('foo'), constant('foo\foo'));
+var_dump(foo, namespace::foo, foo::foo, ::foo, constant('foo'), constant('foo::foo'));
?>
--EXPECT--
diff --git a/Zend/tests/constants_004.phpt b/Zend/tests/constants_004.phpt
index 69369aa3d9..787ec26e72 100644
--- a/Zend/tests/constants_004.phpt
+++ b/Zend/tests/constants_004.phpt
@@ -10,4 +10,4 @@ const foo = 2;
?>
--EXPECTF--
-Notice: Constant foo\foo already defined in %s on line %d
+Notice: Constant foo::foo already defined in %s on line %d
diff --git a/Zend/tests/constants_006.phpt b/Zend/tests/constants_006.phpt
index 6458a07825..24851531bc 100644
--- a/Zend/tests/constants_006.phpt
+++ b/Zend/tests/constants_006.phpt
@@ -26,7 +26,7 @@ var_dump(__namespace__);
string(%d) "%s"
string(%d) "%s"
int(%d)
-string(21) "test\foo::__construct"
-string(8) "test\foo"
+string(22) "test::foo::__construct"
+string(9) "test::foo"
string(11) "__construct"
string(4) "test"
diff --git a/Zend/tests/constants_009.phpt b/Zend/tests/constants_009.phpt
index ea986dd3c7..c84760be81 100644
--- a/Zend/tests/constants_009.phpt
+++ b/Zend/tests/constants_009.phpt
@@ -3,7 +3,7 @@ Accessing constants inside namespace
--FILE--
<?php
-namespace foo\x;
+namespace foo::x;
const x = 2;
@@ -12,10 +12,8 @@ class x {
}
-var_dump(namespace\x,
-x::x,
-namespace\x::x);
-var_dump(defined('foo\x\x'));
+var_dump(namespace::x, x::x, namespace::x::x);
+var_dump(defined('foo::x::x'));
?>
--EXPECT--
diff --git a/Zend/tests/hex_overflow_32bit.phpt b/Zend/tests/hex_overflow_32bit.phpt
index 0f192f3497..36e9a7e9d3 100644
--- a/Zend/tests/hex_overflow_32bit.phpt
+++ b/Zend/tests/hex_overflow_32bit.phpt
@@ -22,7 +22,7 @@ foreach ($doubles as $d) {
echo "Done\n";
?>
--EXPECTF--
-float(4.0833602971%dE+14)
+float(4083360297110%d)
float(4.7223664828%dE+21)
float(1.3521606402%dE+31)
float(1.9807040628%dE+27)
diff --git a/Zend/tests/inter_02.phpt b/Zend/tests/inter_02.phpt
index 34e8baa5dc..18db230b21 100644
--- a/Zend/tests/inter_02.phpt
+++ b/Zend/tests/inter_02.phpt
@@ -11,7 +11,7 @@ interface foo {
const foo = 2;
}
-function foo($x = \foo\foo::foo) {
+function foo($x = foo::foo::foo) {
var_dump($x);
}
diff --git a/Zend/tests/interface_exists_002.phpt b/Zend/tests/interface_exists_002.phpt
index be78784d55..f4d8a03cd8 100644
--- a/Zend/tests/interface_exists_002.phpt
+++ b/Zend/tests/interface_exists_002.phpt
@@ -13,8 +13,8 @@ interface IBar extends IFoo { }
var_dump(interface_exists('IFoo'));
-var_dump(interface_exists('foo\\IFoo'));
-var_dump(interface_exists('FOO\\ITEST'));
+var_dump(interface_exists('foo::IFoo'));
+var_dump(interface_exists('FOO::ITEST'));
?>
--EXPECT--
diff --git a/Zend/tests/lsb_014.phpt b/Zend/tests/lsb_014.phpt
index 19cf913710..34ee7b48ce 100644
--- a/Zend/tests/lsb_014.phpt
+++ b/Zend/tests/lsb_014.phpt
@@ -1,5 +1,5 @@
---TEST--
-ZE2 Late Static Binding access to static::const through defined() and get_constant()
+--TEST--
+ZE2 Late Static Binding access to static::const through defined() anf get_constant()
--FILE--
<?php
diff --git a/Zend/tests/ns_001.phpt b/Zend/tests/ns_001.phpt
index 67715947af..6821756a43 100755
--- a/Zend/tests/ns_001.phpt
+++ b/Zend/tests/ns_001.phpt
@@ -2,7 +2,7 @@
001: Class in namespace
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
class Foo {
@@ -22,13 +22,13 @@ class Foo {
$x = new Foo;
$x->bar();
Foo::baz();
-$y = new \test\ns1\Foo;
+$y = new test::ns1::Foo;
$y->bar();
-\test\ns1\Foo::baz();
+test::ns1::Foo::baz();
--EXPECT--
-test\ns1\Foo
-test\ns1\Foo
-test\ns1\Foo
-test\ns1\Foo
-test\ns1\Foo
-test\ns1\Foo
+test::ns1::Foo
+test::ns1::Foo
+test::ns1::Foo
+test::ns1::Foo
+test::ns1::Foo
+test::ns1::Foo
diff --git a/Zend/tests/ns_002.phpt b/Zend/tests/ns_002.phpt
index 3d9e09869d..7faca97cd3 100755
--- a/Zend/tests/ns_002.phpt
+++ b/Zend/tests/ns_002.phpt
@@ -2,7 +2,7 @@
002: Import in namespace
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
class Foo {
static function bar() {
@@ -10,18 +10,18 @@ class Foo {
}
}
-use test\ns1\Foo as Bar;
-use test\ns1 as ns2;
-use test\ns1;
+use test::ns1::Foo as Bar;
+use test::ns1 as ns2;
+use test::ns1;
Foo::bar();
-\test\ns1\Foo::bar();
+test::ns1::Foo::bar();
Bar::bar();
-ns2\Foo::bar();
-ns1\Foo::bar();
+ns2::Foo::bar();
+ns1::Foo::bar();
--EXPECT--
-test\ns1\Foo
-test\ns1\Foo
-test\ns1\Foo
-test\ns1\Foo
-test\ns1\Foo
+test::ns1::Foo
+test::ns1::Foo
+test::ns1::Foo
+test::ns1::Foo
+test::ns1::Foo
diff --git a/Zend/tests/ns_003.phpt b/Zend/tests/ns_003.phpt
index 4372722c25..26c21a9ff0 100755
--- a/Zend/tests/ns_003.phpt
+++ b/Zend/tests/ns_003.phpt
@@ -2,11 +2,11 @@
003: Name conflict (ns name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
class Exception {
}
echo get_class(new Exception()),"\n";
--EXPECT--
-test\ns1\Exception
+test::ns1::Exception
diff --git a/Zend/tests/ns_004.phpt b/Zend/tests/ns_004.phpt
index d293f65dce..2aa4a809d9 100755
--- a/Zend/tests/ns_004.phpt
+++ b/Zend/tests/ns_004.phpt
@@ -1,9 +1,9 @@
--TEST--
-004: Using global class name from namespace (unqualified - fail)
+004: Name conflict (php name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
echo get_class(new Exception()),"\n";
---EXPECTF--
-Fatal error: Class 'test\ns1\Exception' not found in %sns_004.php on line %d \ No newline at end of file
+--EXPECT--
+Exception
diff --git a/Zend/tests/ns_005.phpt b/Zend/tests/ns_005.phpt
index c082afc481..fc1d6570fd 100755
--- a/Zend/tests/ns_005.phpt
+++ b/Zend/tests/ns_005.phpt
@@ -2,11 +2,11 @@
005: Name conflict (php name in case if ns name exists)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
class Exception {
}
-echo get_class(new \Exception()),"\n";
+echo get_class(new ::Exception()),"\n";
--EXPECT--
Exception
diff --git a/Zend/tests/ns_006.phpt b/Zend/tests/ns_006.phpt
index 1c0ec3ab08..f4027408d4 100755
--- a/Zend/tests/ns_006.phpt
+++ b/Zend/tests/ns_006.phpt
@@ -2,12 +2,12 @@
006: Run-time name conflict (ns name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
class Exception {
}
-$x = "test\\ns1\\Exception";
+$x = "test::ns1::Exception";
echo get_class(new $x),"\n";
--EXPECT--
-test\ns1\Exception
+test::ns1::Exception
diff --git a/Zend/tests/ns_007.phpt b/Zend/tests/ns_007.phpt
index 2f4d1361dc..60ccced504 100755
--- a/Zend/tests/ns_007.phpt
+++ b/Zend/tests/ns_007.phpt
@@ -2,7 +2,7 @@
007: Run-time name conflict (php name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
class Exception {
}
diff --git a/Zend/tests/ns_008.phpt b/Zend/tests/ns_008.phpt
index 2c2c9180cf..1c0d116483 100755
--- a/Zend/tests/ns_008.phpt
+++ b/Zend/tests/ns_008.phpt
@@ -7,7 +7,7 @@ namespace test;
class foo {
}
-$x = __NAMESPACE__ . "\\foo";
+$x = __NAMESPACE__ . "::foo";
echo get_class(new $x),"\n";
--EXPECT--
-test\foo
+test::foo
diff --git a/Zend/tests/ns_009.phpt b/Zend/tests/ns_009.phpt
index 3481316f28..3d6aa225d6 100755
--- a/Zend/tests/ns_009.phpt
+++ b/Zend/tests/ns_009.phpt
@@ -5,7 +5,7 @@
class foo {
}
-$x = __NAMESPACE__ . "\\foo";
+$x = __NAMESPACE__ . "::foo";
echo get_class(new $x),"\n";
--EXPECT--
foo
diff --git a/Zend/tests/ns_010.phpt b/Zend/tests/ns_010.phpt
index 28ef61bcdd..95172e0ec3 100755
--- a/Zend/tests/ns_010.phpt
+++ b/Zend/tests/ns_010.phpt
@@ -15,27 +15,35 @@ class Foo {
}
}
new Foo();
-new Y\Foo();
-new \X\Foo();
+new X::Foo();
+new Y::Foo();
+new ::X::Foo();
Foo::bar();
-Y\Foo::bar();
-\X\Foo::bar();
+X::Foo::bar();
+Y::Foo::bar();
+::X::Foo::bar();
echo Foo::C;
-echo Y\Foo::C;
-echo \X\Foo::C;
+echo X::Foo::C;
+echo Y::Foo::C;
+echo ::X::Foo::C;
echo Foo::$var;
-echo Y\Foo::$var;
-echo \X\Foo::$var;
+echo X::Foo::$var;
+echo Y::Foo::$var;
+echo ::X::Foo::$var;
--EXPECT--
class ok
class ok
class ok
+class ok
+method ok
method ok
method ok
method ok
const ok
const ok
const ok
+const ok
+var ok
var ok
var ok
var ok
diff --git a/Zend/tests/ns_011.phpt b/Zend/tests/ns_011.phpt
index 1706f2a00d..c1d9ac3018 100755
--- a/Zend/tests/ns_011.phpt
+++ b/Zend/tests/ns_011.phpt
@@ -2,23 +2,23 @@
011: Function in namespace
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
function foo() {
echo __FUNCTION__,"\n";
}
foo();
-\test\ns1\foo();
+test::ns1::foo();
bar();
-\test\ns1\bar();
+test::ns1::bar();
function bar() {
echo __FUNCTION__,"\n";
}
--EXPECT--
-test\ns1\foo
-test\ns1\foo
-test\ns1\bar
-test\ns1\bar
+test::ns1::foo
+test::ns1::foo
+test::ns1::bar
+test::ns1::bar
diff --git a/Zend/tests/ns_012.phpt b/Zend/tests/ns_012.phpt
index 034f124924..ce16db1ab9 100755
--- a/Zend/tests/ns_012.phpt
+++ b/Zend/tests/ns_012.phpt
@@ -2,34 +2,34 @@
012: Import in namespace and functions
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
function foo() {
echo __FUNCTION__,"\n";
}
-use test\ns1 as ns2;
+use test::ns1 as ns2;
use test as ns3;
foo();
bar();
-\test\ns1\foo();
-\test\ns1\bar();
-ns2\foo();
-ns2\bar();
-ns3\ns1\foo();
-ns3\ns1\bar();
+test::ns1::foo();
+test::ns1::bar();
+ns2::foo();
+ns2::bar();
+ns3::ns1::foo();
+ns3::ns1::bar();
function bar() {
echo __FUNCTION__,"\n";
}
--EXPECT--
-test\ns1\foo
-test\ns1\bar
-test\ns1\foo
-test\ns1\bar
-test\ns1\foo
-test\ns1\bar
-test\ns1\foo
-test\ns1\bar
+test::ns1::foo
+test::ns1::bar
+test::ns1::foo
+test::ns1::bar
+test::ns1::foo
+test::ns1::bar
+test::ns1::foo
+test::ns1::bar
diff --git a/Zend/tests/ns_013.phpt b/Zend/tests/ns_013.phpt
index ef73b1395f..945b6bc4ec 100755
--- a/Zend/tests/ns_013.phpt
+++ b/Zend/tests/ns_013.phpt
@@ -2,7 +2,7 @@
013: Name conflict and functions (ns name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
function strlen($x) {
return __FUNCTION__;
@@ -10,4 +10,4 @@ function strlen($x) {
echo strlen("Hello"),"\n";
--EXPECT--
-test\ns1\strlen
+test::ns1::strlen
diff --git a/Zend/tests/ns_014.phpt b/Zend/tests/ns_014.phpt
index 6bcab51c83..9614b481a4 100755
--- a/Zend/tests/ns_014.phpt
+++ b/Zend/tests/ns_014.phpt
@@ -2,7 +2,7 @@
014: Name conflict and functions (php name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
echo strlen("Hello"),"\n";
--EXPECT--
diff --git a/Zend/tests/ns_015.phpt b/Zend/tests/ns_015.phpt
index ae2c818345..1ad05b963f 100755
--- a/Zend/tests/ns_015.phpt
+++ b/Zend/tests/ns_015.phpt
@@ -2,13 +2,13 @@
015: Name conflict and functions (php name in case if ns name exists)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
function strlen($x) {
return __FUNCTION__;
}
-echo \strlen("Hello"),"\n";
+echo ::strlen("Hello"),"\n";
--EXPECT--
5
diff --git a/Zend/tests/ns_016.phpt b/Zend/tests/ns_016.phpt
index bee8b5bee3..e278625e61 100755
--- a/Zend/tests/ns_016.phpt
+++ b/Zend/tests/ns_016.phpt
@@ -2,13 +2,13 @@
016: Run-time name conflict and functions (ns name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
function strlen($x) {
return __FUNCTION__;
}
-$x = "test\\ns1\\strlen";
+$x = "test::ns1::strlen";
echo $x("Hello"),"\n";
--EXPECT--
-test\ns1\strlen
+test::ns1::strlen
diff --git a/Zend/tests/ns_017.phpt b/Zend/tests/ns_017.phpt
index 888d8e5ef4..15ff1efee8 100755
--- a/Zend/tests/ns_017.phpt
+++ b/Zend/tests/ns_017.phpt
@@ -2,7 +2,7 @@
017: Run-time name conflict and functions (php name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
function strlen($x) {
return __FUNCTION__;
diff --git a/Zend/tests/ns_018.phpt b/Zend/tests/ns_018.phpt
index 5c2495c631..be8b4b7d34 100755
--- a/Zend/tests/ns_018.phpt
+++ b/Zend/tests/ns_018.phpt
@@ -8,7 +8,7 @@ function foo() {
return __FUNCTION__;
}
-$x = __NAMESPACE__ . "\\foo";
+$x = __NAMESPACE__ . "::foo";
echo $x(),"\n";
--EXPECT--
-test\foo
+test::foo
diff --git a/Zend/tests/ns_019.phpt b/Zend/tests/ns_019.phpt
index c3db786867..c42e97ed18 100755
--- a/Zend/tests/ns_019.phpt
+++ b/Zend/tests/ns_019.phpt
@@ -6,7 +6,7 @@ function foo() {
return __FUNCTION__;
}
-$x = __NAMESPACE__ . "\\foo";
+$x = __NAMESPACE__ . "::foo";
echo $x(),"\n";
--EXPECT--
foo
diff --git a/Zend/tests/ns_020.phpt b/Zend/tests/ns_020.phpt
index ec4fda0298..9d2e8a7ccb 100755
--- a/Zend/tests/ns_020.phpt
+++ b/Zend/tests/ns_020.phpt
@@ -8,11 +8,11 @@ function foo() {
echo __FUNCTION__,"\n";
}
foo();
-\X\foo();
-Y\foo();
-\X\foo();
+X::foo();
+Y::foo();
+::X::foo();
--EXPECT--
-X\foo
-X\foo
-X\foo
-X\foo
+X::foo
+X::foo
+X::foo
+X::foo
diff --git a/Zend/tests/ns_021.phpt b/Zend/tests/ns_021.phpt
index 405468399f..01609bb607 100755
--- a/Zend/tests/ns_021.phpt
+++ b/Zend/tests/ns_021.phpt
@@ -15,9 +15,9 @@ function foo() {
}
foo();
-\test\foo();
-\test\test::foo();
+test::foo();
+test::test::foo();
--EXPECT--
-test\foo
-test\foo
-test\Test::foo
+test::foo
+test::foo
+test::Test::foo
diff --git a/Zend/tests/ns_022.phpt b/Zend/tests/ns_022.phpt
index 7aebe1d5a2..6944ca403f 100755
--- a/Zend/tests/ns_022.phpt
+++ b/Zend/tests/ns_022.phpt
@@ -2,9 +2,9 @@
022: Name search priority (first look into import, then into current namespace and then for class)
--FILE--
<?php
-namespace a\b\c;
+namespace a::b::c;
-use a\b\c as test;
+use a::b::c as test;
require "ns_022.inc";
@@ -12,8 +12,8 @@ function foo() {
echo __FUNCTION__,"\n";
}
-test\foo();
-\test::foo();
+test::foo();
+::test::foo();
--EXPECT--
-a\b\c\foo
+a::b::c::foo
Test::foo
diff --git a/Zend/tests/ns_023.phpt b/Zend/tests/ns_023.phpt
index bc1681c122..4be9dc700a 100755
--- a/Zend/tests/ns_023.phpt
+++ b/Zend/tests/ns_023.phpt
@@ -2,10 +2,10 @@
023: __NAMESPACE__ constant
--FILE--
<?php
-namespace test\foo;
+namespace test::foo;
var_dump(__NAMESPACE__);
--EXPECT--
-string(8) "test\foo"
+string(9) "test::foo"
--UEXPECT--
-unicode(8) "test\foo"
+unicode(9) "test::foo"
diff --git a/Zend/tests/ns_025.phpt b/Zend/tests/ns_025.phpt
index 917a710d95..e5c8ab0044 100755
--- a/Zend/tests/ns_025.phpt
+++ b/Zend/tests/ns_025.phpt
@@ -2,7 +2,7 @@
025: Name ambiguity (class name & part of namespace name)
--FILE--
<?php
-namespace Foo\Bar;
+namespace Foo::Bar;
class Foo {
function __construct() {
@@ -15,10 +15,10 @@ class Foo {
$x = new Foo;
Foo::Bar();
-$x = new \Foo\Bar\Foo;
-\Foo\Bar\Foo::Bar();
+$x = new Foo::Bar::Foo;
+Foo::Bar::Foo::Bar();
--EXPECT--
-Foo\Bar\Foo
-Foo\Bar\Foo
-Foo\Bar\Foo
-Foo\Bar\Foo
+Foo::Bar::Foo
+Foo::Bar::Foo
+Foo::Bar::Foo
+Foo::Bar::Foo
diff --git a/Zend/tests/ns_026.phpt b/Zend/tests/ns_026.phpt
index af2bf2ca55..ad8654db5f 100755
--- a/Zend/tests/ns_026.phpt
+++ b/Zend/tests/ns_026.phpt
@@ -18,16 +18,13 @@ function Bar() {
}
$x = new Foo;
-\Foo\Bar();
-$x = new \Foo\Foo;
-\Foo\Foo::Bar();
-\Foo\Bar();
-Foo\Bar();
---EXPECTF--
-Method - Foo\Foo::__construct
-Func - Foo\Bar
-Method - Foo\Foo::__construct
-Method - Foo\Foo::Bar
-Func - Foo\Bar
-
-Fatal error: Call to undefined function Foo\Foo\Bar() in %sns_026.php on line %d \ No newline at end of file
+Foo::Bar();
+$x = new Foo::Foo;
+Foo::Foo::Bar();
+::Foo::Bar();
+--EXPECT--
+Method - Foo::Foo::__construct
+Func - Foo::Bar
+Method - Foo::Foo::__construct
+Method - Foo::Foo::Bar
+Func - Foo::Bar
diff --git a/Zend/tests/ns_027.inc b/Zend/tests/ns_027.inc
index 3823818290..014bc40552 100755
--- a/Zend/tests/ns_027.inc
+++ b/Zend/tests/ns_027.inc
@@ -1,5 +1,5 @@
<?php
-namespace Foo\Bar;
+namespace Foo::Bar;
class Foo {
function __construct() {
diff --git a/Zend/tests/ns_027.phpt b/Zend/tests/ns_027.phpt
index 88ef22f93b..064d0521f9 100755
--- a/Zend/tests/ns_027.phpt
+++ b/Zend/tests/ns_027.phpt
@@ -15,10 +15,10 @@ class Foo {
$x = new Foo;
Foo::Bar();
-$x = new Foo\Bar\Foo;
-Foo\Bar\Foo::Bar();
+$x = new Foo::Bar::Foo;
+Foo::Bar::Foo::Bar();
--EXPECT--
Foo
Foo
-Foo\Bar\Foo
-Foo\Bar\Foo
+Foo::Bar::Foo
+Foo::Bar::Foo
diff --git a/Zend/tests/ns_028.phpt b/Zend/tests/ns_028.phpt
index ec23dac818..1b34a594b1 100755
--- a/Zend/tests/ns_028.phpt
+++ b/Zend/tests/ns_028.phpt
@@ -14,13 +14,13 @@ class Foo {
}
$x = new Foo;
-Foo\Bar();
-$x = new Foo\Foo;
-Foo\Foo::Bar();
-\Foo\Bar();
+Foo::Bar();
+$x = new Foo::Foo;
+Foo::Foo::Bar();
+::Foo::Bar();
--EXPECT--
Method - Foo::__construct
-Func - Foo\Bar
-Method - Foo\Foo::__construct
-Method - Foo\Foo::Bar
-Func - Foo\Bar
+Func - Foo::Bar
+Method - Foo::Foo::__construct
+Method - Foo::Foo::Bar
+Func - Foo::Bar
diff --git a/Zend/tests/ns_029.phpt b/Zend/tests/ns_029.phpt
index f1aa954ae3..d719e9e7cf 100755
--- a/Zend/tests/ns_029.phpt
+++ b/Zend/tests/ns_029.phpt
@@ -2,7 +2,7 @@
029: Name ambiguity (class name & import name)
--FILE--
<?php
-use A\B as Foo;
+use A::B as Foo;
class Foo {
}
diff --git a/Zend/tests/ns_030.phpt b/Zend/tests/ns_030.phpt
index 69724159ee..8aa3223f7e 100755
--- a/Zend/tests/ns_030.phpt
+++ b/Zend/tests/ns_030.phpt
@@ -5,8 +5,8 @@
class Foo {
}
-use A\B as Foo;
+use A::B as Foo;
new Foo();
--EXPECTF--
-Fatal error: Cannot use A\B as Foo because the name is already in use in %sns_030.php on line 5
+Fatal error: Cannot use A::B as Foo because the name is already in use in %sns_030.php on line 5
diff --git a/Zend/tests/ns_031.phpt b/Zend/tests/ns_031.phpt
index 840c08621c..3991c5a107 100755
--- a/Zend/tests/ns_031.phpt
+++ b/Zend/tests/ns_031.phpt
@@ -14,8 +14,8 @@ function foo() {
echo __FUNCTION__,"\n";
}
-call_user_func(__NAMESPACE__."\\foo");
-call_user_func(__NAMESPACE__."\\test::foo");
+call_user_func(__NAMESPACE__."::foo");
+call_user_func(__NAMESPACE__."::test::foo");
--EXPECT--
-test\foo
-test\Test::foo
+test::foo
+test::Test::foo
diff --git a/Zend/tests/ns_032.phpt b/Zend/tests/ns_032.phpt
index 5717a33685..86b24fcdc4 100755
--- a/Zend/tests/ns_032.phpt
+++ b/Zend/tests/ns_032.phpt
@@ -12,8 +12,8 @@ function foo() {
echo __FUNCTION__,"\n";
}
-call_user_func(__NAMESPACE__."\\foo");
-call_user_func(__NAMESPACE__."\\test::foo");
+call_user_func(__NAMESPACE__."::foo");
+call_user_func(__NAMESPACE__."::test::foo");
--EXPECT--
foo
Test::foo
diff --git a/Zend/tests/ns_034.phpt b/Zend/tests/ns_034.phpt
index 76775f1180..f8669cfb74 100755
--- a/Zend/tests/ns_034.phpt
+++ b/Zend/tests/ns_034.phpt
@@ -10,18 +10,23 @@ class Foo {
function f1($x=Foo::C) {
echo $x;
}
-function f2($x=B\Foo::C) {
+function f2($x=A::Foo::C) {
echo $x;
}
-function f3($x=\A\Foo::C) {
+function f3($x=B::Foo::C) {
+ echo $x;
+}
+function f4($x=::A::Foo::C) {
echo $x;
}
echo Foo::C;
-echo B\Foo::C;
-echo \A\Foo::C;
+echo A::Foo::C;
+echo B::Foo::C;
+echo ::A::Foo::C;
f1();
f2();
f3();
+f4();
--EXPECT--
ok
ok
@@ -29,3 +34,5 @@ ok
ok
ok
ok
+ok
+ok
diff --git a/Zend/tests/ns_035.phpt b/Zend/tests/ns_035.phpt
index fcc771a74e..259d17f6e3 100755
--- a/Zend/tests/ns_035.phpt
+++ b/Zend/tests/ns_035.phpt
@@ -5,16 +5,14 @@
--FILE--
<?php
namespace A;
-use \ArrayObject;
-
function f1($x = ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
-function f2($x = \ArrayObject::STD_PROP_LIST) {
+function f2($x = ::ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
var_dump(ArrayObject::STD_PROP_LIST);
-var_dump(\ArrayObject::STD_PROP_LIST);
+var_dump(::ArrayObject::STD_PROP_LIST);
f1();
f2();
diff --git a/Zend/tests/ns_036.phpt b/Zend/tests/ns_036.phpt
index 245cf7d5b5..6fee2cb006 100755
--- a/Zend/tests/ns_036.phpt
+++ b/Zend/tests/ns_036.phpt
@@ -12,23 +12,28 @@ class ArrayObject {
function f1($x = ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
-function f2($x = \ArrayObject::STD_PROP_LIST) {
+function f2($x = ::ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
-function f3($x = \A\ArrayObject::STD_PROP_LIST) {
+function f3($x = A::ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
-function f4($x = B\ArrayObject::STD_PROP_LIST) {
+function f4($x = B::ArrayObject::STD_PROP_LIST) {
+ var_dump($x);
+}
+function f5($x = ::A::ArrayObject::STD_PROP_LIST) {
var_dump($x);
}
var_dump(ArrayObject::STD_PROP_LIST);
-var_dump(\ArrayObject::STD_PROP_LIST);
-var_dump(B\ArrayObject::STD_PROP_LIST);
-var_dump(\A\ArrayObject::STD_PROP_LIST);
+var_dump(::ArrayObject::STD_PROP_LIST);
+var_dump(A::ArrayObject::STD_PROP_LIST);
+var_dump(B::ArrayObject::STD_PROP_LIST);
+var_dump(::A::ArrayObject::STD_PROP_LIST);
f1();
f2();
f3();
f4();
+f5();
?>
--EXPECT--
int(2)
@@ -36,6 +41,8 @@ int(1)
int(2)
int(2)
int(2)
+int(2)
int(1)
int(2)
int(2)
+int(2)
diff --git a/Zend/tests/ns_037.phpt b/Zend/tests/ns_037.phpt
index db0a76e940..ed36e0bb57 100755
--- a/Zend/tests/ns_037.phpt
+++ b/Zend/tests/ns_037.phpt
@@ -15,27 +15,35 @@ class X {
}
}
new X();
-new Y\X();
-new \X\X();
+new X::X();
+new Y::X();
+new ::X::X();
X::bar();
-Y\X::bar();
-\X\X::bar();
+X::X::bar();
+Y::X::bar();
+::X::X::bar();
echo X::C;
-echo Y\X::C;
-echo \X\X::C;
+echo X::X::C;
+echo Y::X::C;
+echo ::X::X::C;
echo X::$var;
-echo Y\X::$var;
-echo \X\X::$var;
+echo X::X::$var;
+echo Y::X::$var;
+echo ::X::X::$var;
--EXPECT--
class ok
class ok
class ok
+class ok
+method ok
method ok
method ok
method ok
const ok
const ok
const ok
+const ok
+var ok
var ok
var ok
var ok
diff --git a/Zend/tests/ns_038.phpt b/Zend/tests/ns_038.phpt
index f3a8c8cc63..fcaa3c4454 100755
--- a/Zend/tests/ns_038.phpt
+++ b/Zend/tests/ns_038.phpt
@@ -6,8 +6,8 @@ namespace Exception;
function foo() {
echo "ok\n";
}
-\Exception\foo();
-\Exception::bar();
+Exception::foo();
+Exception::bar();
--EXPECTF--
ok
diff --git a/Zend/tests/ns_040.phpt b/Zend/tests/ns_040.phpt
index 42a3ac07e9..fb2314466c 100644
--- a/Zend/tests/ns_040.phpt
+++ b/Zend/tests/ns_040.phpt
@@ -9,13 +9,13 @@ const B = A;
function f1($x=A) {
echo $x;
}
-function f2($x=\X\A) {
+function f2($x=X::A) {
echo $x;
}
-function f3($x=Y\A) {
+function f3($x=Y::A) {
echo $x;
}
-function f4($x=\X\A) {
+function f4($x=::X::A) {
echo $x;
}
function f5($x=B) {
@@ -31,9 +31,9 @@ function f8($x=array(A=>"aaa\n")) {
echo $x["ok\n"];
}
echo A;
-echo \X\A;
-echo Y\A;
-echo \X\A;
+echo X::A;
+echo Y::A;
+echo ::X::A;
f1();
f2();
f3();
diff --git a/Zend/tests/ns_041.phpt b/Zend/tests/ns_041.phpt
index 0632fc9815..889f3d82c9 100644
--- a/Zend/tests/ns_041.phpt
+++ b/Zend/tests/ns_041.phpt
@@ -2,13 +2,13 @@
041: Constants in namespace
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
const FOO = "ok\n";
echo(FOO);
-echo(\test\ns1\FOO);
-echo(\test\ns1\FOO);
+echo(test::ns1::FOO);
+echo(::test::ns1::FOO);
echo(BAR);
const BAR = "ok\n";
diff --git a/Zend/tests/ns_042.phpt b/Zend/tests/ns_042.phpt
index ba420a7c80..eecd5f9256 100644
--- a/Zend/tests/ns_042.phpt
+++ b/Zend/tests/ns_042.phpt
@@ -2,18 +2,18 @@
042: Import in namespace and constants
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
const FOO = "ok\n";
-use test\ns1 as ns2;
+use test::ns1 as ns2;
use test as ns3;
echo FOO;
-echo \test\ns1\FOO;
-echo \test\ns1\FOO;
-echo ns2\FOO;
-echo ns3\ns1\FOO;
+echo test::ns1::FOO;
+echo ::test::ns1::FOO;
+echo ns2::FOO;
+echo ns3::ns1::FOO;
--EXPECT--
ok
ok
diff --git a/Zend/tests/ns_043.phpt b/Zend/tests/ns_043.phpt
index bd5ee7440b..63bd05eaaf 100644
--- a/Zend/tests/ns_043.phpt
+++ b/Zend/tests/ns_043.phpt
@@ -2,7 +2,7 @@
043: Name conflict and constants (ns name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
const INI_ALL = 0;
diff --git a/Zend/tests/ns_044.phpt b/Zend/tests/ns_044.phpt
index dbdee2e523..d379b97a24 100644
--- a/Zend/tests/ns_044.phpt
+++ b/Zend/tests/ns_044.phpt
@@ -2,7 +2,7 @@
044: Name conflict and constants (php name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
var_dump(INI_ALL);
--EXPECT--
diff --git a/Zend/tests/ns_045.phpt b/Zend/tests/ns_045.phpt
index d45f9cf99d..d8c942948e 100644
--- a/Zend/tests/ns_045.phpt
+++ b/Zend/tests/ns_045.phpt
@@ -2,10 +2,10 @@
045: Name conflict and constants (php name in case if ns name exists)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
const INI_ALL = 0;
-var_dump(\INI_ALL);
+var_dump(::INI_ALL);
--EXPECT--
int(7)
diff --git a/Zend/tests/ns_046.phpt b/Zend/tests/ns_046.phpt
index d5203f14dc..e48f0cef24 100644
--- a/Zend/tests/ns_046.phpt
+++ b/Zend/tests/ns_046.phpt
@@ -2,10 +2,10 @@
046: Run-time name conflict and constants (ns name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
const INI_ALL = 0;
-var_dump(constant("test\\ns1\\INI_ALL"));
+var_dump(constant("test::ns1::INI_ALL"));
--EXPECT--
int(0)
diff --git a/Zend/tests/ns_047.phpt b/Zend/tests/ns_047.phpt
index 73e32a0de7..89795da256 100644
--- a/Zend/tests/ns_047.phpt
+++ b/Zend/tests/ns_047.phpt
@@ -2,7 +2,7 @@
047: Run-time name conflict and constants (php name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
const INI_ALL = 0;
diff --git a/Zend/tests/ns_048.phpt b/Zend/tests/ns_048.phpt
index db21f89103..3837643cf2 100644
--- a/Zend/tests/ns_048.phpt
+++ b/Zend/tests/ns_048.phpt
@@ -2,10 +2,10 @@
048: __NAMESPACE__ constant and runtime names (ns name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
const FOO = 0;
-var_dump(constant(__NAMESPACE__ . "\\FOO"));
+var_dump(constant(__NAMESPACE__ . "::FOO"));
--EXPECT--
int(0)
diff --git a/Zend/tests/ns_049.phpt b/Zend/tests/ns_049.phpt
index 91e516579b..3e5ccc6783 100644
--- a/Zend/tests/ns_049.phpt
+++ b/Zend/tests/ns_049.phpt
@@ -4,6 +4,6 @@
<?php
const FOO = 0;
-var_dump(constant(__NAMESPACE__ . "\\FOO"));
+var_dump(constant(__NAMESPACE__ . "::FOO"));
--EXPECT--
int(0)
diff --git a/Zend/tests/ns_050.phpt b/Zend/tests/ns_050.phpt
index f827ec858d..9171f6c4b1 100644
--- a/Zend/tests/ns_050.phpt
+++ b/Zend/tests/ns_050.phpt
@@ -2,7 +2,7 @@
050: Name conflict and compile-time constants (ns name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
const INI_ALL = 0;
diff --git a/Zend/tests/ns_051.phpt b/Zend/tests/ns_051.phpt
index b95b53f78b..07985ba106 100644
--- a/Zend/tests/ns_051.phpt
+++ b/Zend/tests/ns_051.phpt
@@ -2,7 +2,7 @@
051: Name conflict and compile-time constants (php name)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
function foo($x = INI_ALL) {
var_dump($x);
diff --git a/Zend/tests/ns_052.phpt b/Zend/tests/ns_052.phpt
index cb0a05ff9f..1f2c4a073f 100644
--- a/Zend/tests/ns_052.phpt
+++ b/Zend/tests/ns_052.phpt
@@ -2,11 +2,11 @@
052: Name conflict and compile-time constants (php name in case if ns name exists)
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
const INI_ALL = 0;
-function foo($x = \INI_ALL) {
+function foo($x = ::INI_ALL) {
var_dump($x);
}
foo();
diff --git a/Zend/tests/ns_053.phpt b/Zend/tests/ns_053.phpt
index bc5ab12cdb..8df545face 100644
--- a/Zend/tests/ns_053.phpt
+++ b/Zend/tests/ns_053.phpt
@@ -2,11 +2,11 @@
053: Run-time constant definition
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
-define(__NAMESPACE__ . '\\NAME', basename(__FILE__));
+define(__NAMESPACE__ . '::NAME', basename(__FILE__));
echo NAME."\n";
-echo \test\ns1\NAME."\n";
+echo test::ns1::NAME."\n";
--EXPECT--
ns_053.php
ns_053.php
diff --git a/Zend/tests/ns_054.phpt b/Zend/tests/ns_054.phpt
index 54ab958611..0eb9e0448f 100755
--- a/Zend/tests/ns_054.phpt
+++ b/Zend/tests/ns_054.phpt
@@ -4,21 +4,21 @@
<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
-class Foo implements \SplObserver {
- function update(\SplSubject $x) {
+class Foo implements SplObserver {
+ function update(::SplSubject $x) {
echo "ok\n";
}
}
-class Bar implements \SplSubject {
- function attach(\SplObserver $x) {
+class Bar implements SplSubject {
+ function attach(::SplObserver $x) {
echo "ok\n";
}
function notify() {
}
- function detach(\SplObserver $x) {
+ function detach(::SplObserver $x) {
}
}
$foo = new Foo();
diff --git a/Zend/tests/ns_055.phpt b/Zend/tests/ns_055.phpt
index a692e47601..83d0613c1e 100755
--- a/Zend/tests/ns_055.phpt
+++ b/Zend/tests/ns_055.phpt
@@ -2,27 +2,32 @@
055: typehints in namespaces
--FILE--
<?php
-namespace test\ns1;
+namespace test::ns1;
class Foo {
function test1(Foo $x) {
echo "ok\n";
}
- function test2(\test\ns1\Foo $x) {
+ function test2(test::ns1::Foo $x) {
echo "ok\n";
}
- function test3(\Exception $x) {
+ function test3(Exception $x) {
+ echo "ok\n";
+ }
+ function test4(::Exception $x) {
echo "ok\n";
}
}
$foo = new Foo();
-$ex = new \Exception();
+$ex = new Exception();
$foo->test1($foo);
$foo->test2($foo);
$foo->test3($ex);
+$foo->test4($ex);
?>
--EXPECT--
ok
ok
ok
+ok
diff --git a/Zend/tests/ns_056.phpt b/Zend/tests/ns_056.phpt
index 2390608d4e..0bc4f0087d 100755
--- a/Zend/tests/ns_056.phpt
+++ b/Zend/tests/ns_056.phpt
@@ -4,16 +4,15 @@
<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
--FILE--
<?php
-namespace test\ns1;
-use \SplObserver;
+namespace test::ns1;
class Foo implements SplObserver {
- function update(\SplSubject $x) {
+ function update(SplSubject $x) {
echo "ok\n";
}
}
-class Bar implements \SplSubject {
+class Bar implements SplSubject {
function attach(SplObserver $x) {
echo "ok\n";
}
diff --git a/Zend/tests/ns_057.phpt b/Zend/tests/ns_057.phpt
index 13bf3054cc..cfa02f923f 100755
--- a/Zend/tests/ns_057.phpt
+++ b/Zend/tests/ns_057.phpt
@@ -1,8 +1,8 @@
--TEST--
-057: Usage of 'namespace' in compound names (inside namespace)
+057: Usage of 'namespace' in compound names (inside namespase)
--FILE--
<?php
-namespace Test\ns1;
+namespace Test::ns1;
const C = "const ok\n";
@@ -12,7 +12,7 @@ function foo() {
class foo {
const C = "const ok\n";
- const C2 = namespace\C;
+ const C2 = namespace::C;
static $var = "var ok\n";
function __construct() {
echo "class ok\n";
@@ -22,27 +22,26 @@ class foo {
}
}
-function f1($x=namespace\C) {
+function f1($x=namespace::C) {
return $x;
}
-function f2($x=namespace\foo::C) {
+function f2($x=namespace::foo::C) {
return $x;
}
-function f3(namespace\foo $x) {
+function f3(namespace::foo $x) {
return "ok\n";
}
-echo namespace\C;
-echo namespace\foo();
-echo namespace\foo::C;
-echo namespace\foo::C2;
-echo namespace\foo::$var;
-echo namespace\foo::bar();
-echo namespace\f1();
-echo namespace\f2();
-echo namespace\f3(new namespace\foo());
-echo namespace\unknown;
+echo namespace::C;
+echo namespace::foo();
+echo namespace::foo::C;
+echo namespace::foo::C2;
+echo namespace::foo::$var;
+echo namespace::foo::bar();
+echo namespace::f1();
+echo namespace::f2();
+echo namespace::f3(new namespace::foo());
?>
--EXPECTF--
const ok
@@ -55,5 +54,3 @@ const ok
const ok
class ok
ok
-
-Fatal error: Undefined constant 'Test\ns1\unknown' in %sns_057.php on line %d \ No newline at end of file
diff --git a/Zend/tests/ns_058.phpt b/Zend/tests/ns_058.phpt
index 7a0cd97d92..6c86f10f9d 100755
--- a/Zend/tests/ns_058.phpt
+++ b/Zend/tests/ns_058.phpt
@@ -10,7 +10,7 @@ function foo() {
class foo {
const C = "const ok\n";
- const C2 = namespace\C;
+ const C2 = namespace::C;
static $var = "var ok\n";
function __construct() {
echo "class ok\n";
@@ -20,29 +20,28 @@ class foo {
}
}
-function f1($x=namespace\C) {
+function f1($x=namespace::C) {
return $x;
}
-function f2($x=namespace\foo::C) {
+function f2($x=namespace::foo::C) {
return $x;
}
-function f3(namespace\foo $x) {
+function f3(namespace::foo $x) {
return "ok\n";
}
-echo namespace\C;
-echo namespace\foo();
-echo namespace\foo::C;
-echo namespace\foo::C2;
-echo namespace\foo::$var;
-echo namespace\foo::bar();
-echo namespace\f1();
-echo namespace\f2();
-echo namespace\f3(new namespace\foo());
-echo namespace\unknown;
+echo namespace::C;
+echo namespace::foo();
+echo namespace::foo::C;
+echo namespace::foo::C2;
+echo namespace::foo::$var;
+echo namespace::foo::bar();
+echo namespace::f1();
+echo namespace::f2();
+echo namespace::f3(new namespace::foo());
?>
---EXPECTF--
+--EXPECT--
const ok
func ok
const ok
@@ -53,5 +52,3 @@ const ok
const ok
class ok
ok
-
-Fatal error: Undefined constant 'unknown' in %sns_058.php on line %d
diff --git a/Zend/tests/ns_060.phpt b/Zend/tests/ns_060.phpt
index 16c8024f00..cc86d0e087 100644
--- a/Zend/tests/ns_060.phpt
+++ b/Zend/tests/ns_060.phpt
@@ -3,21 +3,21 @@
--FILE--
<?php
namespace Foo;
-use Bar\A as B;
+use Bar::A as B;
class A {}
$a = new B;
$b = new A;
echo get_class($a)."\n";
echo get_class($b)."\n";
namespace Bar;
-use Foo\A as B;
+use Foo::A as B;
$a = new B;
$b = new A;
echo get_class($a)."\n";
echo get_class($b)."\n";
class A {}
--EXPECT--
-Bar\A
-Foo\A
-Foo\A
-Bar\A
+Bar::A
+Foo::A
+Foo::A
+Bar::A
diff --git a/Zend/tests/ns_061.phpt b/Zend/tests/ns_061.phpt
index 948f675d6d..a02f63d71f 100644
--- a/Zend/tests/ns_061.phpt
+++ b/Zend/tests/ns_061.phpt
@@ -3,7 +3,7 @@
--FILE--
<?php
class A {}
-use \A as B;
+use ::A as B;
echo get_class(new B)."\n";
--EXPECT--
A
diff --git a/Zend/tests/ns_062.phpt b/Zend/tests/ns_062.phpt
index d795da4c68..07043dbf68 100644
--- a/Zend/tests/ns_062.phpt
+++ b/Zend/tests/ns_062.phpt
@@ -1,10 +1,10 @@
--TEST--
-062: use \global class
+062: use ::global class
--FILE--
<?php
namespace Foo;
-use \stdClass;
-use \stdClass as A;
+use ::stdClass;
+use ::stdClass as A;
echo get_class(new stdClass)."\n";
echo get_class(new A)."\n";
--EXPECT--
diff --git a/Zend/tests/ns_064.phpt b/Zend/tests/ns_064.phpt
index 0a7c4bc82d..29e9e56714 100644
--- a/Zend/tests/ns_064.phpt
+++ b/Zend/tests/ns_064.phpt
@@ -21,7 +21,7 @@ class foo {
}
}
-use test\foo as stdClass;
+use test::foo as stdClass;
$x = new stdClass;
$x->a = 1;
diff --git a/Zend/tests/ns_065.inc b/Zend/tests/ns_065.inc
index 963a74e140..a625a4a1b4 100755
--- a/Zend/tests/ns_065.inc
+++ b/Zend/tests/ns_065.inc
@@ -1,9 +1,9 @@
<?php
-namespace X\Y;
+namespace X::Y;
function foo() {
echo __FUNCTION__."\n";
}
-namespace X\Z;
+namespace X::Z;
function foo() {
echo __FUNCTION__."\n";
}
diff --git a/Zend/tests/ns_065.phpt b/Zend/tests/ns_065.phpt
index 40ccd1e153..8d7e7fbb1a 100755
--- a/Zend/tests/ns_065.phpt
+++ b/Zend/tests/ns_065.phpt
@@ -2,12 +2,12 @@
065: Multiple names in use statement
--FILE--
<?php
-use X\Y as test, X\Z as test2;
+use X::Y as test, X::Z as test2;
require "ns_065.inc";
-test\foo();
-test2\foo();
+test::foo();
+test2::foo();
--EXPECT--
-X\Y\foo
-X\Z\foo
+X::Y::foo
+X::Z::foo
diff --git a/Zend/tests/ns_066.phpt b/Zend/tests/ns_066.phpt
index 881589cf2c..3a7d9a521f 100644
--- a/Zend/tests/ns_066.phpt
+++ b/Zend/tests/ns_066.phpt
@@ -3,8 +3,8 @@
--FILE--
<?php
include __DIR__ . '/ns_027.inc';
-use Foo\Bar\Foo as stdClass;
+use Foo::Bar::Foo as stdClass;
new stdClass();
--EXPECT--
-Foo\Bar\Foo
+Foo::Bar::Foo
diff --git a/Zend/tests/ns_067.inc b/Zend/tests/ns_067.inc
index c3c14b1468..09327b276d 100644
--- a/Zend/tests/ns_067.inc
+++ b/Zend/tests/ns_067.inc
@@ -1,3 +1,3 @@
<?php
-use Foo\Bar\Foo as Test;
+use Foo::Bar::Foo as Test;
new Test();
diff --git a/Zend/tests/ns_067.phpt b/Zend/tests/ns_067.phpt
index b94eb30ead..c5096278db 100644
--- a/Zend/tests/ns_067.phpt
+++ b/Zend/tests/ns_067.phpt
@@ -6,4 +6,4 @@ include __DIR__ . '/ns_022.inc';
include __DIR__ . '/ns_027.inc';
include __DIR__ . '/ns_067.inc';
--EXPECT--
-Foo\Bar\Foo
+Foo::Bar::Foo
diff --git a/Zend/tests/zend_strtod.phpt b/Zend/tests/zend_strtod.phpt
index 7f4bca5966..1b11be0388 100644
--- a/Zend/tests/zend_strtod.phpt
+++ b/Zend/tests/zend_strtod.phpt
@@ -15,5 +15,5 @@ echo "Done\n";
float(-100)
float(808792757210)
float(-4.5646456464565E+27)
-float(-1.1276204760067E+16)
+float(-11276204760067000)
Done