Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Next step in namespaces, using / as namespace separator.

  • Loading branch information...
commit 7126de4912d9d4c7499deb1f9239980400aa7ec7 1 parent 6ca3ad3
Marcus Boerger authored
Showing with 3,739 additions and 3,571 deletions.
  1. +1 −1  NEWS
  2. +5 −5 Zend/tests/bug42802.phpt
  3. +83 −65 Zend/tests/bug42819.phpt
  4. +10 −10 Zend/tests/bug42820.phpt
  5. +3 −3 Zend/tests/bug42859.phpt
  6. +2 −2 Zend/tests/bug43183.phpt
  7. +1 −1  Zend/tests/bug43332_1.phpt
  8. +2 −2 Zend/tests/bug43332_2.phpt
  9. +1 −1  Zend/tests/bug43343.phpt
  10. +1 −1  Zend/tests/bug43344_10.phpt
  11. +1 −1  Zend/tests/bug43344_11.phpt
  12. +1 −1  Zend/tests/bug43344_12.phpt
  13. +1 −1  Zend/tests/bug43344_13.phpt
  14. +1 −1  Zend/tests/bug43344_2.phpt
  15. +1 −1  Zend/tests/bug43344_3.phpt
  16. +1 −1  Zend/tests/bug43344_4.phpt
  17. +1 −1  Zend/tests/bug43344_5.phpt
  18. +2 −2 Zend/tests/bug43344_6.phpt
  19. +2 −2 Zend/tests/bug43344_7.phpt
  20. +2 −2 Zend/tests/bug43344_8.phpt
  21. +2 −2 Zend/tests/bug43344_9.phpt
  22. +13 −13 Zend/tests/bug43651.phpt
  23. +9 −5 Zend/tests/bug44653.phpt
  24. +8 −8 Zend/tests/class_alias_012.phpt
  25. +7 −7 Zend/tests/class_alias_013.phpt
  26. +3 −3 Zend/tests/class_alias_015.phpt
  27. +4 −4 Zend/tests/class_alias_016.phpt
  28. +2 −2 Zend/tests/class_alias_019.phpt
  29. +8 −8 Zend/tests/class_alias_020.phpt
  30. +7 −7 Zend/tests/class_alias_021.phpt
  31. +6 −6 Zend/tests/class_constants_004.phpt
  32. +4 −4 Zend/tests/class_exists_001.phpt
  33. +1 −1  Zend/tests/constants_003.phpt
  34. +1 −1  Zend/tests/constants_004.phpt
  35. +2 −2 Zend/tests/constants_006.phpt
  36. +5 −3 Zend/tests/constants_009.phpt
  37. +1 −1  Zend/tests/inter_02.phpt
  38. +2 −2 Zend/tests/interface_exists_002.phpt
  39. +2 −2 Zend/tests/lsb_014.phpt
  40. +9 −9 Zend/tests/ns_001.phpt
  41. +12 −12 Zend/tests/ns_002.phpt
  42. +2 −2 Zend/tests/ns_003.phpt
  43. +1 −1  Zend/tests/ns_004.phpt
  44. +2 −2 Zend/tests/ns_005.phpt
  45. +3 −3 Zend/tests/ns_006.phpt
  46. +1 −1  Zend/tests/ns_007.phpt
  47. +2 −2 Zend/tests/ns_008.phpt
  48. +1 −1  Zend/tests/ns_009.phpt
  49. +12 −12 Zend/tests/ns_010.phpt
  50. +7 −7 Zend/tests/ns_011.phpt
  51. +16 −16 Zend/tests/ns_012.phpt
  52. +2 −2 Zend/tests/ns_013.phpt
  53. +1 −1  Zend/tests/ns_014.phpt
  54. +2 −2 Zend/tests/ns_015.phpt
  55. +3 −3 Zend/tests/ns_016.phpt
  56. +1 −1  Zend/tests/ns_017.phpt
  57. +2 −2 Zend/tests/ns_018.phpt
  58. +1 −1  Zend/tests/ns_019.phpt
  59. +7 −7 Zend/tests/ns_020.phpt
  60. +5 −5 Zend/tests/ns_021.phpt
  61. +5 −5 Zend/tests/ns_022.phpt
  62. +3 −3 Zend/tests/ns_023.phpt
  63. +7 −7 Zend/tests/ns_025.phpt
  64. +13 −10 Zend/tests/ns_026.phpt
  65. +1 −1  Zend/tests/ns_027.inc
  66. +4 −4 Zend/tests/ns_027.phpt
  67. +8 −8 Zend/tests/ns_028.phpt
  68. +1 −1  Zend/tests/ns_029.phpt
  69. +2 −2 Zend/tests/ns_030.phpt
  70. +4 −4 Zend/tests/ns_031.phpt
  71. +2 −2 Zend/tests/ns_032.phpt
  72. +6 −6 Zend/tests/ns_034.phpt
  73. +2 −2 Zend/tests/ns_035.phpt
  74. +8 −8 Zend/tests/ns_036.phpt
  75. +12 −12 Zend/tests/ns_037.phpt
  76. +1 −1  Zend/tests/ns_038.phpt
  77. +6 −6 Zend/tests/ns_040.phpt
  78. +3 −3 Zend/tests/ns_041.phpt
  79. +6 −6 Zend/tests/ns_042.phpt
  80. +1 −1  Zend/tests/ns_043.phpt
  81. +1 −1  Zend/tests/ns_044.phpt
  82. +2 −2 Zend/tests/ns_045.phpt
  83. +2 −2 Zend/tests/ns_046.phpt
  84. +1 −1  Zend/tests/ns_047.phpt
  85. +2 −2 Zend/tests/ns_048.phpt
  86. +1 −1  Zend/tests/ns_049.phpt
  87. +1 −1  Zend/tests/ns_050.phpt
  88. +1 −1  Zend/tests/ns_051.phpt
  89. +2 −2 Zend/tests/ns_052.phpt
  90. +3 −3 Zend/tests/ns_053.phpt
  91. +4 −4 Zend/tests/ns_054.phpt
  92. +3 −3 Zend/tests/ns_055.phpt
  93. +1 −1  Zend/tests/ns_056.phpt
  94. +15 −15 Zend/tests/ns_057.phpt
  95. +13 −13 Zend/tests/ns_058.phpt
  96. +6 −6 Zend/tests/ns_060.phpt
  97. +1 −1  Zend/tests/ns_061.phpt
  98. +3 −3 Zend/tests/ns_062.phpt
  99. +1 −1  Zend/tests/ns_064.phpt
  100. +2 −2 Zend/tests/ns_065.inc
  101. +5 −5 Zend/tests/ns_065.phpt
  102. +2 −2 Zend/tests/ns_066.phpt
  103. +1 −1  Zend/tests/ns_067.inc
  104. +1 −1  Zend/tests/ns_067.phpt
  105. +7 −9 Zend/zend_API.c
  106. +1 −1  Zend/zend_API.h
  107. +284 −147 Zend/zend_compile.c
  108. +2 −1  Zend/zend_compile.h
  109. +60 −51 Zend/zend_constants.c
  110. +77 −33 Zend/zend_execute_API.c
  111. +28 −24 Zend/zend_language_parser.y
  112. +2,616 −2,606 Zend/zend_language_scanner.c
  113. +4 −0 Zend/zend_language_scanner.l
  114. +1 −1  Zend/zend_language_scanner_defs.h
  115. +38 −42 Zend/zend_vm_def.h
  116. +118 −180 Zend/zend_vm_execute.h
  117. +20 −20 ext/reflection/php_reflection.c
  118. +4 −4 ext/reflection/tests/ReflectionFunction_getNamespaceName.phpt
  119. +4 −4 ext/reflection/tests/reflectionClass_getNamespaceName.phpt
  120. +2 −2 ext/standard/credits.c
  121. +2 −2 ext/standard/var_unserializer.c
  122. +1 −1  ext/standard/var_unserializer.re
