Skip to content

Commit 0516656

Browse files
committed
Fix declare encoding tests
Also add a test for bwoebi's last change.
1 parent c637ba1 commit 0516656

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

Zend/tests/declare_002.phpt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22
Testing declare statement with several type values
33
--SKIPIF--
44
<?php
5-
if (!ini_get("zend.multibyte")) {
6-
die("skip Requires zend.multibyte=1");
7-
}
85
if (!extension_loaded("mbstring")) {
96
die("skip Requires ext/mbstring");
107
}
118
?>
9+
--INI--
10+
zend.multibyte=1
1211
--FILE--
1312
<?php
1413

1514
declare(encoding = 1);
1615
declare(encoding = 1123131232131312321);
17-
declare(encoding = NULL);
1816
declare(encoding = 'utf-8');
1917
declare(encoding = M_PI);
2018

@@ -26,6 +24,4 @@ Warning: Unsupported encoding [%d] in %sdeclare_002.php on line 3
2624

2725
Warning: Unsupported encoding [%f] in %sdeclare_002.php on line 4
2826

29-
Warning: Unsupported encoding [] in %sdeclare_002.php on line 5
30-
31-
Fatal error: Cannot use constants as encoding in %sdeclare_002.php on line 7
27+
Fatal error: Encoding must be a literal in %sdeclare_002.php on line 6

Zend/tests/declare_004.phpt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
--TEST--
22
Testing declare statement with several type values
3-
--SKIPIF--
4-
<?php
5-
if (!ini_get("zend.multibyte")) {
6-
die("skip Requires zend.multibyte=1");
7-
}
8-
?>
3+
--INI--
4+
zend.multibyte=1
95
--FILE--
106
<?php
117

128
declare(encoding = 1);
139
declare(encoding = 1123131232131312321);
14-
declare(encoding = NULL);
1510
declare(encoding = M_PI);
1611

1712
print 'DONE';
@@ -22,6 +17,4 @@ Warning: Unsupported encoding [%d] in %sdeclare_004.php on line 3
2217

2318
Warning: Unsupported encoding [%f] in %sdeclare_004.php on line 4
2419

25-
Warning: Unsupported encoding [] in %sdeclare_004.php on line 5
26-
27-
Fatal error: Cannot use constants as encoding in %sdeclare_004.php on line 6
20+
Fatal error: Encoding must be a literal in %sdeclare_004.php on line 5
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--TEST--
2+
Accessing self::FOO outside a class
3+
--FILE--
4+
<?php
5+
var_dump(self::FOO);
6+
?>
7+
--EXPECTF--
8+
Fatal error: Cannot access self:: when no class scope is active in %s on line %d

0 commit comments

Comments
 (0)