From: Marcus Boerger Date: Sun, 30 Nov 2003 13:57:20 +0000 (+0000) Subject: Fix tests for E_STRICT and check for E_STRICT in run-tests.php. X-Git-Tag: php-5.0.0b3RC1~486 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3fddcab622186c9bdbca89a1af7b14df0ba6345;p=php Fix tests for E_STRICT and check for E_STRICT in run-tests.php. --- diff --git a/ext/session/tests/001.phpt b/ext/session/tests/001.phpt index f499029a73..54918b5799 100644 --- a/ext/session/tests/001.phpt +++ b/ext/session/tests/001.phpt @@ -12,7 +12,7 @@ session.serialize_handler=php error_reporting(E_ALL); class foo { - var $bar = "ok"; + public $bar = "ok"; function method() { $this->yes = "done"; } } diff --git a/ext/session/tests/003.phpt b/ext/session/tests/003.phpt index f9fa28f4ea..fed90902cd 100644 --- a/ext/session/tests/003.phpt +++ b/ext/session/tests/003.phpt @@ -12,7 +12,7 @@ session.serialize_handler=php error_reporting(E_ALL); class foo { - var $bar = "ok"; + public $bar = "ok"; function method() { $this->yes++; } } diff --git a/ext/session/tests/004.phpt b/ext/session/tests/004.phpt index 79383705e6..2040476bc0 100644 --- a/ext/session/tests/004.phpt +++ b/ext/session/tests/004.phpt @@ -13,7 +13,7 @@ session.serialize_handler=php error_reporting(E_ALL); class handler { - var $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}'; + public $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}'; function open($save_path, $session_name) { print "OPEN: $session_name\n"; @@ -48,7 +48,7 @@ class handler { $hnd = new handler; class foo { - var $bar = "ok"; + public $bar = "ok"; function method() { $this->yes++; } } diff --git a/ext/session/tests/005.phpt b/ext/session/tests/005.phpt index 6127ad22f2..5638376b9d 100644 --- a/ext/session/tests/005.phpt +++ b/ext/session/tests/005.phpt @@ -14,7 +14,7 @@ session.serialize_handler=php error_reporting(E_ALL); class handler { - var $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}'; + public $data = 'baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}'; function open($save_path, $session_name) { print "OPEN: $session_name\n"; @@ -50,7 +50,7 @@ class handler { $hnd = new handler; class foo { - var $bar = "ok"; + public $bar = "ok"; function method() { $this->yes++; } } diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt index d93474765d..fb355976fb 100644 --- a/ext/session/tests/006.phpt +++ b/ext/session/tests/006.phpt @@ -15,11 +15,11 @@ session_id("abtest"); session_start(); class a { - var $test = "hallo"; + public $test = "hallo"; } class b { - var $a; + public $a; function b(&$a) { $this->a = &$a; } diff --git a/ext/session/tests/019.phpt b/ext/session/tests/019.phpt index 0e274b1536..c258d3ba57 100644 --- a/ext/session/tests/019.phpt +++ b/ext/session/tests/019.phpt @@ -13,7 +13,7 @@ session.serialize_handler=php error_reporting(E_ALL); class TFoo { - var $c; + public $c; function TFoo($c) { $this->c = $c; } diff --git a/ext/standard/tests/file/fopencookie.phpt b/ext/standard/tests/file/fopencookie.phpt index 89886559d1..1b2cfb17b8 100644 --- a/ext/standard/tests/file/fopencookie.phpt +++ b/ext/standard/tests/file/fopencookie.phpt @@ -18,8 +18,8 @@ fopencookie detected and working (or cast mechanism works) */ class userstream { - var $position = 0; - var $data = "If you can read this, it worked"; + public $position = 0; + public $data = "If you can read this, it worked"; function stream_open($path, $mode, $options, &$opened_path) { diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt index 1606d89f06..124825f24e 100644 --- a/ext/standard/tests/file/userstreams.phpt +++ b/ext/standard/tests/file/userstreams.phpt @@ -82,12 +82,12 @@ class uselessstream class mystream { - var $path; - var $mode; - var $options; + public $path; + public $mode; + public $options; - var $position; - var $varname; + public $position; + public $varname; function stream_open($path, $mode, $options, &$opened_path) { diff --git a/ext/standard/tests/serialize/bug21957.phpt b/ext/standard/tests/serialize/bug21957.phpt index af2003f3e3..29eeb2ee6c 100644 --- a/ext/standard/tests/serialize/bug21957.phpt +++ b/ext/standard/tests/serialize/bug21957.phpt @@ -4,7 +4,7 @@ Bug #21957 (serialize() mangles objects with __sleep) 'foo1_value', FOO2=>'foo2_value'); + public $a_var = array(FOO1=>'foo1_value', FOO2=>'foo2_value'); } class B extends A { - var $b_var = 'foo'; + public $b_var = 'foo'; } diff --git a/tests/classes/bug24399.phpt b/tests/classes/bug24399.phpt index 1c62b5bd4a..fedf8e5d24 100644 --- a/tests/classes/bug24399.phpt +++ b/tests/classes/bug24399.phpt @@ -3,7 +3,7 @@ Bug #24399 (is_subclass_of() crashes when parent class doesn't exist) --FILE-- a."\n"; @@ -19,7 +19,7 @@ class foo { }; class bar extends foo { - var $c; + public $c; function display() { /* alternative display function for class bar */ echo "This is class bar\n"; echo "a = ".$this->a."\n"; diff --git a/tests/classes/interface_doubled.phpt b/tests/classes/interface_doubled.phpt index fa190c767a..dbc23de754 100644 --- a/tests/classes/interface_doubled.phpt +++ b/tests/classes/interface_doubled.phpt @@ -30,7 +30,7 @@ interface if_f extends if_e implements if_a, if_b, if_c, if_d, if_e { class base { function test($class) { - echo "is_a(" . get_class($this) . ", $class) ". (is_a($this, $class) ? "yes\n" : "no\n"); + echo "is_a(" . get_class($this) . ", $class) ". (($this instanceof $class) ? "yes\n" : "no\n"); } } diff --git a/tests/classes/interface_implemented.phpt b/tests/classes/interface_implemented.phpt index 4d101762fc..0f5e5cbe7b 100644 --- a/tests/classes/interface_implemented.phpt +++ b/tests/classes/interface_implemented.phpt @@ -15,7 +15,7 @@ interface if_b extends if_a { class base { function _is_a($sub) { - echo 'is_a('.get_class($this).', '.$sub.') = '.(is_a($this, $sub) ? 'yes' : 'no')."\n"; + echo 'is_a('.get_class($this).', '.$sub.') = '.(($this instanceof $sub) ? 'yes' : 'no')."\n"; } function test() { echo $this->_is_a('base'); diff --git a/tests/classes/interface_member.phpt b/tests/classes/interface_member.phpt index 91ff17af1d..329c0728b5 100644 --- a/tests/classes/interface_member.phpt +++ b/tests/classes/interface_member.phpt @@ -6,7 +6,7 @@ ZE2 An interface cannot have properties --EXPECTF-- diff --git a/tests/classes/object_reference_001.phpt b/tests/classes/object_reference_001.phpt index 360d19e10b..74acb5de13 100644 --- a/tests/classes/object_reference_001.phpt +++ b/tests/classes/object_reference_001.phpt @@ -6,7 +6,7 @@ ZE2 object references name = "I'm Foo!\n"; diff --git a/tests/lang/bug21669.phpt b/tests/lang/bug21669.phpt index f81011cf6f..643b0695ee 100644 --- a/tests/lang/bug21669.phpt +++ b/tests/lang/bug21669.phpt @@ -9,7 +9,7 @@ class Test { } class Factory { - var $name = "Test"; + public $name = "Test"; function create() { $obj = new $this->name; /* Parse error */ return $obj; diff --git a/tests/lang/bug21961.phpt b/tests/lang/bug21961.phpt index eb2e8d2ce3..24581d663e 100644 --- a/tests/lang/bug21961.phpt +++ b/tests/lang/bug21961.phpt @@ -7,7 +7,7 @@ Bug #21961 (get_parent_class() segfault) class man { - var $name, $bars; + public $name, $bars; function man() { $this->name = 'Mr. X'; @@ -27,7 +27,7 @@ class man class bar extends man { - var $name; + public $name; function bar($w) { diff --git a/tests/lang/bug22231.phpt b/tests/lang/bug22231.phpt index 91e5b2a44b..84142b01ff 100644 --- a/tests/lang/bug22231.phpt +++ b/tests/lang/bug22231.phpt @@ -3,7 +3,7 @@ Bug #22231 (segfault when returning a global variable by reference) --FILE-- test)); @@ -31,8 +31,8 @@ class foo class bar extends foo { - var $i = 0; - var $idx; + public $i = 0; + public $idx; function bar($idx) { $this->idx = $idx; diff --git a/tests/lang/bug22510.phpt b/tests/lang/bug22510.phpt index 24bed43339..5c05a82f30 100644 --- a/tests/lang/bug22510.phpt +++ b/tests/lang/bug22510.phpt @@ -4,7 +4,7 @@ Bug #22510 (segfault among complex references) foo == 1'); } diff --git a/tests/lang/bug24403.phpt b/tests/lang/bug24403.phpt index 2acc54cf08..fe99257d3d 100644 --- a/tests/lang/bug24403.phpt +++ b/tests/lang/bug24403.phpt @@ -4,7 +4,7 @@ Bug #24403 (scope doesn't properly propagate into internal functions) arr[0]('testvalue'); } diff --git a/tests/lang/bug26182.phpt b/tests/lang/bug26182.phpt index 480d1469a0..7d613f812e 100644 --- a/tests/lang/bug26182.phpt +++ b/tests/lang/bug26182.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #26182 (Object properties created redundantly) --INI-- -error_reporting=2039 +error_reporting=4095 --FILE-- --EXPECTF-- string(1) "1" -string(4) "2047" +string(4) "4095" string(1) "0" string(1) "1" string(1) "0" diff --git a/tests/run-test/test008.phpt b/tests/run-test/test008.phpt index d595b2592b..14fff59bd8 100644 --- a/tests/run-test/test008.phpt +++ b/tests/run-test/test008.phpt @@ -25,7 +25,7 @@ var_dump($php_errormsg); --EXPECTF-- %s: %sivision by zero in %s on line %d string(1) "1" -string(4) "2047" +string(4) "4095" string(1) "0" string(1) "1" string(1) "0" diff --git a/tests/run-test/test008a.phpt b/tests/run-test/test008a.phpt index 04a3c71168..7916ff2352 100644 --- a/tests/run-test/test008a.phpt +++ b/tests/run-test/test008a.phpt @@ -24,7 +24,7 @@ var_dump($php_errormsg); ?> --EXPECTF-- string(1) "1" -string(4) "2047" +string(4) "4095" string(1) "0" string(1) "1" string(1) "0"