View
2  NEWS
@@ -157,7 +157,7 @@ PHP NEWS
. Improved syntax highlighting and consistency for variables in double-quoted
strings and literal text in HEREDOCs and backticks. (Matt)
. Added "?:" operator. (Marcus)
- . Added support for namespaces. (Dmitry, Stas, Gregory)
+ . Added support for namespaces. (Dmitry, Stas, Gregory, Marcus)
. Added support for Late Static Binding. (Dmitry, Etienne Kneuss)
. Added support for __callStatic() magic method. (Sara)
. Added forward_static_call(_array) to complete LSB. (Mike Lively)
View
10 Zend/tests/bug42802.phpt
@@ -11,19 +11,19 @@ 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(Exception $e) {
echo "ok\n";
}
-function test6(::bar $bar) {
+function test6(\bar $bar) {
echo "bug\n";
}
@@ -42,4 +42,4 @@ ok
ok
ok
-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
+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
View
148 Zend/tests/bug42819.phpt
@@ -4,88 +4,100 @@ 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;
-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::C;
-echo ::foo::foo::C;
+echo \foo\foo::C;
echo ArrayObject::STD_PROP_LIST . "\n";
echo E_ERROR . "\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 "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";
print_r(bar1::$a1);
print_r(bar1::$a2);
@@ -126,20 +138,24 @@ print_r(bar5::$a4);
print_r(bar5::$a5);
print_r(bar5::$a6);
print_r(bar5::$a7);
+function oops($a = array(foo\unknown)){}
+oops();
?>
---EXPECT--
-foo::C
-foo::C
-foo::foo::C
-foo::C
-foo::foo::C
+--EXPECTF--
+first
+foo\C
+foo\foo\C
+foo\foo\foo::C
+foo\foo::C
+foo\foo::C
1
1
-foo::C
-foo::C
-foo::foo::C
-foo::C
-foo::foo::C
+second
+foo\C
+foo\foo\C
+foo\foo\foo::C
+foo\C
+foo\foo::C
1
1
Array
@@ -148,11 +164,11 @@ Array
)
Array
(
- [11] => 0
+ [12] => 0
)
Array
(
- [22] => 0
+ [32] => 0
)
Array
(
@@ -176,11 +192,11 @@ Array
)
Array
(
- [11] => 11
+ [12] => 11
)
Array
(
- [22] => 11
+ [32] => 11
)
Array
(
@@ -200,31 +216,31 @@ Array
)
Array
(
- [11] => 11
+ [11] => 12
)
Array
(
- [11] => 11
+ [12] => 12
)
Array
(
- [22] => 11
+ [32] => 12
)
Array
(
- [11] => 11
+ [11] => 12
)
Array
(
- [22] => 11
+ [22] => 12
)
Array
(
- [1] => 11
+ [1] => 12
)
Array
(
- [1] => 11
+ [1] => 12
)
Array
(
@@ -232,11 +248,11 @@ Array
)
Array
(
- [11] => 1
+ [12] => 1
)
Array
(
- [22] => 1
+ [32] => 1
)
Array
(
@@ -260,11 +276,11 @@ Array
)
Array
(
- [11] => 1
+ [12] => 1
)
Array
(
- [22] => 1
+ [32] => 1
)
Array
(
@@ -282,3 +298,5 @@ Array
(
[1] => 1
)
+
+Fatal error: Undefined constant 'foo\foo\unknown' in %sbug42819.php on line %d
View
20 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)
View
6 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
View
4 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
View
2  Zend/tests/bug43332_1.phpt
@@ -12,4 +12,4 @@ $foo = new foo;
$foo->bar($foo); // 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
View
4 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 a wrong class name in %sbug43332_2.php on line 5
+Fatal error: 'self' is an invalid class name in %sbug43332_2.php on line 5
View
2  Zend/tests/bug43343.phpt
@@ -8,4 +8,4 @@ $foo = 'bar';
var_dump(new namespace::$foo);
?>
--EXPECTF--
-Fatal error: Cannot use 'namespace' as a class name in %sbug43343.php on line 5
+Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_NS_SEPARATOR in %sbug43343.php on line 5
View
2  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
View
2  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";
View
2  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";
View
2  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);
}
View
2  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
View
2  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
View
2  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
View
2  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
View
4 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
View
4 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
View
4 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
View
4 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
View
26 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)
View
14 Zend/tests/bug44653.phpt
@@ -14,13 +14,17 @@ class B {
static function fooBar() { echo "bag2\n"; }
}
function fooBar() { echo __FUNCTION__ . PHP_EOL; }
-var_dump(A::XX);
+var_dump(\A\XX);
A::fooBar();
-fooBar();
+\A\fooBar();
B::fooBar();
+fooBar();
+\B\fooBar();
?>
--EXPECT--
int(1)
-A::fooBar
-B::fooBar
-B::fooBar
+bag1
+A\fooBar
+bag2
+B\fooBar
+B\fooBar
View
16 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) {
}
View
14 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) {
}
View
6 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) {
}
View
8 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
View
4 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--
View
16 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
View
14 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 foo::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) {
}
View
12 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
View
8 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'));
?>
View
2  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--
View
2  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
View
4 Zend/tests/constants_006.phpt
@@ -26,7 +26,7 @@ var_dump(__namespace__);
string(%d) "%s"
string(%d) "%s"
int(%d)
-string(22) "test::foo::__construct"
-string(9) "test::foo"
+string(21) "test\foo::__construct"
+string(8) "test\foo"
string(11) "__construct"
string(4) "test"
View
8 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,8 +12,10 @@ 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--
View
2  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);
}
View
4 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--
View
4 Zend/tests/lsb_014.phpt
@@ -1,5 +1,5 @@
---TEST--
-ZE2 Late Static Binding access to static::const through defined() anf get_constant()
+--TEST--
+ZE2 Late Static Binding access to static::const through defined() and get_constant()
--FILE--
<?php
View
18 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
View
24 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
View
4 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
View
2  Zend/tests/ns_004.phpt
@@ -2,7 +2,7 @@
004: Name conflict (php name)
--FILE--
<?php
-namespace test::ns1;
+namespace test\ns1;
echo get_class(new Exception()),"\n";
--EXPECT--
View
4 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
View
6 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
View
2  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 {
}
View
4 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
View
2  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
View
24 Zend/tests/ns_010.phpt
@@ -15,21 +15,21 @@ class Foo {
}
}
new Foo();
-new X::Foo();
-new Y::Foo();
-new ::X::Foo();
+new X\Foo();
+new Y\Foo();
+new \X\Foo();
Foo::bar();
-X::Foo::bar();
-Y::Foo::bar();
-::X::Foo::bar();
+X\Foo::bar();
+Y\Foo::bar();
+\X\Foo::bar();
echo Foo::C;
-echo X::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 X::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
View
14 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
View
32 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
View
4 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
View
2  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--
View
4 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
View
6 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
View
2  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__;
View
4 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
View
2  Zend/tests/ns_019.phpt
@@ -6,7 +6,7 @@ function foo() {
return __FUNCTION__;
}
-$x = __NAMESPACE__ . "::foo";
+$x = __NAMESPACE__ . "\\foo";
echo $x(),"\n";
--EXPECT--
foo
View
14 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
View
10 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
View
10 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
View
6 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(9) "test::foo"
+string(8) "test\foo"
--UEXPECT--
-unicode(9) "test::foo"
+unicode(8) "test\foo"
View
14 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
View
23 Zend/tests/ns_026.phpt
@@ -18,13 +18,16 @@ function Bar() {
}
$x = new Foo;
-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
+\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
View
2  Zend/tests/ns_027.inc
@@ -1,5 +1,5 @@
<?php
-namespace Foo::Bar;
+namespace Foo\Bar;
class Foo {
function __construct() {
View
8 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
View
16 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
View
2  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 {
}
View
4 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
View
8 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
View
4 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
View
12 Zend/tests/ns_034.phpt
@@ -10,19 +10,19 @@ class Foo {
function f1($x=Foo::C) {
echo $x;
}
-function f2($x=A::Foo::C) {
+function f2($x=A\Foo::C) {
echo $x;
}
-function f3($x=B::Foo::C) {
+function f3($x=B\Foo::C) {
echo $x;
}
-function f4($x=::A::Foo::C) {
+function f4($x=\A\Foo::C) {
echo $x;
}
echo Foo::C;
-echo A::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();
View
4 Zend/tests/ns_035.phpt
@@ -8,11 +8,11 @@ namespace A;
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();
View
16 Zend/tests/ns_036.phpt
@@ -12,23 +12,23 @@ 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) {
+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(A::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();
View
24 Zend/tests/ns_037.phpt
@@ -15,21 +15,21 @@ class X {
}
}
new X();
-new X::X();
-new Y::X();
-new ::X::X();
+new X\X();
+new Y\X();
+new \X\X();
X::bar();
-X::X::bar();
-Y::X::bar();
-::X::X::bar();
+X\X::bar();
+Y\X::bar();
+\X\X::bar();
echo X::C;
-echo X::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 X::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
View
2  Zend/tests/ns_038.phpt
@@ -6,7 +6,7 @@ namespace Exception;
function foo() {
echo "ok\n";
}
-Exception::foo();
+\Exception\foo();
Exception::bar();
--EXPECTF--
ok
View
12 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();
View
6 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";
View
12 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
View
2  Zend/tests/ns_043.phpt