diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
commit | f8d795820e780a6322e054c26c581570613c14f0 (patch) | |
tree | 99d3ae01ce564752807341c5743863b4c92513f8 /tests | |
parent | d2cb200e10ada6fa44c54a29292bb4665728fff0 (diff) | |
download | php-git-f8d795820e780a6322e054c26c581570613c14f0.tar.gz |
Reindent phpt files
Diffstat (limited to 'tests')
372 files changed, 3491 insertions, 3491 deletions
diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt index b5c769d9bd..03fccaa9b7 100644 --- a/tests/basic/011.phpt +++ b/tests/basic/011.phpt @@ -10,7 +10,7 @@ $argc = $_SERVER['argc']; $argv = $_SERVER['argv']; for ($i=0; $i<$argc; $i++) { - echo "$i: ".$argv[$i]."\n"; + echo "$i: ".$argv[$i]."\n"; } ?> diff --git a/tests/basic/012.phpt b/tests/basic/012.phpt index 50af0b49f6..37e5ecd809 100644 --- a/tests/basic/012.phpt +++ b/tests/basic/012.phpt @@ -11,7 +11,7 @@ $argc = $_SERVER['argc']; $argv = $_SERVER['argv']; for ($i=1; $i<$argc; $i++) { - echo ($i-1).": ".$argv[$i]."\n"; + echo ($i-1).": ".$argv[$i]."\n"; } ?> diff --git a/tests/basic/bug20539.phpt b/tests/basic/bug20539.phpt index 2b84d14189..99a88f66b5 100644 --- a/tests/basic/bug20539.phpt +++ b/tests/basic/bug20539.phpt @@ -9,10 +9,10 @@ session.save_handler=files session.save_path=./tests/basic/ --FILE-- <?php - print "good :)\n"; - $filename = __DIR__ . '/sess_' . session_id(); - var_dump(file_exists($filename)); - @unlink($filename); + print "good :)\n"; + $filename = __DIR__ . '/sess_' . session_id(); + var_dump(file_exists($filename)); + @unlink($filename); ?> --EXPECT-- good :) diff --git a/tests/basic/bug54514.phpt b/tests/basic/bug54514.phpt index 0c5595e3f7..6133ee2caf 100644 --- a/tests/basic/bug54514.phpt +++ b/tests/basic/bug54514.phpt @@ -3,10 +3,10 @@ Req #54514 (Get php binary path during script execution) --FILE-- <?php if(realpath(getenv('TEST_PHP_EXECUTABLE')) === realpath(PHP_BINARY)) { - echo "done"; + echo "done"; } else { - var_dump(getenv('TEST_PHP_EXECUTABLE')); - var_dump(PHP_BINARY); + var_dump(getenv('TEST_PHP_EXECUTABLE')); + var_dump(PHP_BINARY); } --EXPECT-- done diff --git a/tests/basic/bug71273.phpt b/tests/basic/bug71273.phpt index 3a2ff244f4..7634d432d0 100644 --- a/tests/basic/bug71273.phpt +++ b/tests/basic/bug71273.phpt @@ -2,12 +2,12 @@ Bug #71273 A wrong ext directory setup in php.ini leads to crash --FILE-- <?php - /* NOTE this file is required to be encoded in iso-8859-1 */ + /* NOTE this file is required to be encoded in iso-8859-1 */ - $cmd = getenv('TEST_PHP_EXECUTABLE') . " -n -d html_errors=on -d extension_dir=a/é/w -d extension=php_kartoffelbrei.dll -v 2>&1"; - $out = shell_exec($cmd); + $cmd = getenv('TEST_PHP_EXECUTABLE') . " -n -d html_errors=on -d extension_dir=a/é/w -d extension=php_kartoffelbrei.dll -v 2>&1"; + $out = shell_exec($cmd); - var_dump(preg_match(",.+a[\\/].+[\\/]w.php_kartoffelbrei.dll.+,s", $out)); + var_dump(preg_match(",.+a[\\/].+[\\/]w.php_kartoffelbrei.dll.+,s", $out)); ?> --EXPECT-- int(1) diff --git a/tests/basic/enable_post_data_reading_05.phpt b/tests/basic/enable_post_data_reading_05.phpt index d8efa0129e..f6695f84c4 100644 --- a/tests/basic/enable_post_data_reading_05.phpt +++ b/tests/basic/enable_post_data_reading_05.phpt @@ -14,7 +14,7 @@ $f1 = fopen("php://input", "r"); $f2 = fopen("php://input", "r"); while (!feof($f1) && !feof($f2)) { - echo fgetc($f1), fgetc($f2); + echo fgetc($f1), fgetc($f2); } ?> diff --git a/tests/basic/enable_post_data_reading_06.phpt b/tests/basic/enable_post_data_reading_06.phpt index fbed195c03..8e9db3a1d8 100644 --- a/tests/basic/enable_post_data_reading_06.phpt +++ b/tests/basic/enable_post_data_reading_06.phpt @@ -95,7 +95,7 @@ $f1 = fopen("php://input", "r"); $f2 = fopen("php://input", "r"); while (!feof($f1) && !feof($f2)) { - echo fgets($f1), fgets($f2); + echo fgets($f1), fgets($f2); } ?> diff --git a/tests/basic/rfc1867_empty_upload.phpt b/tests/basic/rfc1867_empty_upload.phpt index 77fe53ea58..2b89ca8888 100644 --- a/tests/basic/rfc1867_empty_upload.phpt +++ b/tests/basic/rfc1867_empty_upload.phpt @@ -31,10 +31,10 @@ Content-Type: text/plain-file3 var_dump($_FILES); var_dump($_POST); if (is_uploaded_file($_FILES["file1"]["tmp_name"])) { - var_dump(file_get_contents($_FILES["file1"]["tmp_name"])); + var_dump(file_get_contents($_FILES["file1"]["tmp_name"])); } if (is_uploaded_file($_FILES["file3"]["tmp_name"])) { - var_dump(file_get_contents($_FILES["file3"]["tmp_name"])); + var_dump(file_get_contents($_FILES["file3"]["tmp_name"])); } ?> --EXPECTF-- diff --git a/tests/basic/rfc1867_max_file_size.phpt b/tests/basic/rfc1867_max_file_size.phpt index 89406a407f..8d585f7503 100644 --- a/tests/basic/rfc1867_max_file_size.phpt +++ b/tests/basic/rfc1867_max_file_size.phpt @@ -31,10 +31,10 @@ Content-Type: text/plain-file3; var_dump($_FILES); var_dump($_POST); if (is_uploaded_file($_FILES["file1"]["tmp_name"])) { - var_dump(file_get_contents($_FILES["file1"]["tmp_name"])); + var_dump(file_get_contents($_FILES["file1"]["tmp_name"])); } if (is_uploaded_file($_FILES["file3"]["tmp_name"])) { - var_dump(file_get_contents($_FILES["file3"]["tmp_name"])); + var_dump(file_get_contents($_FILES["file3"]["tmp_name"])); } ?> --EXPECTF-- diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt index 6ea7915c25..b85ed20971 100644 --- a/tests/basic/rfc1867_max_file_uploads_empty_files.phpt +++ b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt @@ -31,10 +31,10 @@ Content-Type: text/plain-file var_dump($_FILES); var_dump($_POST); if (is_uploaded_file($_FILES["file1"]["tmp_name"])) { - var_dump(file_get_contents($_FILES["file1"]["tmp_name"])); + var_dump(file_get_contents($_FILES["file1"]["tmp_name"])); } if (is_uploaded_file($_FILES["file4"]["tmp_name"])) { - var_dump(file_get_contents($_FILES["file4"]["tmp_name"])); + var_dump(file_get_contents($_FILES["file4"]["tmp_name"])); } ?> --EXPECTF-- diff --git a/tests/basic/rfc1867_post_max_filesize.phpt b/tests/basic/rfc1867_post_max_filesize.phpt index 58e05319a1..b03220e915 100644 --- a/tests/basic/rfc1867_post_max_filesize.phpt +++ b/tests/basic/rfc1867_post_max_filesize.phpt @@ -27,10 +27,10 @@ Content-Type: text/plain-file3 var_dump($_FILES); var_dump($_POST); if (is_uploaded_file($_FILES["file1"]["tmp_name"])) { - var_dump(file_get_contents($_FILES["file1"]["tmp_name"])); + var_dump(file_get_contents($_FILES["file1"]["tmp_name"])); } if (is_uploaded_file($_FILES["file3"]["tmp_name"])) { - var_dump(file_get_contents($_FILES["file3"]["tmp_name"])); + var_dump(file_get_contents($_FILES["file3"]["tmp_name"])); } ?> --EXPECTF-- diff --git a/tests/classes/__call_001.phpt b/tests/classes/__call_001.phpt index a70041ae16..654a020339 100644 --- a/tests/classes/__call_001.phpt +++ b/tests/classes/__call_001.phpt @@ -4,13 +4,13 @@ ZE2 __call() <?php class Caller { - public $x = array(1, 2, 3); + public $x = array(1, 2, 3); - function __call($m, $a) { - echo "Method $m called:\n"; - var_dump($a); - return $this->x; - } + function __call($m, $a) { + echo "Method $m called:\n"; + var_dump($a); + return $this->x; + } } $foo = new Caller(); diff --git a/tests/classes/__call_002.phpt b/tests/classes/__call_002.phpt index f58ec47dcb..a0df5a2390 100644 --- a/tests/classes/__call_002.phpt +++ b/tests/classes/__call_002.phpt @@ -4,8 +4,8 @@ ZE2 __call() signature check <?php class Test { - function __call() { - } + function __call() { + } } ?> diff --git a/tests/classes/__call_004.phpt b/tests/classes/__call_004.phpt index ca980c65f0..f8168cedab 100644 --- a/tests/classes/__call_004.phpt +++ b/tests/classes/__call_004.phpt @@ -3,24 +3,24 @@ When __call() is invoked via ::, ensure current scope's __call() is favoured ove --FILE-- <?php class A { - function __call($strMethod, $arrArgs) { - echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n"; - var_dump($this); - } + function __call($strMethod, $arrArgs) { + echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n"; + var_dump($this); + } } class B extends A { - function __call($strMethod, $arrArgs) { - echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n"; - var_dump($this); - } + function __call($strMethod, $arrArgs) { + echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n"; + var_dump($this); + } - function test() { - A::test1(1,'a'); - B::test2(1,'a'); - self::test3(1,'a'); - parent::test4(1,'a'); - } + function test() { + A::test1(1,'a'); + B::test2(1,'a'); + self::test3(1,'a'); + parent::test4(1,'a'); + } } $b = new B(); diff --git a/tests/classes/__call_005.phpt b/tests/classes/__call_005.phpt index 33c4df8e49..8c4d52efa7 100644 --- a/tests/classes/__call_005.phpt +++ b/tests/classes/__call_005.phpt @@ -3,19 +3,19 @@ When __call() is invoked via ::, ensure private implementation of __call() in su --FILE-- <?php class A { - private function __call($strMethod, $arrArgs) { - echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n"; - var_dump($this); - } + private function __call($strMethod, $arrArgs) { + echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n"; + var_dump($this); + } } class B extends A { - function test() { - A::test1(1,'a'); - B::test2(1,'a'); - self::test3(1,'a'); - parent::test4(1,'a'); - } + function test() { + A::test1(1,'a'); + B::test2(1,'a'); + self::test3(1,'a'); + parent::test4(1,'a'); + } } $b = new B(); diff --git a/tests/classes/__call_006.phpt b/tests/classes/__call_006.phpt index 807735401c..6ffc75358f 100644 --- a/tests/classes/__call_006.phpt +++ b/tests/classes/__call_006.phpt @@ -3,51 +3,51 @@ Ensure exceptions are handled properly when thrown in __call. --FILE-- <?php class A { - function __call($strMethod, $arrArgs) { - var_dump($this); - throw new Exception; - echo "You should not see this"; - } - function test() { - A::unknownCalledWithSRO(1,2,3); - } + function __call($strMethod, $arrArgs) { + var_dump($this); + throw new Exception; + echo "You should not see this"; + } + function test() { + A::unknownCalledWithSRO(1,2,3); + } } class B extends A { - function test() { - B::unknownCalledWithSROFromChild(1,2,3); - } + function test() { + B::unknownCalledWithSROFromChild(1,2,3); + } } $a = new A(); echo "---> Invoke __call via simple method call.\n"; try { - $a->unknown(); + $a->unknown(); } catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; + echo "Exception caught OK; continuing.\n"; } echo "\n\n---> Invoke __call via scope resolution operator within instance.\n"; try { - $a->test(); + $a->test(); } catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; + echo "Exception caught OK; continuing.\n"; } echo "\n\n---> Invoke __call via scope resolution operator within child instance.\n"; $b = new B(); try { - $b->test(); + $b->test(); } catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; + echo "Exception caught OK; continuing.\n"; } echo "\n\n---> Invoke __call via callback.\n"; try { - call_user_func(array($b, 'unknownCallback'), 1,2,3); + call_user_func(array($b, 'unknownCallback'), 1,2,3); } catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; + echo "Exception caught OK; continuing.\n"; } ?> --EXPECTF-- diff --git a/tests/classes/__call_007.phpt b/tests/classes/__call_007.phpt index a1e911d52b..26dd8e29b6 100644 --- a/tests/classes/__call_007.phpt +++ b/tests/classes/__call_007.phpt @@ -3,51 +3,51 @@ Ensure exceptions are handled properly when thrown in a statically declared __ca --FILE-- <?php class A { - static function __call($strMethod, $arrArgs) { - @var_dump($this); - throw new Exception; - echo "You should not see this"; - } - function test() { - A::unknownCalledWithSRO(1,2,3); - } + static function __call($strMethod, $arrArgs) { + @var_dump($this); + throw new Exception; + echo "You should not see this"; + } + function test() { + A::unknownCalledWithSRO(1,2,3); + } } class B extends A { - function test() { - B::unknownCalledWithSROFromChild(1,2,3); - } + function test() { + B::unknownCalledWithSROFromChild(1,2,3); + } } $a = new A(); echo "---> Invoke __call via simple method call.\n"; try { - $a->unknown(); + $a->unknown(); } catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; + echo "Exception caught OK; continuing.\n"; } echo "\n\n---> Invoke __call via scope resolution operator within instance.\n"; try { - $a->test(); + $a->test(); } catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; + echo "Exception caught OK; continuing.\n"; } echo "\n\n---> Invoke __call via scope resolution operator within child instance.\n"; $b = new B(); try { - $b->test(); + $b->test(); } catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; + echo "Exception caught OK; continuing.\n"; } echo "\n\n---> Invoke __call via callback.\n"; try { - call_user_func(array($b, 'unknownCallback'), 1,2,3); + call_user_func(array($b, 'unknownCallback'), 1,2,3); } catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; + echo "Exception caught OK; continuing.\n"; } ?> --EXPECTF-- diff --git a/tests/classes/__set__get_001.phpt b/tests/classes/__set__get_001.phpt index 244119a2d0..f240817f4a 100644 --- a/tests/classes/__set__get_001.phpt +++ b/tests/classes/__set__get_001.phpt @@ -3,33 +3,33 @@ ZE2 __set() and __get() --FILE-- <?php class setter { - public $n; - public $x = array('a' => 1, 'b' => 2, 'c' => 3); + public $n; + public $x = array('a' => 1, 'b' => 2, 'c' => 3); - function __get($nm) { - echo "Getting [$nm]\n"; + function __get($nm) { + echo "Getting [$nm]\n"; - if (isset($this->x[$nm])) { - $r = $this->x[$nm]; - echo "Returning: $r\n"; - return $r; - } - else { - echo "Nothing!\n"; - } - } + if (isset($this->x[$nm])) { + $r = $this->x[$nm]; + echo "Returning: $r\n"; + return $r; + } + else { + echo "Nothing!\n"; + } + } - function __set($nm, $val) { - echo "Setting [$nm] to $val\n"; + function __set($nm, $val) { + echo "Setting [$nm] to $val\n"; - if (isset($this->x[$nm])) { - $this->x[$nm] = $val; - echo "OK!\n"; - } - else { - echo "Not OK!\n"; - } - } + if (isset($this->x[$nm])) { + $this->x[$nm] = $val; + echo "OK!\n"; + } + else { + echo "Not OK!\n"; + } + } } $foo = new Setter(); diff --git a/tests/classes/__set__get_002.phpt b/tests/classes/__set__get_002.phpt index 5d3b5db543..5fb72e2106 100644 --- a/tests/classes/__set__get_002.phpt +++ b/tests/classes/__set__get_002.phpt @@ -3,8 +3,8 @@ ZE2 __get() signature check --FILE-- <?php class Test { - function __get($x,$y) { - } + function __get($x,$y) { + } } ?> diff --git a/tests/classes/__set__get_003.phpt b/tests/classes/__set__get_003.phpt index 16b09b76b1..0ebac3bccc 100644 --- a/tests/classes/__set__get_003.phpt +++ b/tests/classes/__set__get_003.phpt @@ -3,8 +3,8 @@ ZE2 __set() signature check --FILE-- <?php class Test { - function __set() { - } + function __set() { + } } ?> diff --git a/tests/classes/__set__get_004.phpt b/tests/classes/__set__get_004.phpt index f825cdf971..2818d9700f 100644 --- a/tests/classes/__set__get_004.phpt +++ b/tests/classes/__set__get_004.phpt @@ -3,21 +3,21 @@ ZE2 __set() and __get() --FILE-- <?php class Test { - protected $x; + protected $x; - function __get($name) { - if (isset($this->x[$name])) { - return $this->x[$name]; - } - else - { - return NULL; - } - } + function __get($name) { + if (isset($this->x[$name])) { + return $this->x[$name]; + } + else + { + return NULL; + } + } - function __set($name, $val) { - $this->x[$name] = $val; - } + function __set($name, $val) { + $this->x[$name] = $val; + } } $foo = new Test(); diff --git a/tests/classes/__set__get_005.phpt b/tests/classes/__set__get_005.phpt index 767e54ab0c..298c8b1e11 100644 --- a/tests/classes/__set__get_005.phpt +++ b/tests/classes/__set__get_005.phpt @@ -4,41 +4,41 @@ ZE2 __set() and __get() <?php class Test { - protected $x; + protected $x; - function __get($name) { - echo __METHOD__ . "\n"; - if (isset($this->x[$name])) { - return $this->x[$name]; - } - else - { - return NULL; - } - } + function __get($name) { + echo __METHOD__ . "\n"; + if (isset($this->x[$name])) { + return $this->x[$name]; + } + else + { + return NULL; + } + } - function __set($name, $val) { - echo __METHOD__ . "\n"; - $this->x[$name] = $val; - } + function __set($name, $val) { + echo __METHOD__ . "\n"; + $this->x[$name] = $val; + } } class AutoGen { - protected $x; + protected $x; - function __get($name) { - echo __METHOD__ . "\n"; - if (!isset($this->x[$name])) { - $this->x[$name] = new Test(); - } - return $this->x[$name]; - } + function __get($name) { + echo __METHOD__ . "\n"; + if (!isset($this->x[$name])) { + $this->x[$name] = new Test(); + } + return $this->x[$name]; + } - function __set($name, $val) { - echo __METHOD__ . "\n"; - $this->x[$name] = $val; - } + function __set($name, $val) { + echo __METHOD__ . "\n"; + $this->x[$name] = $val; + } } $foo = new AutoGen(); diff --git a/tests/classes/abstract.phpt b/tests/classes/abstract.phpt index f46e5130a7..8286d6b6aa 100644 --- a/tests/classes/abstract.phpt +++ b/tests/classes/abstract.phpt @@ -4,16 +4,16 @@ ZE2 An abstract method may not be called <?php abstract class fail { - abstract function show(); + abstract function show(); } class pass extends fail { - function show() { - echo "Call to function show()\n"; - } - function error() { - parent::show(); - } + function show() { + echo "Call to function show()\n"; + } + function error() { + parent::show(); + } } $t = new pass(); diff --git a/tests/classes/abstract_by_interface_001.phpt b/tests/classes/abstract_by_interface_001.phpt index 4a746d0d22..a8a6ad31da 100644 --- a/tests/classes/abstract_by_interface_001.phpt +++ b/tests/classes/abstract_by_interface_001.phpt @@ -8,7 +8,7 @@ class Root { interface MyInterface { - function MyInterfaceFunc(); + function MyInterfaceFunc(); } abstract class Derived extends Root implements MyInterface { @@ -16,7 +16,7 @@ abstract class Derived extends Root implements MyInterface { class Leaf extends Derived { - function MyInterfaceFunc() {} + function MyInterfaceFunc() {} } var_dump(new Leaf); diff --git a/tests/classes/abstract_by_interface_002.phpt b/tests/classes/abstract_by_interface_002.phpt index a05660b5b9..83fc18ad95 100644 --- a/tests/classes/abstract_by_interface_002.phpt +++ b/tests/classes/abstract_by_interface_002.phpt @@ -8,7 +8,7 @@ class Root { interface MyInterface { - static function MyInterfaceFunc(); + static function MyInterfaceFunc(); } abstract class Derived extends Root implements MyInterface { @@ -16,7 +16,7 @@ abstract class Derived extends Root implements MyInterface { class Leaf extends Derived { - static function MyInterfaceFunc() {} + static function MyInterfaceFunc() {} } var_dump(new Leaf); diff --git a/tests/classes/abstract_class.phpt b/tests/classes/abstract_class.phpt index fabe890eae..2ede69805c 100644 --- a/tests/classes/abstract_class.phpt +++ b/tests/classes/abstract_class.phpt @@ -4,13 +4,13 @@ ZE2 An abstract class cannot be instantiated <?php abstract class fail { - abstract function show(); + abstract function show(); } class pass extends fail { - function show() { - echo "Call to function show()\n"; - } + function show() { + echo "Call to function show()\n"; + } } $t2 = new pass(); diff --git a/tests/classes/abstract_derived.phpt b/tests/classes/abstract_derived.phpt index 5948692653..db040e1342 100644 --- a/tests/classes/abstract_derived.phpt +++ b/tests/classes/abstract_derived.phpt @@ -7,7 +7,7 @@ class base { } class derived extends base { - abstract function show(); + abstract function show(); } ?> diff --git a/tests/classes/abstract_final.phpt b/tests/classes/abstract_final.phpt index a82bfff227..70aece06fd 100644 --- a/tests/classes/abstract_final.phpt +++ b/tests/classes/abstract_final.phpt @@ -4,7 +4,7 @@ ZE2 A final method cannot be abstract <?php class fail { - abstract final function show(); + abstract final function show(); } echo "Done\n"; // Shouldn't be displayed diff --git a/tests/classes/abstract_inherit.phpt b/tests/classes/abstract_inherit.phpt index 8e9e118e08..6664fd3e90 100644 --- a/tests/classes/abstract_inherit.phpt +++ b/tests/classes/abstract_inherit.phpt @@ -4,7 +4,7 @@ ZE2 A class that inherits an abstract method is abstract <?php abstract class pass { - abstract function show(); + abstract function show(); } abstract class fail extends pass { diff --git a/tests/classes/abstract_not_declared.phpt b/tests/classes/abstract_not_declared.phpt index 8c2d880150..611cb3cc94 100644 --- a/tests/classes/abstract_not_declared.phpt +++ b/tests/classes/abstract_not_declared.phpt @@ -4,7 +4,7 @@ ZE2 An abstract class must be declared abstract <?php class fail { - abstract function show(); + abstract function show(); } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/abstract_redeclare.phpt b/tests/classes/abstract_redeclare.phpt index 5643cb7a61..843570ba2e 100644 --- a/tests/classes/abstract_redeclare.phpt +++ b/tests/classes/abstract_redeclare.phpt @@ -4,13 +4,13 @@ ZE2 A method cannot be redeclared abstract <?php class pass { - function show() { - echo "Call to function show()\n"; - } + function show() { + echo "Call to function show()\n"; + } } class fail extends pass { - abstract function show(); + abstract function show(); } echo "Done\n"; // Shouldn't be displayed diff --git a/tests/classes/abstract_static.phpt b/tests/classes/abstract_static.phpt index 9b9205af3e..60ff284784 100644 --- a/tests/classes/abstract_static.phpt +++ b/tests/classes/abstract_static.phpt @@ -5,14 +5,14 @@ ZE2 A static abstract methods interface showable { - static function show(); + static function show(); } class pass implements showable { - static function show() { - echo "Call to function show()\n"; - } + static function show() { + echo "Call to function show()\n"; + } } pass::show(); @@ -20,7 +20,7 @@ pass::show(); eval(' class fail { - abstract static function func(); + abstract static function func(); } '); diff --git a/tests/classes/abstract_user_call.phpt b/tests/classes/abstract_user_call.phpt index 224461a3bd..0a61d477b6 100644 --- a/tests/classes/abstract_user_call.phpt +++ b/tests/classes/abstract_user_call.phpt @@ -5,15 +5,15 @@ ZE2 An abstrcat method cannot be called indirectly abstract class test_base { - abstract function func(); + abstract function func(); } class test extends test_base { - function func() - { - echo __METHOD__ . "()\n"; - } + function func() + { + echo __METHOD__ . "()\n"; + } } $o = new test; diff --git a/tests/classes/array_access_001.phpt b/tests/classes/array_access_001.phpt index a2ba09e88b..ae2669b670 100644 --- a/tests/classes/array_access_001.phpt +++ b/tests/classes/array_access_001.phpt @@ -4,24 +4,24 @@ ZE2 ArrayAccess <?php class ObjectOne implements ArrayAccess { - public $a = array('1st', 1, 2=>'3rd', '4th'=>4); + public $a = array('1st', 1, 2=>'3rd', '4th'=>4); - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - return $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } + function offsetExists($index) { + echo __METHOD__ . "($index)\n"; + return array_key_exists($index, $this->a); + } + function offsetGet($index) { + echo __METHOD__ . "($index)\n"; + return $this->a[$index]; + } + function offsetSet($index, $newval) { + echo __METHOD__ . "($index,$newval)\n"; + return $this->a[$index] = $newval; + } + function offsetUnset($index) { + echo __METHOD__ . "($index)\n"; + unset($this->a[$index]); + } } $obj = new ObjectOne; diff --git a/tests/classes/array_access_002.phpt b/tests/classes/array_access_002.phpt index 730ad0952b..79f4a52853 100644 --- a/tests/classes/array_access_002.phpt +++ b/tests/classes/array_access_002.phpt @@ -4,24 +4,24 @@ ZE2 ArrayAccess::offsetSet without return <?php class ObjectOne implements ArrayAccess { - public $a = array('1st', 1, 2=>'3rd', '4th'=>4); + public $a = array('1st', 1, 2=>'3rd', '4th'=>4); - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - /*return*/ $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } + function offsetExists($index) { + echo __METHOD__ . "($index)\n"; + return array_key_exists($index, $this->a); + } + function offsetGet($index) { + echo __METHOD__ . "($index)\n"; + return $this->a[$index]; + } + function offsetSet($index, $newval) { + echo __METHOD__ . "($index,$newval)\n"; + /*return*/ $this->a[$index] = $newval; + } + function offsetUnset($index) { + echo __METHOD__ . "($index)\n"; + unset($this->a[$index]); + } } $obj = new ObjectOne; diff --git a/tests/classes/array_access_003.phpt b/tests/classes/array_access_003.phpt index 9fa2ee73e6..dbaaa6b192 100644 --- a/tests/classes/array_access_003.phpt +++ b/tests/classes/array_access_003.phpt @@ -6,35 +6,35 @@ error_reporting=4095 <?php class ObjectOne implements ArrayAccess { - public $a = array('1st', 1, 2=>'3rd', '4th'=>4); + public $a = array('1st', 1, 2=>'3rd', '4th'=>4); - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - switch($index) { - case 1: - $a = 'foo'; - return $a . 'Bar'; - case 2: - static $a=1; - return $a; - } - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - if ($index==3) { - $this->cnt = $newval; - } - return $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } + function offsetExists($index) { + echo __METHOD__ . "($index)\n"; + return array_key_exists($index, $this->a); + } + function offsetGet($index) { + echo __METHOD__ . "($index)\n"; + switch($index) { + case 1: + $a = 'foo'; + return $a . 'Bar'; + case 2: + static $a=1; + return $a; + } + return $this->a[$index]; + } + function offsetSet($index, $newval) { + echo __METHOD__ . "($index,$newval)\n"; + if ($index==3) { + $this->cnt = $newval; + } + return $this->a[$index] = $newval; + } + function offsetUnset($index) { + echo __METHOD__ . "($index)\n"; + unset($this->a[$index]); + } } $obj = new ObjectOne; diff --git a/tests/classes/array_access_004.phpt b/tests/classes/array_access_004.phpt index 72e1322aba..882ca43762 100644 --- a/tests/classes/array_access_004.phpt +++ b/tests/classes/array_access_004.phpt @@ -4,35 +4,35 @@ ZE2 ArrayAccess::offsetGet ambiguties <?php class ObjectOne implements ArrayAccess { - public $a = array('1st', 1, 2=>'3rd', '4th'=>4); + public $a = array('1st', 1, 2=>'3rd', '4th'=>4); - function offsetExists($index) { - echo __METHOD__ . "($index)\n"; - return array_key_exists($index, $this->a); - } - function offsetGet($index) { - echo __METHOD__ . "($index)\n"; - switch($index) { - case 1: - $a = 'foo'; - return $a . 'Bar'; - case 2: - static $a=1; - return $a; - } - return $this->a[$index]; - } - function offsetSet($index, $newval) { - echo __METHOD__ . "($index,$newval)\n"; - if ($index==3) { - $this->cnt = $newval; - } - return $this->a[$index] = $newval; - } - function offsetUnset($index) { - echo __METHOD__ . "($index)\n"; - unset($this->a[$index]); - } + function offsetExists($index) { + echo __METHOD__ . "($index)\n"; + return array_key_exists($index, $this->a); + } + function offsetGet($index) { + echo __METHOD__ . "($index)\n"; + switch($index) { + case 1: + $a = 'foo'; + return $a . 'Bar'; + case 2: + static $a=1; + return $a; + } + return $this->a[$index]; + } + function offsetSet($index, $newval) { + echo __METHOD__ . "($index,$newval)\n"; + if ($index==3) { + $this->cnt = $newval; + } + return $this->a[$index] = $newval; + } + function offsetUnset($index) { + echo __METHOD__ . "($index)\n"; + unset($this->a[$index]); + } } $obj = new ObjectOne; diff --git a/tests/classes/array_access_005.phpt b/tests/classes/array_access_005.phpt index 91d4a7ca22..7db50f2cb9 100644 --- a/tests/classes/array_access_005.phpt +++ b/tests/classes/array_access_005.phpt @@ -4,27 +4,27 @@ ZE2 ArrayAccess and sub Arrays <?php class Peoples implements ArrayAccess { - public $person; + public $person; - function __construct() { - $this->person = array(array('name'=>'Joe')); - } + function __construct() { + $this->person = array(array('name'=>'Joe')); + } - function offsetExists($index) { - return array_key_exists($this->person, $index); - } + function offsetExists($index) { + return array_key_exists($this->person, $index); + } - function offsetGet($index) { - return $this->person[$index]; - } + function offsetGet($index) { + return $this->person[$index]; + } - function offsetSet($index, $value) { - $this->person[$index] = $value; - } + function offsetSet($index, $value) { + $this->person[$index] = $value; + } - function offsetUnset($index) { - unset($this->person[$index]); - } + function offsetUnset($index) { + unset($this->person[$index]); + } } $people = new Peoples; diff --git a/tests/classes/array_access_006.phpt b/tests/classes/array_access_006.phpt index babc808cb4..7891d2aca4 100644 --- a/tests/classes/array_access_006.phpt +++ b/tests/classes/array_access_006.phpt @@ -4,27 +4,27 @@ ZE2 ArrayAccess and ASSIGN_OP operators (+=) <?php class OverloadedArray implements ArrayAccess { - public $realArray; + public $realArray; - function __construct() { - $this->realArray = array(1,2,3); - } + function __construct() { + $this->realArray = array(1,2,3); + } - function offsetExists($index) { - return array_key_exists($this->realArray, $index); - } + function offsetExists($index) { + return array_key_exists($this->realArray, $index); + } - function offsetGet($index) { - return $this->realArray[$index]; - } + function offsetGet($index) { + return $this->realArray[$index]; + } - function offsetSet($index, $value) { - $this->realArray[$index] = $value; - } + function offsetSet($index, $value) { + $this->realArray[$index] = $value; + } - function offsetUnset($index) { - unset($this->realArray[$index]); - } + function offsetUnset($index) { + unset($this->realArray[$index]); + } } $a = new OverloadedArray; diff --git a/tests/classes/array_access_007.phpt b/tests/classes/array_access_007.phpt index f0dce8a3ad..37a3255d6f 100644 --- a/tests/classes/array_access_007.phpt +++ b/tests/classes/array_access_007.phpt @@ -4,35 +4,35 @@ ZE2 ArrayAccess and [] assignment <?php class OverloadedArray implements ArrayAccess { - public $realArray; - - function __construct() { - $this->realArray = array(); - } - - function offsetExists($index) { - return array_key_exists($this->realArray, $index); - } - - function offsetGet($index) { - return $this->realArray[$index]; - } - - function offsetSet($index, $value) { - if (is_null($index)) { - $this->realArray[] = $value; - } else { - $this->realArray[$index] = $value; - } - } - - function offsetUnset($index) { - unset($this->realArray[$index]); - } - - function dump() { - var_dump($this->realArray); - } + public $realArray; + + function __construct() { + $this->realArray = array(); + } + + function offsetExists($index) { + return array_key_exists($this->realArray, $index); + } + + function offsetGet($index) { + return $this->realArray[$index]; + } + + function offsetSet($index, $value) { + if (is_null($index)) { + $this->realArray[] = $value; + } else { + $this->realArray[$index] = $value; + } + } + + function offsetUnset($index) { + unset($this->realArray[$index]); + } + + function dump() { + var_dump($this->realArray); + } } $a = new OverloadedArray; diff --git a/tests/classes/array_access_008.phpt b/tests/classes/array_access_008.phpt index 5185478403..a6f485eb79 100644 --- a/tests/classes/array_access_008.phpt +++ b/tests/classes/array_access_008.phpt @@ -4,27 +4,27 @@ ZE2 ArrayAccess and ASSIGN_OP operators (.=) <?php class Peoples implements ArrayAccess { - public $person; + public $person; - function __construct() { - $this->person = array(array('name'=>'Foo')); - } + function __construct() { + $this->person = array(array('name'=>'Foo')); + } - function offsetExists($index) { - return array_key_exists($this->person, $index); - } + function offsetExists($index) { + return array_key_exists($this->person, $index); + } - function offsetGet($index) { - return $this->person[$index]; - } + function offsetGet($index) { + return $this->person[$index]; + } - function offsetSet($index, $value) { - $this->person[$index] = $value; - } + function offsetSet($index, $value) { + $this->person[$index] = $value; + } - function offsetUnset($index) { - unset($this->person[$index]); - } + function offsetUnset($index) { + unset($this->person[$index]); + } } $people = new Peoples; diff --git a/tests/classes/array_access_009.phpt b/tests/classes/array_access_009.phpt index e9f9ec0a24..a4aeaea56a 100644 --- a/tests/classes/array_access_009.phpt +++ b/tests/classes/array_access_009.phpt @@ -7,92 +7,92 @@ ZE2 ArrayAccess and ArrayProxyAccess, ArrayProxy interface ArrayProxyAccess extends ArrayAccess { - function proxyGet($element); - function proxySet($element, $index, $value); - function proxyUnset($element, $index); + function proxyGet($element); + function proxySet($element, $index, $value); + function proxyUnset($element, $index); } class ArrayProxy implements ArrayAccess { - private $object; - private $element; - - function __construct(ArrayProxyAccess $object, $element) - { - echo __METHOD__ . "($element)\n"; - if (!$object->offsetExists($element)) - { - $object[$element] = array(); - } - $this->object = $object; - $this->element = $element; - } - - function offsetExists($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return array_key_exists($index, $this->object->proxyGet($this->element)); - } - - function offsetGet($index) { - echo __METHOD__ . "($this->element, $index)\n"; - $tmp = $this->object->proxyGet($this->element); - return isset($tmp[$index]) ? $tmp[$index] : NULL; - } - - function offsetSet($index, $value) { - echo __METHOD__ . "($this->element, $index, $value)\n"; - $this->object->proxySet($this->element, $index, $value); - } - - function offsetUnset($index) { - echo __METHOD__ . "($this->element, $index)\n"; - $this->object->proxyUnset($this->element, $index); - } + private $object; + private $element; + + function __construct(ArrayProxyAccess $object, $element) + { + echo __METHOD__ . "($element)\n"; + if (!$object->offsetExists($element)) + { + $object[$element] = array(); + } + $this->object = $object; + $this->element = $element; + } + + function offsetExists($index) { + echo __METHOD__ . "($this->element, $index)\n"; + return array_key_exists($index, $this->object->proxyGet($this->element)); + } + + function offsetGet($index) { + echo __METHOD__ . "($this->element, $index)\n"; + $tmp = $this->object->proxyGet($this->element); + return isset($tmp[$index]) ? $tmp[$index] : NULL; + } + + function offsetSet($index, $value) { + echo __METHOD__ . "($this->element, $index, $value)\n"; + $this->object->proxySet($this->element, $index, $value); + } + + function offsetUnset($index) { + echo __METHOD__ . "($this->element, $index)\n"; + $this->object->proxyUnset($this->element, $index); + } } class Peoples implements ArrayProxyAccess { - public $person; - - function __construct() - { - $this->person = array(array('name'=>'Foo')); - } - - function offsetExists($index) - { - return array_key_exists($index, $this->person); - } - - function offsetGet($index) - { - return new ArrayProxy($this, $index); - } - - function offsetSet($index, $value) - { - $this->person[$index] = $value; - } - - function offsetUnset($index) - { - unset($this->person[$index]); - } - - function proxyGet($element) - { - return $this->person[$element]; - } - - function proxySet($element, $index, $value) - { - $this->person[$element][$index] = $value; - } - - function proxyUnset($element, $index) - { - unset($this->person[$element][$index]); - } + public $person; + + function __construct() + { + $this->person = array(array('name'=>'Foo')); + } + + function offsetExists($index) + { + return array_key_exists($index, $this->person); + } + + function offsetGet($index) + { + return new ArrayProxy($this, $index); + } + + function offsetSet($index, $value) + { + $this->person[$index] = $value; + } + + function offsetUnset($index) + { + unset($this->person[$index]); + } + + function proxyGet($element) + { + return $this->person[$element]; + } + + function proxySet($element, $index, $value) + { + $this->person[$element][$index] = $value; + } + + function proxyUnset($element, $index) + { + unset($this->person[$element][$index]); + } } $people = new Peoples; diff --git a/tests/classes/array_access_010.phpt b/tests/classes/array_access_010.phpt index 24a0c251f6..f91096c713 100644 --- a/tests/classes/array_access_010.phpt +++ b/tests/classes/array_access_010.phpt @@ -7,65 +7,65 @@ ZE2 ArrayAccess and ArrayReferenceProxy with references class ArrayReferenceProxy implements ArrayAccess { - private $object; - private $element; - - function __construct(ArrayAccess $object, array &$element) - { - echo __METHOD__ . "(Array)\n"; - $this->object = $object; - $this->element = &$element; - } - - function offsetExists($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return array_key_exists($index, $this->element); - } - - function offsetGet($index) { - echo __METHOD__ . "(Array, $index)\n"; - return isset($this->element[$index]) ? $this->element[$index] : NULL; - } - - function offsetSet($index, $value) { - echo __METHOD__ . "(Array, $index, $value)\n"; - $this->element[$index] = $value; - } - - function offsetUnset($index) { - echo __METHOD__ . "(Array, $index)\n"; - unset($this->element[$index]); - } + private $object; + private $element; + + function __construct(ArrayAccess $object, array &$element) + { + echo __METHOD__ . "(Array)\n"; + $this->object = $object; + $this->element = &$element; + } + + function offsetExists($index) { + echo __METHOD__ . "($this->element, $index)\n"; + return array_key_exists($index, $this->element); + } + + function offsetGet($index) { + echo __METHOD__ . "(Array, $index)\n"; + return isset($this->element[$index]) ? $this->element[$index] : NULL; + } + + function offsetSet($index, $value) { + echo __METHOD__ . "(Array, $index, $value)\n"; + $this->element[$index] = $value; + } + + function offsetUnset($index) { + echo __METHOD__ . "(Array, $index)\n"; + unset($this->element[$index]); + } } class Peoples implements ArrayAccess { - public $person; - - function __construct() - { - $this->person = array(array('name'=>'Foo')); - } - - function offsetExists($index) - { - return array_key_exists($index, $this->person); - } - - function offsetGet($index) - { - return new ArrayReferenceProxy($this, $this->person[$index]); - } - - function offsetSet($index, $value) - { - $this->person[$index] = $value; - } - - function offsetUnset($index) - { - unset($this->person[$index]); - } + public $person; + + function __construct() + { + $this->person = array(array('name'=>'Foo')); + } + + function offsetExists($index) + { + return array_key_exists($index, $this->person); + } + + function offsetGet($index) + { + return new ArrayReferenceProxy($this, $this->person[$index]); + } + + function offsetSet($index, $value) + { + $this->person[$index] = $value; + } + + function offsetUnset($index) + { + unset($this->person[$index]); + } } $people = new Peoples; diff --git a/tests/classes/array_access_011.phpt b/tests/classes/array_access_011.phpt index 13c69a7974..3250d64deb 100644 --- a/tests/classes/array_access_011.phpt +++ b/tests/classes/array_access_011.phpt @@ -7,74 +7,74 @@ ZE2 ArrayAccess and ArrayAccessReferenceProxy with references to main array class ArrayAccessReferenceProxy implements ArrayAccess { - private $object; - private $oarray; - private $element; - - function __construct(ArrayAccess $object, array &$array, $element) - { - echo __METHOD__ . "($element)\n"; - $this->object = $object; - $this->oarray = &$array; - $this->element = $element; - } - - function offsetExists($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return array_key_exists($index, $this->oarray[$this->element]); - } - - function offsetGet($index) { - echo __METHOD__ . "($this->element, $index)\n"; - return isset($this->oarray[$this->element][$index]) ? $this->oarray[$this->element][$index] : NULL; - } - - function offsetSet($index, $value) { - echo __METHOD__ . "($this->element, $index, $value)\n"; - $this->oarray[$this->element][$index] = $value; - } - - function offsetUnset($index) { - echo __METHOD__ . "($this->element, $index)\n"; - unset($this->oarray[$this->element][$index]); - } + private $object; + private $oarray; + private $element; + + function __construct(ArrayAccess $object, array &$array, $element) + { + echo __METHOD__ . "($element)\n"; + $this->object = $object; + $this->oarray = &$array; + $this->element = $element; + } + + function offsetExists($index) { + echo __METHOD__ . "($this->element, $index)\n"; + return array_key_exists($index, $this->oarray[$this->element]); + } + + function offsetGet($index) { + echo __METHOD__ . "($this->element, $index)\n"; + return isset($this->oarray[$this->element][$index]) ? $this->oarray[$this->element][$index] : NULL; + } + + function offsetSet($index, $value) { + echo __METHOD__ . "($this->element, $index, $value)\n"; + $this->oarray[$this->element][$index] = $value; + } + + function offsetUnset($index) { + echo __METHOD__ . "($this->element, $index)\n"; + unset($this->oarray[$this->element][$index]); + } } class Peoples implements ArrayAccess { - public $person; - - function __construct() - { - $this->person = array(array('name'=>'Foo')); - } - - function offsetExists($index) - { - return array_key_exists($index, $this->person); - } - - function offsetGet($index) - { - if (is_array($this->person[$index])) - { - return new ArrayAccessReferenceProxy($this, $this->person, $index); - } - else - { - return $this->person[$index]; - } - } - - function offsetSet($index, $value) - { - $this->person[$index] = $value; - } - - function offsetUnset($index) - { - unset($this->person[$index]); - } + public $person; + + function __construct() + { + $this->person = array(array('name'=>'Foo')); + } + + function offsetExists($index) + { + return array_key_exists($index, $this->person); + } + + function offsetGet($index) + { + if (is_array($this->person[$index])) + { + return new ArrayAccessReferenceProxy($this, $this->person, $index); + } + else + { + return $this->person[$index]; + } + } + + function offsetSet($index, $value) + { + $this->person[$index] = $value; + } + + function offsetUnset($index) + { + unset($this->person[$index]); + } } $people = new Peoples; diff --git a/tests/classes/array_access_012.phpt b/tests/classes/array_access_012.phpt index f10a67a6c7..e2fba54781 100644 --- a/tests/classes/array_access_012.phpt +++ b/tests/classes/array_access_012.phpt @@ -4,21 +4,21 @@ ZE2 ArrayAccess cannot assign by reference <?php class ArrayAccessImpl implements ArrayAccess { - private $data = array(); + private $data = array(); - public function offsetUnset($index) {} + public function offsetUnset($index) {} - public function offsetSet($index, $value) { - $this->data[$index] = $value; - } + public function offsetSet($index, $value) { + $this->data[$index] = $value; + } - public function offsetGet($index) { - return $this->data[$index]; - } + public function offsetGet($index) { + return $this->data[$index]; + } - public function offsetExists($index) { - return isset($this->data[$index]); - } + public function offsetExists($index) { + return isset($this->data[$index]); + } } $data = new ArrayAccessImpl(); diff --git a/tests/classes/array_access_013.phpt b/tests/classes/array_access_013.phpt index 8b24ca9017..bcb6a5e00b 100644 --- a/tests/classes/array_access_013.phpt +++ b/tests/classes/array_access_013.phpt @@ -15,7 +15,7 @@ $t = new Test; try { - echo isset($t[0]); + echo isset($t[0]); } catch(Exception $e) { @@ -24,7 +24,7 @@ catch(Exception $e) try { - echo $t[0]; + echo $t[0]; } catch(Exception $e) { @@ -33,7 +33,7 @@ catch(Exception $e) try { - $t[0] = 1; + $t[0] = 1; } catch(Exception $e) { @@ -42,7 +42,7 @@ catch(Exception $e) try { - unset($t[0]); + unset($t[0]); } catch(Exception $e) { diff --git a/tests/classes/array_conversion_keys.phpt b/tests/classes/array_conversion_keys.phpt index 6c642f1f85..2267de06d0 100644 --- a/tests/classes/array_conversion_keys.phpt +++ b/tests/classes/array_conversion_keys.phpt @@ -4,9 +4,9 @@ Verifies the correct conversion of objects to arrays <?php class foo { - private $private = 'private'; - protected $protected = 'protected'; - public $public = 'public'; + private $private = 'private'; + protected $protected = 'protected'; + public $public = 'public'; } var_export((array) new foo); ?> diff --git a/tests/classes/assign_op_property_001.phpt b/tests/classes/assign_op_property_001.phpt index cd5fcff469..71f75d2c71 100644 --- a/tests/classes/assign_op_property_001.phpt +++ b/tests/classes/assign_op_property_001.phpt @@ -4,19 +4,19 @@ ZE2 assign_op property of overloaded object <?php class Test { - private $real_a = 2; + private $real_a = 2; - function __set($property, $value) { - if ($property == "a") { - $this->real_a = $value; - } - } + function __set($property, $value) { + if ($property == "a") { + $this->real_a = $value; + } + } - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } } $obj = new Test; diff --git a/tests/classes/autoload_001.phpt b/tests/classes/autoload_001.phpt index bf3307d234..cdea16f689 100644 --- a/tests/classes/autoload_001.phpt +++ b/tests/classes/autoload_001.phpt @@ -8,8 +8,8 @@ ZE2 Autoload and class_exists <?php spl_autoload_register(function ($class_name) { - require_once(__DIR__ . '/' . $class_name . '.inc'); - echo 'autoload(' . $class_name . ")\n"; + require_once(__DIR__ . '/' . $class_name . '.inc'); + echo 'autoload(' . $class_name . ")\n"; }); var_dump(class_exists('autoload_root')); diff --git a/tests/classes/autoload_002.phpt b/tests/classes/autoload_002.phpt index 63364c2082..752a9928af 100644 --- a/tests/classes/autoload_002.phpt +++ b/tests/classes/autoload_002.phpt @@ -8,8 +8,8 @@ ZE2 Autoload and get_class_methods <?php spl_autoload_register(function ($class_name) { - require_once(__DIR__ . '/' . $class_name . '.inc'); - echo 'autoload(' . $class_name . ")\n"; + require_once(__DIR__ . '/' . $class_name . '.inc'); + echo 'autoload(' . $class_name . ")\n"; }); var_dump(get_class_methods('autoload_root')); diff --git a/tests/classes/autoload_003.phpt b/tests/classes/autoload_003.phpt index 7680509b3f..05887433c3 100644 --- a/tests/classes/autoload_003.phpt +++ b/tests/classes/autoload_003.phpt @@ -8,8 +8,8 @@ ZE2 Autoload and derived classes <?php spl_autoload_register(function ($class_name) { - require_once(__DIR__ . '/' . $class_name . '.inc'); - echo 'autoload(' . $class_name . ")\n"; + require_once(__DIR__ . '/' . $class_name . '.inc'); + echo 'autoload(' . $class_name . ")\n"; }); var_dump(class_exists('autoload_derived')); diff --git a/tests/classes/autoload_004.phpt b/tests/classes/autoload_004.phpt index 4fc61a1846..8539e07433 100644 --- a/tests/classes/autoload_004.phpt +++ b/tests/classes/autoload_004.phpt @@ -8,9 +8,9 @@ ZE2 Autoload and recursion <?php spl_autoload_register(function ($class_name) { - var_dump(class_exists($class_name)); - require_once(__DIR__ . '/' . $class_name . '.inc'); - echo 'autoload(' . $class_name . ")\n"; + var_dump(class_exists($class_name)); + require_once(__DIR__ . '/' . $class_name . '.inc'); + echo 'autoload(' . $class_name . ")\n"; }); var_dump(class_exists('autoload_derived')); diff --git a/tests/classes/autoload_005.phpt b/tests/classes/autoload_005.phpt index 408fad259e..72d83b88f6 100644 --- a/tests/classes/autoload_005.phpt +++ b/tests/classes/autoload_005.phpt @@ -8,9 +8,9 @@ ZE2 Autoload from destructor <?php spl_autoload_register(function ($class_name) { - var_dump(class_exists($class_name, false)); - require_once(__DIR__ . '/' . $class_name . '.inc'); - echo 'autoload(' . $class_name . ")\n"; + var_dump(class_exists($class_name, false)); + require_once(__DIR__ . '/' . $class_name . '.inc'); + echo 'autoload(' . $class_name . ")\n"; }); var_dump(class_exists('autoload_derived', false)); diff --git a/tests/classes/autoload_006.phpt b/tests/classes/autoload_006.phpt index fca24441b5..f17011ca5e 100644 --- a/tests/classes/autoload_006.phpt +++ b/tests/classes/autoload_006.phpt @@ -8,8 +8,8 @@ ZE2 Autoload from destructor <?php spl_autoload_register(function ($class_name) { - require_once(__DIR__ . '/' . strtolower($class_name) . '.inc'); - echo 'autoload(' . $class_name . ")\n"; + require_once(__DIR__ . '/' . strtolower($class_name) . '.inc'); + echo 'autoload(' . $class_name . ")\n"; }); var_dump(interface_exists('autoload_interface', false)); diff --git a/tests/classes/autoload_021.phpt b/tests/classes/autoload_021.phpt index f3dd8ff26d..673813cb2e 100644 --- a/tests/classes/autoload_021.phpt +++ b/tests/classes/autoload_021.phpt @@ -3,7 +3,7 @@ Validation of class names in the autoload process --FILE-- <?php spl_autoload_register(function ($name) { - echo "$name\n"; + echo "$name\n"; }); $a = "../BUG"; $x = new $a; diff --git a/tests/classes/autoload_implements.inc b/tests/classes/autoload_implements.inc index 55fcc3cd9f..e5f19c0680 100644 --- a/tests/classes/autoload_implements.inc +++ b/tests/classes/autoload_implements.inc @@ -1,10 +1,10 @@ <?php class autoload_implements implements autoload_interface { - function testFunction() - { - return true; - } + function testFunction() + { + return true; + } } ?> diff --git a/tests/classes/autoload_interface.inc b/tests/classes/autoload_interface.inc index e6a416e721..6e696f36bf 100644 --- a/tests/classes/autoload_interface.inc +++ b/tests/classes/autoload_interface.inc @@ -1,7 +1,7 @@ <?php interface autoload_interface { - function testFunction(); + function testFunction(); } ?> diff --git a/tests/classes/autoload_root.inc b/tests/classes/autoload_root.inc index 98149c59b5..44200a8d8e 100644 --- a/tests/classes/autoload_root.inc +++ b/tests/classes/autoload_root.inc @@ -1,10 +1,10 @@ <?php class autoload_root { - function testFunction() - { - return true; - } + function testFunction() + { + return true; + } } ?> diff --git a/tests/classes/bug26737.phpt b/tests/classes/bug26737.phpt index e190318ffd..ac7b67f5c7 100644 --- a/tests/classes/bug26737.phpt +++ b/tests/classes/bug26737.phpt @@ -4,14 +4,14 @@ Bug #26737 (Protected and private variables are not saved on serialization when <?php class foo { - private $private = 'private'; - protected $protected = 'protected'; - public $public = 'public'; + private $private = 'private'; + protected $protected = 'protected'; + public $public = 'public'; - public function __sleep() - { - return array('private', 'protected', 'public', 'no_such'); - } + public function __sleep() + { + return array('private', 'protected', 'public', 'no_such'); + } } $foo = new foo(); $data = serialize($foo); diff --git a/tests/classes/bug27468.phpt b/tests/classes/bug27468.phpt index 1c54fa61ce..4ef8d44a61 100644 --- a/tests/classes/bug27468.phpt +++ b/tests/classes/bug27468.phpt @@ -3,9 +3,9 @@ Bug #27468 (foreach in __destruct() causes segfault) --FILE-- <?php class foo { - function __destruct() { - foreach ($this->x as $x); - } + function __destruct() { + foreach ($this->x as $x); + } } new foo(); echo 'OK'; diff --git a/tests/classes/bug75765.phpt b/tests/classes/bug75765.phpt index 650ca65e96..b3c8a17f6f 100644 --- a/tests/classes/bug75765.phpt +++ b/tests/classes/bug75765.phpt @@ -4,11 +4,11 @@ Ensure that extending of undefined class throws the exception <?php try { - class A extends B {} + class A extends B {} } catch (Error $e) { - var_dump(class_exists('A')); - var_dump(class_exists('B')); - throw $e; + var_dump(class_exists('A')); + var_dump(class_exists('B')); + throw $e; } ?> diff --git a/tests/classes/class_abstract.phpt b/tests/classes/class_abstract.phpt index d852884d52..2d5b4630c4 100644 --- a/tests/classes/class_abstract.phpt +++ b/tests/classes/class_abstract.phpt @@ -4,9 +4,9 @@ ZE2 An abstract class cannot be instantiated <?php abstract class base { - function show() { - echo "base\n"; - } + function show() { + echo "base\n"; + } } class derived extends base { diff --git a/tests/classes/class_final.phpt b/tests/classes/class_final.phpt index 45cbc72751..885b565952 100644 --- a/tests/classes/class_final.phpt +++ b/tests/classes/class_final.phpt @@ -4,9 +4,9 @@ ZE2 A final class cannot be inherited <?php final class base { - function show() { - echo "base\n"; - } + function show() { + echo "base\n"; + } } $t = new base(); diff --git a/tests/classes/clone_001.phpt b/tests/classes/clone_001.phpt index e1d200be26..ac026e551a 100644 --- a/tests/classes/clone_001.phpt +++ b/tests/classes/clone_001.phpt @@ -3,9 +3,9 @@ ZE2 object cloning, 1 --FILE-- <?php class test { - public $p1 = 1; - public $p2 = 2; - public $p3; + public $p1 = 1; + public $p2 = 2; + public $p3; }; $obj = new test; diff --git a/tests/classes/clone_002.phpt b/tests/classes/clone_002.phpt index b2f73b4b80..7bca4392b7 100644 --- a/tests/classes/clone_002.phpt +++ b/tests/classes/clone_002.phpt @@ -3,11 +3,11 @@ ZE2 object cloning, 2 --FILE-- <?php class test { - public $p1 = 1; - public $p2 = 2; - public $p3; - public function __clone() { - } + public $p1 = 1; + public $p2 = 2; + public $p3; + public function __clone() { + } }; $obj = new test; diff --git a/tests/classes/clone_003.phpt b/tests/classes/clone_003.phpt index e595a59066..30d4cc549a 100644 --- a/tests/classes/clone_003.phpt +++ b/tests/classes/clone_003.phpt @@ -3,24 +3,24 @@ ZE2 object cloning, 3 --FILE-- <?php class base { - protected $p1 = 'base:1'; - public $p2 = 'base:2'; - public $p3 = 'base:3'; - public $p4 = 'base:4'; - public $p5 = 'base:5'; - private $p6 = 'base:6'; - public function __clone() { - } + protected $p1 = 'base:1'; + public $p2 = 'base:2'; + public $p3 = 'base:3'; + public $p4 = 'base:4'; + public $p5 = 'base:5'; + private $p6 = 'base:6'; + public function __clone() { + } }; class test extends base { - public $p1 = 'test:1'; - public $p3 = 'test:3'; - public $p4 = 'test:4'; - public $p5 = 'test:5'; - public function __clone() { - $this->p5 = 'clone:5'; - } + public $p1 = 'test:1'; + public $p3 = 'test:3'; + public $p4 = 'test:4'; + public $p5 = 'test:5'; + public function __clone() { + $this->p5 = 'clone:5'; + } } $obj = new test; diff --git a/tests/classes/clone_004.phpt b/tests/classes/clone_004.phpt index 88ad916bb4..610a00e702 100644 --- a/tests/classes/clone_004.phpt +++ b/tests/classes/clone_004.phpt @@ -16,7 +16,7 @@ class test extends base { public function __clone() {} public function show() { - var_dump($this); + var_dump($this); } } diff --git a/tests/classes/clone_006.phpt b/tests/classes/clone_006.phpt index d8a6140358..16f6bfe508 100644 --- a/tests/classes/clone_006.phpt +++ b/tests/classes/clone_006.phpt @@ -6,16 +6,16 @@ error_reporting=2047 <?php class MyCloneable { - static $id = 0; + static $id = 0; - function __construct() { - $this->id = self::$id++; - } + function __construct() { + $this->id = self::$id++; + } - function __clone() { - $this->address = "New York"; - $this->id = self::$id++; - } + function __clone() { + $this->address = "New York"; + $this->id = self::$id++; + } } $original = new MyCloneable(); diff --git a/tests/classes/constants_basic_003.inc b/tests/classes/constants_basic_003.inc index 17e067b534..c7439f460a 100644 --- a/tests/classes/constants_basic_003.inc +++ b/tests/classes/constants_basic_003.inc @@ -1,5 +1,5 @@ <?php class A { - const MY_CONST = "hello from A"; + const MY_CONST = "hello from A"; } ?> diff --git a/tests/classes/constants_comments_001.phpt b/tests/classes/constants_comments_001.phpt index 297ad9f956..46bf4fafff 100644 --- a/tests/classes/constants_comments_001.phpt +++ b/tests/classes/constants_comments_001.phpt @@ -5,22 +5,22 @@ opcache.save_comments=1 --FILE-- <?php class X { - /** comment X1 */ - const X1 = 1; - const X2 = 2; - /** comment X3 */ - const X3 = 3; + /** comment X1 */ + const X1 = 1; + const X2 = 2; + /** comment X3 */ + const X3 = 3; } class Y extends X { - /** comment Y1 */ - const Y1 = 1; - const Y2 = 2; - /** comment Y3 */ - const Y3 = 3; + /** comment Y1 */ + const Y1 = 1; + const Y2 = 2; + /** comment Y3 */ + const Y3 = 3; } $r = new ReflectionClass('Y'); foreach ($r->getReflectionConstants() as $rc) { - echo $rc->getName() . " : " . $rc->getDocComment() . "\n"; + echo $rc->getName() . " : " . $rc->getDocComment() . "\n"; } diff --git a/tests/classes/constants_scope_001.phpt b/tests/classes/constants_scope_001.phpt index e9635d8d23..54fc8c4a00 100644 --- a/tests/classes/constants_scope_001.phpt +++ b/tests/classes/constants_scope_001.phpt @@ -4,20 +4,20 @@ ZE2 class constants and scope <?php class ErrorCodes { - const FATAL = "Fatal error\n"; - const WARNING = "Warning\n"; - const INFO = "Informational message\n"; + const FATAL = "Fatal error\n"; + const WARNING = "Warning\n"; + const INFO = "Informational message\n"; - static function print_fatal_error_codes() { - echo "self::FATAL = " . self::FATAL; + static function print_fatal_error_codes() { + echo "self::FATAL = " . self::FATAL; } } class ErrorCodesDerived extends ErrorCodes { - const FATAL = "Worst error\n"; - static function print_fatal_error_codes() { - echo "self::FATAL = " . self::FATAL; - echo "parent::FATAL = " . parent::FATAL; + const FATAL = "Worst error\n"; + static function print_fatal_error_codes() { + echo "self::FATAL = " . self::FATAL; + echo "parent::FATAL = " . parent::FATAL; } } diff --git a/tests/classes/constants_visibility_001.phpt b/tests/classes/constants_visibility_001.phpt index a5eeb47f37..b57fd82127 100644 --- a/tests/classes/constants_visibility_001.phpt +++ b/tests/classes/constants_visibility_001.phpt @@ -3,13 +3,13 @@ Class public constant visibility --FILE-- <?php class A { - public const publicConst = 'publicConst'; - static function staticConstDump() { - var_dump(self::publicConst); - } - function constDump() { - var_dump(self::publicConst); - } + public const publicConst = 'publicConst'; + static function staticConstDump() { + var_dump(self::publicConst); + } + function constDump() { + var_dump(self::publicConst); + } } var_dump(A::publicConst); diff --git a/tests/classes/constants_visibility_002.phpt b/tests/classes/constants_visibility_002.phpt index 56c70a99a1..58c35b7a4a 100644 --- a/tests/classes/constants_visibility_002.phpt +++ b/tests/classes/constants_visibility_002.phpt @@ -3,13 +3,13 @@ Class protected constant visibility --FILE-- <?php class A { - protected const protectedConst = 'protectedConst'; - static function staticConstDump() { - var_dump(self::protectedConst); - } - function constDump() { - var_dump(self::protectedConst); - } + protected const protectedConst = 'protectedConst'; + static function staticConstDump() { + var_dump(self::protectedConst); + } + function constDump() { + var_dump(self::protectedConst); + } } A::staticConstDump(); diff --git a/tests/classes/constants_visibility_003.phpt b/tests/classes/constants_visibility_003.phpt index fe9bb6f6a1..7492af90df 100644 --- a/tests/classes/constants_visibility_003.phpt +++ b/tests/classes/constants_visibility_003.phpt @@ -3,13 +3,13 @@ Class private constant visibility --FILE-- <?php class A { - private const privateConst = 'privateConst'; - static function staticConstDump() { - var_dump(self::privateConst); - } - function constDump() { - var_dump(self::privateConst); - } + private const privateConst = 'privateConst'; + static function staticConstDump() { + var_dump(self::privateConst); + } + function constDump() { + var_dump(self::privateConst); + } } A::staticConstDump(); diff --git a/tests/classes/constants_visibility_004.phpt b/tests/classes/constants_visibility_004.phpt index 983b2e247b..d35597b365 100644 --- a/tests/classes/constants_visibility_004.phpt +++ b/tests/classes/constants_visibility_004.phpt @@ -3,16 +3,16 @@ Only public and protected class constants should be inherited --FILE-- <?php class A { - public const X = 1; - protected const Y = 2; - private const Z = 3; + public const X = 1; + protected const Y = 2; + private const Z = 3; } class B extends A { - static public function checkConstants() { - var_dump(self::X); - var_dump(self::Y); - var_dump(self::Z); - } + static public function checkConstants() { + var_dump(self::X); + var_dump(self::Y); + var_dump(self::Z); + } } B::checkConstants(); diff --git a/tests/classes/constants_visibility_005.phpt b/tests/classes/constants_visibility_005.phpt index 813009c675..ff5c10ca13 100644 --- a/tests/classes/constants_visibility_005.phpt +++ b/tests/classes/constants_visibility_005.phpt @@ -3,7 +3,7 @@ Static constants are not allowed --FILE-- <?php class A { - static const X = 1; + static const X = 1; } ?> --EXPECTF-- diff --git a/tests/classes/constants_visibility_006.phpt b/tests/classes/constants_visibility_006.phpt index a3317cca8a..46300abf40 100644 --- a/tests/classes/constants_visibility_006.phpt +++ b/tests/classes/constants_visibility_006.phpt @@ -3,7 +3,7 @@ Abstract constants are not allowed --FILE-- <?php class A { - abstract const X = 1; + abstract const X = 1; } ?> --EXPECTF-- diff --git a/tests/classes/constants_visibility_007.phpt b/tests/classes/constants_visibility_007.phpt index f1b040c5c3..37b5285586 100644 --- a/tests/classes/constants_visibility_007.phpt +++ b/tests/classes/constants_visibility_007.phpt @@ -3,7 +3,7 @@ Final constants are not allowed --FILE-- <?php class A { - final const X = 1; + final const X = 1; } ?> --EXPECTF-- diff --git a/tests/classes/constants_visibility_error_001.phpt b/tests/classes/constants_visibility_error_001.phpt index 397dd24882..35ccf1e83d 100644 --- a/tests/classes/constants_visibility_error_001.phpt +++ b/tests/classes/constants_visibility_error_001.phpt @@ -3,7 +3,7 @@ Class private constant visibility error --FILE-- <?php class A { - private const privateConst = 'privateConst'; + private const privateConst = 'privateConst'; } var_dump(A::privateConst); diff --git a/tests/classes/constants_visibility_error_002.phpt b/tests/classes/constants_visibility_error_002.phpt index 2980b52c37..2068862942 100644 --- a/tests/classes/constants_visibility_error_002.phpt +++ b/tests/classes/constants_visibility_error_002.phpt @@ -3,7 +3,7 @@ Class protected constant visibility error --FILE-- <?php class A { - protected const protectedConst = 'protectedConst'; + protected const protectedConst = 'protectedConst'; } var_dump(A::protectedConst); diff --git a/tests/classes/constants_visibility_error_003.phpt b/tests/classes/constants_visibility_error_003.phpt index 6f62069c2e..c7a8b3139f 100644 --- a/tests/classes/constants_visibility_error_003.phpt +++ b/tests/classes/constants_visibility_error_003.phpt @@ -4,11 +4,11 @@ A redeclared class constant must have the same or higher visibility <?php class A { - public const publicConst = 0; + public const publicConst = 0; } class B extends A { - protected const publicConst = 1; + protected const publicConst = 1; } --EXPECTF-- Fatal error: Access level to B::publicConst must be public (as in class A) in %s on line 9 diff --git a/tests/classes/constants_visibility_error_004.phpt b/tests/classes/constants_visibility_error_004.phpt index 65bfbd3c2b..6fde322cdd 100644 --- a/tests/classes/constants_visibility_error_004.phpt +++ b/tests/classes/constants_visibility_error_004.phpt @@ -4,11 +4,11 @@ A redeclared class constant must have the same or higher visibility <?php class A { - protected const protectedConst = 0; + protected const protectedConst = 0; } class B extends A { - private const protectedConst = 1; + private const protectedConst = 1; } --EXPECTF-- Fatal error: Access level to B::protectedConst must be protected (as in class A) or weaker in %s on line 9 diff --git a/tests/classes/ctor_dtor.phpt b/tests/classes/ctor_dtor.phpt index bcac143025..3a40f7f568 100644 --- a/tests/classes/ctor_dtor.phpt +++ b/tests/classes/ctor_dtor.phpt @@ -4,21 +4,21 @@ ZE2 The new constructor/destructor is called <?php class early { - function __construct() { - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - } - function __destruct() { - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - } + function __construct() { + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + } + function __destruct() { + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + } } class late { - function __construct() { - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - } - function __destruct() { - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - } + function __construct() { + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + } + function __destruct() { + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + } } $t = new early(); diff --git a/tests/classes/ctor_dtor_inheritance.phpt b/tests/classes/ctor_dtor_inheritance.phpt index 1f3d3483d0..bd1414c8b8 100644 --- a/tests/classes/ctor_dtor_inheritance.phpt +++ b/tests/classes/ctor_dtor_inheritance.phpt @@ -9,38 +9,38 @@ ZE2 A derived class can use the inherited constructor/destructor // - base class constructors/destructors know the instantiated class name class base { - public $name; + public $name; - function __construct() { - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - $this->name = 'base'; - print_r($this); - } + function __construct() { + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + $this->name = 'base'; + print_r($this); + } - function __destruct() { - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - print_r($this); - } + function __destruct() { + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + print_r($this); + } } class derived extends base { - public $other; + public $other; - function __construct() { - $this->name = 'init'; - $this->other = 'other'; - print_r($this); - parent::__construct(); - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - $this->name = 'derived'; - print_r($this); - } + function __construct() { + $this->name = 'init'; + $this->other = 'other'; + print_r($this); + parent::__construct(); + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + $this->name = 'derived'; + print_r($this); + } - function __destruct() { - parent::__destruct(); - echo __CLASS__ . "::" . __FUNCTION__ . "\n"; - print_r($this); - } + function __destruct() { + parent::__destruct(); + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + print_r($this); + } } echo "Testing class base\n"; diff --git a/tests/classes/ctor_in_interface_01.phpt b/tests/classes/ctor_in_interface_01.phpt index fc97371f6f..e1ef717f90 100644 --- a/tests/classes/ctor_in_interface_01.phpt +++ b/tests/classes/ctor_in_interface_01.phpt @@ -4,14 +4,14 @@ ZE2 A class constructor must keep the signature of an interface <?php interface constr { - function __construct(); + function __construct(); } class implem implements constr { - function __construct($a) - { - } + function __construct($a) + { + } } ?> diff --git a/tests/classes/ctor_in_interface_02.phpt b/tests/classes/ctor_in_interface_02.phpt index 08e6f36e0e..3484432eae 100644 --- a/tests/classes/ctor_in_interface_02.phpt +++ b/tests/classes/ctor_in_interface_02.phpt @@ -4,7 +4,7 @@ ZE2 A class constructor must keep the signature of all interfaces <?php interface constr1 { - function __construct(); + function __construct(); } interface constr2 extends constr1 @@ -13,21 +13,21 @@ interface constr2 extends constr1 class implem12 implements constr2 { - function __construct() - { - } + function __construct() + { + } } interface constr3 { - function __construct($a); + function __construct($a); } class implem13 implements constr1, constr3 { - function __construct() - { - } + function __construct() + { + } } ?> --EXPECTF-- diff --git a/tests/classes/ctor_in_interface_03.phpt b/tests/classes/ctor_in_interface_03.phpt index 25d7f9dc82..42c70764b9 100644 --- a/tests/classes/ctor_in_interface_03.phpt +++ b/tests/classes/ctor_in_interface_03.phpt @@ -4,7 +4,7 @@ ZE2 A class constructor must keep the signature of base class interfaces <?php interface constr { - function __construct(); + function __construct(); } abstract class implem implements constr @@ -13,9 +13,9 @@ abstract class implem implements constr class derived extends implem { - function __construct($a) - { - } + function __construct($a) + { + } } ?> diff --git a/tests/classes/ctor_in_interface_04.phpt b/tests/classes/ctor_in_interface_04.phpt index 0b07f9a1ca..2bc532f434 100644 --- a/tests/classes/ctor_in_interface_04.phpt +++ b/tests/classes/ctor_in_interface_04.phpt @@ -4,21 +4,21 @@ ZE2 A class constructor must keep the signature of base class interfaces <?php interface constr { - function __construct(); + function __construct(); } class implem implements constr { - function __construct() - { - } + function __construct() + { + } } class derived extends implem { - function __construct($a) - { - } + function __construct($a) + { + } } ?> diff --git a/tests/classes/ctor_visibility.phpt b/tests/classes/ctor_visibility.phpt index 685c7dbe41..6316ed5e12 100644 --- a/tests/classes/ctor_visibility.phpt +++ b/tests/classes/ctor_visibility.phpt @@ -13,16 +13,16 @@ class Test class Derived extends Test { - function __construct() - { + function __construct() + { echo __METHOD__ . "()\n"; - parent::__construct(); - } + parent::__construct(); + } - static function f() - { - new Derived; - } + static function f() + { + new Derived; + } } Derived::f(); @@ -34,26 +34,26 @@ class TestPriv echo __METHOD__ . "()\n"; } - static function f() - { - new TestPriv; - } + static function f() + { + new TestPriv; + } } TestPriv::f(); class DerivedPriv extends TestPriv { - function __construct() - { + function __construct() + { echo __METHOD__ . "()\n"; - parent::__construct(); - } + parent::__construct(); + } - static function f() - { - new DerivedPriv; - } + static function f() + { + new DerivedPriv; + } } DerivedPriv::f(); diff --git a/tests/classes/dereferencing_001.phpt b/tests/classes/dereferencing_001.phpt index e7e90cf5e3..4ec2a87659 100644 --- a/tests/classes/dereferencing_001.phpt +++ b/tests/classes/dereferencing_001.phpt @@ -4,25 +4,25 @@ ZE2 dereferencing of objects from methods <?php class Name { - function __construct($_name) { - $this->name = $_name; - } + function __construct($_name) { + $this->name = $_name; + } - function display() { - echo $this->name . "\n"; - } + function display() { + echo $this->name . "\n"; + } } class Person { - private $name; + private $name; - function __construct($_name, $_address) { - $this->name = new Name($_name); - } + function __construct($_name, $_address) { + $this->name = new Name($_name); + } - function getName() { - return $this->name; - } + function getName() { + return $this->name; + } } $person = new Person("John", "New York"); diff --git a/tests/classes/destructor_and_exceptions.phpt b/tests/classes/destructor_and_exceptions.phpt index f58bb8de7f..0f51a21a09 100644 --- a/tests/classes/destructor_and_exceptions.phpt +++ b/tests/classes/destructor_and_exceptions.phpt @@ -5,48 +5,48 @@ ZE2 catch exception thrown in destructor class FailClass { - public $fatal; + public $fatal; - function __destruct() - { - echo __METHOD__ . "\n"; - throw new exception("FailClass"); - echo "Done: " . __METHOD__ . "\n"; - } + function __destruct() + { + echo __METHOD__ . "\n"; + throw new exception("FailClass"); + echo "Done: " . __METHOD__ . "\n"; + } } try { - $a = new FailClass; - unset($a); + $a = new FailClass; + unset($a); } catch(Exception $e) { - echo "Caught: " . $e->getMessage() . "\n"; + echo "Caught: " . $e->getMessage() . "\n"; } class FatalException extends Exception { - function __construct($what) - { - echo __METHOD__ . "\n"; - $o = new FailClass; - unset($o); - echo "Done: " . __METHOD__ . "\n"; - } + function __construct($what) + { + echo __METHOD__ . "\n"; + $o = new FailClass; + unset($o); + echo "Done: " . __METHOD__ . "\n"; + } } try { - throw new FatalException("Damn"); + throw new FatalException("Damn"); } catch(Exception $e) { - echo "Caught Exception: " . $e->getMessage() . "\n"; + echo "Caught Exception: " . $e->getMessage() . "\n"; } catch(FatalException $e) { - echo "Caught FatalException: " . $e->getMessage() . "\n"; + echo "Caught FatalException: " . $e->getMessage() . "\n"; } ?> diff --git a/tests/classes/destructor_and_globals.phpt b/tests/classes/destructor_and_globals.phpt index 1276d28348..5e0773b00c 100644 --- a/tests/classes/destructor_and_globals.phpt +++ b/tests/classes/destructor_and_globals.phpt @@ -30,8 +30,8 @@ class counter { } static public function destroy(&$obj) { - $obj = NULL; - } + $obj = NULL; + } } Show(); $obj1 = new counter; diff --git a/tests/classes/destructor_visibility_001.phpt b/tests/classes/destructor_visibility_001.phpt index b48d000f91..41def0e525 100644 --- a/tests/classes/destructor_visibility_001.phpt +++ b/tests/classes/destructor_visibility_001.phpt @@ -4,9 +4,9 @@ ZE2 Ensuring destructor visibility <?php class Base { - private function __destruct() { - echo __METHOD__ . "\n"; - } + private function __destruct() { + echo __METHOD__ . "\n"; + } } class Derived extends Base { diff --git a/tests/classes/destructor_visibility_002.phpt b/tests/classes/destructor_visibility_002.phpt index 96cf275a7c..227cc1aff0 100644 --- a/tests/classes/destructor_visibility_002.phpt +++ b/tests/classes/destructor_visibility_002.phpt @@ -4,9 +4,9 @@ ZE2 Ensuring destructor visibility <?php class Base { - private function __destruct() { - echo __METHOD__ . "\n"; - } + private function __destruct() { + echo __METHOD__ . "\n"; + } } class Derived extends Base { diff --git a/tests/classes/destructor_visibility_003.phpt b/tests/classes/destructor_visibility_003.phpt index 2af03d7441..78551a7e01 100644 --- a/tests/classes/destructor_visibility_003.phpt +++ b/tests/classes/destructor_visibility_003.phpt @@ -4,15 +4,15 @@ ZE2 Ensuring destructor visibility <?php class Base { - private function __destruct() { - echo __METHOD__ . "\n"; - } + private function __destruct() { + echo __METHOD__ . "\n"; + } } class Derived extends Base { - public function __destruct() { - echo __METHOD__ . "\n"; - } + public function __destruct() { + echo __METHOD__ . "\n"; + } } $obj = new Derived; diff --git a/tests/classes/factory_001.phpt b/tests/classes/factory_001.phpt index 45f97331a5..96af2acef7 100644 --- a/tests/classes/factory_001.phpt +++ b/tests/classes/factory_001.phpt @@ -4,24 +4,24 @@ ZE2 factory objects <?php class Circle { - function draw() { - echo "Circle\n"; - } + function draw() { + echo "Circle\n"; + } } class Square { - function draw() { - print "Square\n"; - } + function draw() { + print "Square\n"; + } } function ShapeFactoryMethod($shape) { - switch ($shape) { - case "Circle": - return new Circle(); - case "Square": - return new Square(); - } + switch ($shape) { + case "Circle": + return new Circle(); + case "Square": + return new Square(); + } } ShapeFactoryMethod("Circle")->draw(); diff --git a/tests/classes/factory_and_singleton_001.phpt b/tests/classes/factory_and_singleton_001.phpt index dbbf07cfad..ead7d480cd 100644 --- a/tests/classes/factory_and_singleton_001.phpt +++ b/tests/classes/factory_and_singleton_001.phpt @@ -27,7 +27,7 @@ class test { } protected function __destruct() { - test::$cnt--; + test::$cnt--; } public function get() { diff --git a/tests/classes/factory_and_singleton_002.phpt b/tests/classes/factory_and_singleton_002.phpt index 6748321242..c4132f9d38 100644 --- a/tests/classes/factory_and_singleton_002.phpt +++ b/tests/classes/factory_and_singleton_002.phpt @@ -27,7 +27,7 @@ class test { } protected function __destruct() { - test::$cnt--; + test::$cnt--; } public function get() { diff --git a/tests/classes/factory_and_singleton_009.phpt b/tests/classes/factory_and_singleton_009.phpt index c1cfcbdcdf..7795ea4a79 100644 --- a/tests/classes/factory_and_singleton_009.phpt +++ b/tests/classes/factory_and_singleton_009.phpt @@ -5,7 +5,7 @@ ZE2 factory and singleton, test 9 class test { protected function __destruct() { - echo __METHOD__ . "\n"; + echo __METHOD__ . "\n"; } } diff --git a/tests/classes/factory_and_singleton_010.phpt b/tests/classes/factory_and_singleton_010.phpt index 9466fe55e4..a816b3f60f 100644 --- a/tests/classes/factory_and_singleton_010.phpt +++ b/tests/classes/factory_and_singleton_010.phpt @@ -5,7 +5,7 @@ ZE2 factory and singleton, test 10 class test { private function __destruct() { - echo __METHOD__ . "\n"; + echo __METHOD__ . "\n"; } } diff --git a/tests/classes/final.phpt b/tests/classes/final.phpt index 0e100d2304..75be8ec2f4 100644 --- a/tests/classes/final.phpt +++ b/tests/classes/final.phpt @@ -4,18 +4,18 @@ ZE2 A method may be redeclared final <?php class first { - function show() { - echo "Call to function first::show()\n"; - } + function show() { + echo "Call to function first::show()\n"; + } } $t = new first(); $t->show(); class second extends first { - final function show() { - echo "Call to function second::show()\n"; - } + final function show() { + echo "Call to function second::show()\n"; + } } $t2 = new second(); diff --git a/tests/classes/final_abstract.phpt b/tests/classes/final_abstract.phpt index 229ae896b0..66f5c87a6f 100644 --- a/tests/classes/final_abstract.phpt +++ b/tests/classes/final_abstract.phpt @@ -4,7 +4,7 @@ ZE2 A final method cannot be abstract <?php class fail { - final abstract function show(); + final abstract function show(); } echo "Done\n"; // Shouldn't be displayed diff --git a/tests/classes/final_ctor1.phpt b/tests/classes/final_ctor1.phpt index 33fcbe6bd8..092dd146d4 100644 --- a/tests/classes/final_ctor1.phpt +++ b/tests/classes/final_ctor1.phpt @@ -5,9 +5,9 @@ ZE2 cannot override final __construct class Base { - public final function __construct() - { - } + public final function __construct() + { + } } class Works extends Base @@ -16,9 +16,9 @@ class Works extends Base class Extended extends Base { - public function __construct() - { - } + public function __construct() + { + } } ?> diff --git a/tests/classes/final_redeclare.phpt b/tests/classes/final_redeclare.phpt index d3d53c5dc7..e6dc38b908 100644 --- a/tests/classes/final_redeclare.phpt +++ b/tests/classes/final_redeclare.phpt @@ -4,17 +4,17 @@ ZE2 A final method may not be overwritten <?php class pass { - final function show() { - echo "Call to function pass::show()\n"; - } + final function show() { + echo "Call to function pass::show()\n"; + } } $t = new pass(); class fail extends pass { - function show() { - echo "Call to function fail::show()\n"; - } + function show() { + echo "Call to function fail::show()\n"; + } } echo "Done\n"; // Shouldn't be displayed diff --git a/tests/classes/incdec_property_001.phpt b/tests/classes/incdec_property_001.phpt index 8517a9fc4d..664c474097 100644 --- a/tests/classes/incdec_property_001.phpt +++ b/tests/classes/incdec_property_001.phpt @@ -4,19 +4,19 @@ ZE2 post increment/decrement property of overloaded object <?php class Test { - private $real_a = 2; + private $real_a = 2; - function __set($property, $value) { - if ($property == "a") { - $this->real_a = $value; - } - } + function __set($property, $value) { + if ($property == "a") { + $this->real_a = $value; + } + } - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } } $obj = new Test; diff --git a/tests/classes/incdec_property_002.phpt b/tests/classes/incdec_property_002.phpt index 930a58dc07..5e853c63e9 100644 --- a/tests/classes/incdec_property_002.phpt +++ b/tests/classes/incdec_property_002.phpt @@ -4,19 +4,19 @@ ZE2 post increment/decrement property of overloaded object with assignment <?php class Test { - private $real_a = 2; + private $real_a = 2; - function __set($property, $value) { - if ($property == "a") { - $this->real_a = $value; - } - } + function __set($property, $value) { + if ($property == "a") { + $this->real_a = $value; + } + } - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } } $obj = new Test; diff --git a/tests/classes/incdec_property_003.phpt b/tests/classes/incdec_property_003.phpt index edf3c00963..f2a696f7ea 100644 --- a/tests/classes/incdec_property_003.phpt +++ b/tests/classes/incdec_property_003.phpt @@ -4,19 +4,19 @@ ZE2 pre increment/decrement property of overloaded object <?php class Test { - private $real_a = 2; + private $real_a = 2; - function __set($property, $value) { - if ($property == "a") { - $this->real_a = $value; - } - } + function __set($property, $value) { + if ($property == "a") { + $this->real_a = $value; + } + } - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } } $obj = new Test; diff --git a/tests/classes/incdec_property_004.phpt b/tests/classes/incdec_property_004.phpt index 2267d568af..7a686bdf59 100644 --- a/tests/classes/incdec_property_004.phpt +++ b/tests/classes/incdec_property_004.phpt @@ -4,19 +4,19 @@ ZE2 pre increment/decrement property of overloaded object with assignment <?php class Test { - private $real_a = 2; + private $real_a = 2; - function __set($property, $value) { - if ($property == "a") { - $this->real_a = $value; - } - } + function __set($property, $value) { + if ($property == "a") { + $this->real_a = $value; + } + } - function __get($property) { - if ($property == "a") { - return $this->real_a; - } - } + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } } $obj = new Test; diff --git a/tests/classes/inheritance.phpt b/tests/classes/inheritance.phpt index 3f7e38b9ef..44b3cbc5bf 100644 --- a/tests/classes/inheritance.phpt +++ b/tests/classes/inheritance.phpt @@ -9,7 +9,7 @@ class foo { public $a; public $b; function display() { - echo "This is class foo\n"; + echo "This is class foo\n"; echo "a = ".$this->a."\n"; echo "b = ".$this->b."\n"; } diff --git a/tests/classes/inheritance_003.phpt b/tests/classes/inheritance_003.phpt index 925544e754..224c8299aa 100644 --- a/tests/classes/inheritance_003.phpt +++ b/tests/classes/inheritance_003.phpt @@ -5,12 +5,12 @@ ZE2 method inheritance without interfaces class A { - function f($x) {} + function f($x) {} } class B extends A { - function f() {} + function f() {} } ?> diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt index 682bee7a1b..5ea656febb 100644 --- a/tests/classes/inheritance_004.phpt +++ b/tests/classes/inheritance_004.phpt @@ -10,7 +10,7 @@ function f() {} class B extends A { - function f($x) {} + function f($x) {} } ?> diff --git a/tests/classes/inheritance_006.phpt b/tests/classes/inheritance_006.phpt index 3d5c275011..6009c35ffc 100644 --- a/tests/classes/inheritance_006.phpt +++ b/tests/classes/inheritance_006.phpt @@ -3,11 +3,11 @@ Private property inheritance check --FILE-- <?php Class A { - private $c; + private $c; } Class B extends A { - private $c; + private $c; } Class C extends B { diff --git a/tests/classes/interface_and_extends.phpt b/tests/classes/interface_and_extends.phpt index 8bb1ec05f1..080ba24da9 100644 --- a/tests/classes/interface_and_extends.phpt +++ b/tests/classes/interface_and_extends.phpt @@ -5,14 +5,14 @@ ZE2 a class cannot extend an interface interface Test { - function show(); + function show(); } class Tester extends Test { - function show() { - echo __METHOD__ . "\n"; - } + function show() { + echo __METHOD__ . "\n"; + } } $o = new Tester; diff --git a/tests/classes/interface_constant_inheritance_001.phpt b/tests/classes/interface_constant_inheritance_001.phpt index 9f5e76d297..a925097cdb 100644 --- a/tests/classes/interface_constant_inheritance_001.phpt +++ b/tests/classes/interface_constant_inheritance_001.phpt @@ -3,11 +3,11 @@ Ensure an interface may not shadow an inherited constant. --FILE-- <?php interface I1 { - const FOO = 10; + const FOO = 10; } interface I2 extends I1 { - const FOO = 10; + const FOO = 10; } echo "Done\n"; diff --git a/tests/classes/interface_constant_inheritance_002.phpt b/tests/classes/interface_constant_inheritance_002.phpt index 681de11cbf..8840f7caf4 100644 --- a/tests/classes/interface_constant_inheritance_002.phpt +++ b/tests/classes/interface_constant_inheritance_002.phpt @@ -3,11 +3,11 @@ Ensure a class may not shadow a constant inherited from an interface. --FILE-- <?php interface I { - const FOO = 10; + const FOO = 10; } class C implements I { - const FOO = 10; + const FOO = 10; } echo "Done\n"; diff --git a/tests/classes/interface_constant_inheritance_003.phpt b/tests/classes/interface_constant_inheritance_003.phpt index b4902f7306..de867f5dfc 100644 --- a/tests/classes/interface_constant_inheritance_003.phpt +++ b/tests/classes/interface_constant_inheritance_003.phpt @@ -3,11 +3,11 @@ Ensure a class may not inherit two constants with the same name from two separat --FILE-- <?php interface I1 { - const FOO = 10; + const FOO = 10; } interface I2 { - const FOO = 10; + const FOO = 10; } class C implements I1,I2 { diff --git a/tests/classes/interface_constant_inheritance_004.phpt b/tests/classes/interface_constant_inheritance_004.phpt index aca9865eb1..359ce58b38 100644 --- a/tests/classes/interface_constant_inheritance_004.phpt +++ b/tests/classes/interface_constant_inheritance_004.phpt @@ -3,7 +3,7 @@ Ensure a class may implement two interfaces which include the same constant (due --FILE-- <?php interface IA { - const FOO = 10; + const FOO = 10; } interface IB extends IA { diff --git a/tests/classes/interface_constant_inheritance_005.phpt b/tests/classes/interface_constant_inheritance_005.phpt index 1abb85751e..3d728ae46a 100644 --- a/tests/classes/interface_constant_inheritance_005.phpt +++ b/tests/classes/interface_constant_inheritance_005.phpt @@ -3,7 +3,7 @@ Ensure a interface can have public constants --FILE-- <?php interface IA { - public const FOO = 10; + public const FOO = 10; } echo "Done\n"; diff --git a/tests/classes/interface_constant_inheritance_006.phpt b/tests/classes/interface_constant_inheritance_006.phpt index 7e303bb152..82ffa7c314 100644 --- a/tests/classes/interface_constant_inheritance_006.phpt +++ b/tests/classes/interface_constant_inheritance_006.phpt @@ -3,7 +3,7 @@ Ensure a interface can not have protected constants --FILE-- <?php interface A { - protected const FOO = 10; + protected const FOO = 10; } --EXPECTF-- Fatal error: Access type for interface constant A::FOO must be public in %s on line 3 diff --git a/tests/classes/interface_constant_inheritance_007.phpt b/tests/classes/interface_constant_inheritance_007.phpt index 766f89b95d..e072e65e63 100644 --- a/tests/classes/interface_constant_inheritance_007.phpt +++ b/tests/classes/interface_constant_inheritance_007.phpt @@ -3,7 +3,7 @@ Ensure a interface can not have private constants --FILE-- <?php interface A { - private const FOO = 10; + private const FOO = 10; } --EXPECTF-- Fatal error: Access type for interface constant A::FOO must be public in %s on line 3 diff --git a/tests/classes/interface_doubled.phpt b/tests/classes/interface_doubled.phpt index 30ecbf650e..4a176892db 100644 --- a/tests/classes/interface_doubled.phpt +++ b/tests/classes/interface_doubled.phpt @@ -4,42 +4,42 @@ ZE2 An interface extends base interfaces <?php interface if_a { - function f_a(); + function f_a(); } interface if_b { - function f_b(); + function f_b(); } interface if_c extends if_a, if_b { - function f_c(); + function f_c(); } interface if_d extends if_a, if_b { - function f_d(); + function f_d(); } interface if_e { - function f_d(); + function f_d(); } interface if_f extends /*if_e,*/ if_a, if_b, if_c, if_d /*, if_e*/ { } class base { - function test($class) { - echo "is_a(" . get_class($this) . ", $class) ". (($this instanceof $class) ? "yes\n" : "no\n"); - } + function test($class) { + echo "is_a(" . get_class($this) . ", $class) ". (($this instanceof $class) ? "yes\n" : "no\n"); + } } echo "class_a\n"; class class_a extends base implements if_a { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} } $t = new class_a(); @@ -52,11 +52,11 @@ echo $t->test('if_e'); echo "class_b\n"; class class_b extends base implements if_a, if_b { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} } $t = new class_b(); @@ -69,11 +69,11 @@ echo $t->test('if_e'); echo "class_c\n"; class class_c extends base implements if_c { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} } $t = new class_c(); @@ -86,11 +86,11 @@ echo $t->test('if_e'); echo "class_d\n"; class class_d extends base implements if_d{ - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} } $t = new class_d(); @@ -103,11 +103,11 @@ echo $t->test('if_e'); echo "class_e\n"; class class_e extends base implements if_a, if_b, if_c, if_d { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} } $t = new class_e(); @@ -120,11 +120,11 @@ echo $t->test('if_e'); echo "class_f\n"; class class_f extends base implements if_e { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} } $t = new class_f(); @@ -137,11 +137,11 @@ echo $t->test('if_e'); echo "class_g\n"; class class_g extends base implements if_f { - function f_a() {} - function f_b() {} - function f_c() {} - function f_d() {} - function f_e() {} + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} } $t = new class_g(); diff --git a/tests/classes/interface_implemented.phpt b/tests/classes/interface_implemented.phpt index e224c5bd23..52bb7de02d 100644 --- a/tests/classes/interface_implemented.phpt +++ b/tests/classes/interface_implemented.phpt @@ -4,40 +4,40 @@ ZE2 An interface is inherited <?php interface if_a { - function f_a(); + function f_a(); } interface if_b extends if_a { - function f_b(); + function f_b(); } class base { - function _is_a($sub) { - echo 'is_a('.get_class($this).', '.$sub.') = '.(($this instanceof $sub) ? 'yes' : 'no')."\n"; - } - function test() { - echo $this->_is_a('base'); - echo $this->_is_a('derived_a'); - echo $this->_is_a('derived_b'); - echo $this->_is_a('derived_c'); - echo $this->_is_a('derived_d'); - echo $this->_is_a('if_a'); - echo $this->_is_a('if_b'); - echo "\n"; - } + function _is_a($sub) { + echo 'is_a('.get_class($this).', '.$sub.') = '.(($this instanceof $sub) ? 'yes' : 'no')."\n"; + } + function test() { + echo $this->_is_a('base'); + echo $this->_is_a('derived_a'); + echo $this->_is_a('derived_b'); + echo $this->_is_a('derived_c'); + echo $this->_is_a('derived_d'); + echo $this->_is_a('if_a'); + echo $this->_is_a('if_b'); + echo "\n"; + } } class derived_a extends base implements if_a { - function f_a() {} + function f_a() {} } class derived_b extends base implements if_a, if_b { - function f_a() {} - function f_b() {} + function f_a() {} + function f_b() {} } class derived_c extends derived_a implements if_b { - function f_b() {} + function f_b() {} } class derived_d extends derived_c { diff --git a/tests/classes/interface_instantiate.phpt b/tests/classes/interface_instantiate.phpt index 04b0e29701..2fab5fd3da 100644 --- a/tests/classes/interface_instantiate.phpt +++ b/tests/classes/interface_instantiate.phpt @@ -4,7 +4,7 @@ ZE2 An interface cannot be instantiated <?php interface if_a { - function f_a(); + function f_a(); } $t = new if_a(); diff --git a/tests/classes/interface_member.phpt b/tests/classes/interface_member.phpt index 3b50b30ffe..d44b497ca4 100644 --- a/tests/classes/interface_member.phpt +++ b/tests/classes/interface_member.phpt @@ -4,7 +4,7 @@ ZE2 An interface cannot have properties <?php interface if_a { - public $member; + public $member; } ?> --EXPECTF-- diff --git a/tests/classes/interface_method.phpt b/tests/classes/interface_method.phpt index 491b4c21d6..04e2953676 100644 --- a/tests/classes/interface_method.phpt +++ b/tests/classes/interface_method.phpt @@ -4,7 +4,7 @@ ZE2 An interface method must be abstract <?php interface if_a { - function err() {} + function err() {} } ?> diff --git a/tests/classes/interface_method_final.phpt b/tests/classes/interface_method_final.phpt index e936b5a03a..42783c6f12 100644 --- a/tests/classes/interface_method_final.phpt +++ b/tests/classes/interface_method_final.phpt @@ -4,7 +4,7 @@ ZE2 An interface method cannot be final <?php class if_a { - abstract final function err(); + abstract final function err(); } ?> diff --git a/tests/classes/interface_method_private.phpt b/tests/classes/interface_method_private.phpt index 11f8bf648f..4661a86375 100644 --- a/tests/classes/interface_method_private.phpt +++ b/tests/classes/interface_method_private.phpt @@ -4,7 +4,7 @@ ZE2 An interface method cannot be private <?php interface if_a { - abstract private function err(); + abstract private function err(); } ?> diff --git a/tests/classes/interface_must_be_implemented.phpt b/tests/classes/interface_must_be_implemented.phpt index 7dc39436e9..300ace23e3 100644 --- a/tests/classes/interface_must_be_implemented.phpt +++ b/tests/classes/interface_must_be_implemented.phpt @@ -4,7 +4,7 @@ ZE2 An interface must be implemented <?php interface if_a { - function f_a(); + function f_a(); } class derived_a implements if_a { diff --git a/tests/classes/interface_optional_arg.phpt b/tests/classes/interface_optional_arg.phpt index 6fc97f55fb..ab377e1c76 100644 --- a/tests/classes/interface_optional_arg.phpt +++ b/tests/classes/interface_optional_arg.phpt @@ -6,14 +6,14 @@ ZE2 An interface method allows additional default arguments error_reporting(4095); interface test { - public function bar(); + public function bar(); } class foo implements test { - public function bar($foo = NULL) { - echo "foo\n"; - } + public function bar($foo = NULL) { + echo "foo\n"; + } } $foo = new foo; diff --git a/tests/classes/interface_optional_arg_002.phpt b/tests/classes/interface_optional_arg_002.phpt index 67e6785883..190b47aa4f 100644 --- a/tests/classes/interface_optional_arg_002.phpt +++ b/tests/classes/interface_optional_arg_002.phpt @@ -4,14 +4,14 @@ default argument value in interface implementation <?php interface test { - public function bar(); + public function bar(); } class foo implements test { - public function bar($arg = 2) { - var_dump($arg); - } + public function bar($arg = 2) { + var_dump($arg); + } } $foo = new foo; diff --git a/tests/classes/interface_optional_arg_003.phpt b/tests/classes/interface_optional_arg_003.phpt index cf583fe204..7a972c728b 100644 --- a/tests/classes/interface_optional_arg_003.phpt +++ b/tests/classes/interface_optional_arg_003.phpt @@ -6,7 +6,7 @@ include 'interface_optional_arg_003.inc'; class C implements I { function f($a = 2) { - var_dump($a); + var_dump($a); } } diff --git a/tests/classes/interfaces_001.phpt b/tests/classes/interfaces_001.phpt index 97b48aa03d..3b1aabb6a7 100644 --- a/tests/classes/interfaces_001.phpt +++ b/tests/classes/interfaces_001.phpt @@ -4,15 +4,15 @@ ZE2 interfaces <?php interface ThrowableInterface { - public function getMessage(); + public function getMessage(); } class Exception_foo implements ThrowableInterface { - public $foo = "foo"; + public $foo = "foo"; - public function getMessage() { - return $this->foo; - } + public function getMessage() { + return $this->foo; + } } $foo = new Exception_foo; diff --git a/tests/classes/interfaces_002.phpt b/tests/classes/interfaces_002.phpt index 6cc899bf1d..14ac1f0ffc 100644 --- a/tests/classes/interfaces_002.phpt +++ b/tests/classes/interfaces_002.phpt @@ -4,16 +4,16 @@ ZE2 interface with an unimplemented method <?php interface ThrowableInterface { - public function getMessage(); - public function getErrno(); + public function getMessage(); + public function getErrno(); } class Exception_foo implements ThrowableInterface { - public $foo = "foo"; + public $foo = "foo"; - public function getMessage() { - return $this->foo; - } + public function getMessage() { + return $this->foo; + } } // this should die -- Exception class must be abstract... diff --git a/tests/classes/interfaces_003.phpt b/tests/classes/interfaces_003.phpt index 97b5f7dde5..349dc66bd8 100644 --- a/tests/classes/interfaces_003.phpt +++ b/tests/classes/interfaces_003.phpt @@ -7,14 +7,14 @@ class MyObject {} interface MyInterface { - public function __construct(MyObject $o); + public function __construct(MyObject $o); } class MyTestClass implements MyInterface { - public function __construct(MyObject $o) - { - } + public function __construct(MyObject $o) + { + } } $obj = new MyTestClass; diff --git a/tests/classes/iterators_001.phpt b/tests/classes/iterators_001.phpt index e4060e375f..17588bc8cd 100644 --- a/tests/classes/iterators_001.phpt +++ b/tests/classes/iterators_001.phpt @@ -4,78 +4,78 @@ ZE2 iterators and foreach <?php class c_iter implements Iterator { - private $obj; - private $num = 0; + private $obj; + private $num = 0; - function __construct($obj) { - echo __METHOD__ . "\n"; - $this->num = 0; - $this->obj = $obj; - } - function rewind() { - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } + function __construct($obj) { + echo __METHOD__ . "\n"; + $this->num = 0; + $this->obj = $obj; + } + function rewind() { + } + function valid() { + $more = $this->num < $this->obj->max; + echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; + return $more; + } + function current() { + echo __METHOD__ . "\n"; + return $this->num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function key() { + echo __METHOD__ . "\n"; + switch($this->num) { + case 0: return "1st"; + case 1: return "2nd"; + case 2: return "3rd"; + default: return "???"; + } + } } class c implements IteratorAggregate { - public $max = 3; + public $max = 3; - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } + function getIterator() { + echo __METHOD__ . "\n"; + return new c_iter($this); + } } echo "===Array===\n"; $a = array(0,1,2); foreach($a as $v) { - echo "array:$v\n"; + echo "array:$v\n"; } echo "===Manual===\n"; $t = new c(); for ($iter = $t->getIterator(); $iter->valid(); $iter->next()) { - echo $iter->current() . "\n"; + echo $iter->current() . "\n"; } echo "===foreach/std===\n"; foreach($t as $v) { - echo "object:$v\n"; + echo "object:$v\n"; } echo "===foreach/rec===\n"; foreach($t as $v) { - foreach($t as $w) { - echo "double:$v:$w\n"; - } + foreach($t as $w) { + echo "double:$v:$w\n"; + } } echo "===foreach/key===\n"; foreach($t as $i => $v) { - echo "object:$i=>$v\n"; + echo "object:$i=>$v\n"; } print "Done\n"; diff --git a/tests/classes/iterators_002.phpt b/tests/classes/iterators_002.phpt index 5e1ceb6208..4035f7c4f4 100644 --- a/tests/classes/iterators_002.phpt +++ b/tests/classes/iterators_002.phpt @@ -4,64 +4,64 @@ ZE2 iterators and break <?php class c_iter implements Iterator { - private $obj; - private $num = 0; + private $obj; + private $num = 0; - function __construct($obj) { - echo __METHOD__ . "\n"; - $this->obj = $obj; - } - function rewind() { - echo __METHOD__ . "\n"; - $this->num = 0; - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } - function __destruct() { - echo __METHOD__ . "\n"; - } + function __construct($obj) { + echo __METHOD__ . "\n"; + $this->obj = $obj; + } + function rewind() { + echo __METHOD__ . "\n"; + $this->num = 0; + } + function valid() { + $more = $this->num < $this->obj->max; + echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; + return $more; + } + function current() { + echo __METHOD__ . "\n"; + return $this->num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function key() { + echo __METHOD__ . "\n"; + switch($this->num) { + case 0: return "1st"; + case 1: return "2nd"; + case 2: return "3rd"; + default: return "???"; + } + } + function __destruct() { + echo __METHOD__ . "\n"; + } } class c implements IteratorAggregate { - public $max = 3; + public $max = 3; - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } - function __destruct() { - echo __METHOD__ . "\n"; - } + function getIterator() { + echo __METHOD__ . "\n"; + return new c_iter($this); + } + function __destruct() { + echo __METHOD__ . "\n"; + } } $t = new c(); foreach($t as $k => $v) { - foreach($t as $w) { - echo "double:$v:$w\n"; - break; - } + foreach($t as $w) { + echo "double:$v:$w\n"; + break; + } } unset($t); diff --git a/tests/classes/iterators_003.phpt b/tests/classes/iterators_003.phpt index f417478d49..5557402d8d 100644 --- a/tests/classes/iterators_003.phpt +++ b/tests/classes/iterators_003.phpt @@ -4,66 +4,66 @@ ZE2 iterators and break <?php class c_iter implements Iterator { - private $obj; - private $num = 0; + private $obj; + private $num = 0; - function __construct($obj) { - echo __METHOD__ . "\n"; - $this->obj = $obj; - } - function rewind() { - echo __METHOD__ . "\n"; - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - return $this->num; - } + function __construct($obj) { + echo __METHOD__ . "\n"; + $this->obj = $obj; + } + function rewind() { + echo __METHOD__ . "\n"; + } + function valid() { + $more = $this->num < $this->obj->max; + echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; + return $more; + } + function current() { + echo __METHOD__ . "\n"; + return $this->num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function key() { + return $this->num; + } } class c implements IteratorAggregate { - public $max = 4; + public $max = 4; - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } + function getIterator() { + echo __METHOD__ . "\n"; + return new c_iter($this); + } } $t = new c(); foreach($t as $v) { - if ($v == 0) { - echo "continue outer\n"; - continue; - } - foreach($t as $w) { - if ($w == 1) { - echo "continue inner\n"; - continue; - } - if ($w == 2) { - echo "break inner\n"; - break; - } - echo "double:$v:$w\n"; - } - if ($v == 2) { - echo "break outer\n"; - break; - } + if ($v == 0) { + echo "continue outer\n"; + continue; + } + foreach($t as $w) { + if ($w == 1) { + echo "continue inner\n"; + continue; + } + if ($w == 2) { + echo "break inner\n"; + break; + } + echo "double:$v:$w\n"; + } + if ($v == 2) { + echo "break outer\n"; + break; + } } print "Done\n"; diff --git a/tests/classes/iterators_004.phpt b/tests/classes/iterators_004.phpt index dc5a07a603..77d036a075 100644 --- a/tests/classes/iterators_004.phpt +++ b/tests/classes/iterators_004.phpt @@ -10,43 +10,43 @@ class c1 {} $obj = new c1(); foreach($obj as $w) { - echo "object:$w\n"; + echo "object:$w\n"; } echo "2nd try\n"; class c2 { - public $max = 3; - public $num = 0; - - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function valid() { - echo __METHOD__ . "\n"; - return $this->num < $this->max; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } + public $max = 3; + public $num = 0; + + function current() { + echo __METHOD__ . "\n"; + return $this->num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function valid() { + echo __METHOD__ . "\n"; + return $this->num < $this->max; + } + function key() { + echo __METHOD__ . "\n"; + switch($this->num) { + case 0: return "1st"; + case 1: return "2nd"; + case 2: return "3rd"; + default: return "???"; + } + } } $obj = new c2(); foreach($obj as $v => $w) { - echo "object:$v=>$w\n"; + echo "object:$v=>$w\n"; } print "Done\n"; diff --git a/tests/classes/iterators_006.phpt b/tests/classes/iterators_006.phpt index 0a2d7827e0..8bc8516723 100644 --- a/tests/classes/iterators_006.phpt +++ b/tests/classes/iterators_006.phpt @@ -5,47 +5,47 @@ ZE2 iterators and array wrapping class ai implements Iterator { - private $array; + private $array; - function __construct() { - $this->array = array('foo', 'bar', 'baz'); - } + function __construct() { + $this->array = array('foo', 'bar', 'baz'); + } - function rewind() { - reset($this->array); - $this->next(); - } + function rewind() { + reset($this->array); + $this->next(); + } - function valid() { - return $this->key !== NULL; - } + function valid() { + return $this->key !== NULL; + } - function key() { - return $this->key; - } + function key() { + return $this->key; + } - function current() { - return $this->current; - } + function current() { + return $this->current; + } - function next() { + function next() { $this->key = key($this->array); $this->current = current($this->array); next($this->array); - } + } } class a implements IteratorAggregate { - public function getIterator() { - return new ai(); - } + public function getIterator() { + return new ai(); + } } $array = new a(); foreach ($array as $property => $value) { - print "$property: $value\n"; + print "$property: $value\n"; } #$array = $array->getIterator(); @@ -58,13 +58,13 @@ echo "===2nd===\n"; $array = new ai(); foreach ($array as $property => $value) { - print "$property: $value\n"; + print "$property: $value\n"; } echo "===3rd===\n"; foreach ($array as $property => $value) { - print "$property: $value\n"; + print "$property: $value\n"; } ?> diff --git a/tests/classes/iterators_007.phpt b/tests/classes/iterators_007.phpt index 6e76e2d52a..db1c868e0d 100644 --- a/tests/classes/iterators_007.phpt +++ b/tests/classes/iterators_007.phpt @@ -4,32 +4,32 @@ ZE2 iterators and exceptions <?php class Test implements Iterator { - public $arr = array(1, 2, 3); - public $x = 0; + public $arr = array(1, 2, 3); + public $x = 0; - public function rewind() { if ($this->x == 0) throw new Exception(__METHOD__); reset($this->arr); } - public function current() { if ($this->x == 1) throw new Exception(__METHOD__); return current($this->arr); } - public function key() { if ($this->x == 2) throw new Exception(__METHOD__); return key($this->arr); } - public function next() { if ($this->x == 3) throw new Exception(__METHOD__); next($this->arr); } - public function valid() { if ($this->x == 4) throw new Exception(__METHOD__); return (key($this->arr) !== NULL); } + public function rewind() { if ($this->x == 0) throw new Exception(__METHOD__); reset($this->arr); } + public function current() { if ($this->x == 1) throw new Exception(__METHOD__); return current($this->arr); } + public function key() { if ($this->x == 2) throw new Exception(__METHOD__); return key($this->arr); } + public function next() { if ($this->x == 3) throw new Exception(__METHOD__); next($this->arr); } + public function valid() { if ($this->x == 4) throw new Exception(__METHOD__); return (key($this->arr) !== NULL); } } $t = new Test(); while($t->x < 5) { - try - { - foreach($t as $k => $v) - { - echo "Current\n"; - } - } - catch(Exception $e) - { - echo "Caught in " . $e->getMessage() . "()\n"; - } - $t->x++; + try + { + foreach($t as $k => $v) + { + echo "Current\n"; + } + } + catch(Exception $e) + { + echo "Caught in " . $e->getMessage() . "()\n"; + } + $t->x++; } ?> --EXPECT-- diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt index ac1a689238..3d9b0f5ff9 100644 --- a/tests/classes/method_override_optional_arg_001.phpt +++ b/tests/classes/method_override_optional_arg_001.phpt @@ -4,20 +4,20 @@ Method override allows optional default argument <?php class A { - function foo($arg1 = 1) { - } + function foo($arg1 = 1) { + } } class B extends A { - function foo($arg1 = 2, $arg2 = 3) { - var_dump($arg1); - var_dump($arg2); - } + function foo($arg1 = 2, $arg2 = 3) { + var_dump($arg1); + var_dump($arg2); + } } class C extends A { - function foo() { - } + function foo() { + } } $b = new B(); diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt index df12251e6c..ee94469e51 100644 --- a/tests/classes/method_override_optional_arg_002.phpt +++ b/tests/classes/method_override_optional_arg_002.phpt @@ -4,13 +4,13 @@ Omitting optional arg in method inherited from abstract class <?php abstract class A { - function foo($arg = 1) {} + function foo($arg = 1) {} } class B extends A { - function foo() { - echo "foo\n"; - } + function foo() { + echo "foo\n"; + } } $b = new B(); diff --git a/tests/classes/object_reference_001.phpt b/tests/classes/object_reference_001.phpt index 9842ac00f5..a98802d07a 100644 --- a/tests/classes/object_reference_001.phpt +++ b/tests/classes/object_reference_001.phpt @@ -4,11 +4,11 @@ ZE2 object references <?php class Foo { - public $name; + public $name; - function __construct() { - $this->name = "I'm Foo!\n"; - } + function __construct() { + $this->name = "I'm Foo!\n"; + } } $foo = new Foo; diff --git a/tests/classes/private_001.phpt b/tests/classes/private_001.phpt index 79b94c4f9a..34e716e334 100644 --- a/tests/classes/private_001.phpt +++ b/tests/classes/private_001.phpt @@ -4,13 +4,13 @@ ZE2 A private method can only be called inside the class <?php class pass { - private static function show() { - echo "Call show()\n"; - } + private static function show() { + echo "Call show()\n"; + } - public static function do_show() { - pass::show(); - } + public static function do_show() { + pass::show(); + } } pass::do_show(); diff --git a/tests/classes/private_002.phpt b/tests/classes/private_002.phpt index 892580f36d..7f85324503 100644 --- a/tests/classes/private_002.phpt +++ b/tests/classes/private_002.phpt @@ -4,22 +4,22 @@ ZE2 A private method cannot be called in another class <?php class pass { - private static function show() { - echo "Call pass::show()\n"; - } + private static function show() { + echo "Call pass::show()\n"; + } - public static function do_show() { - pass::show(); - } + public static function do_show() { + pass::show(); + } } pass::do_show(); class fail { - public static function show() { - echo "Call fail::show()\n"; - pass::show(); - } + public static function show() { + echo "Call fail::show()\n"; + pass::show(); + } } fail::show(); diff --git a/tests/classes/private_003.phpt b/tests/classes/private_003.phpt index 0843c5ef63..c142ad5cc7 100644 --- a/tests/classes/private_003.phpt +++ b/tests/classes/private_003.phpt @@ -4,23 +4,23 @@ ZE2 A private method cannot be called in a derived class <?php ini_set("error_reporting",2039); class pass { - private static function show() { - echo "Call show()\n"; - } + private static function show() { + echo "Call show()\n"; + } - protected static function good() { - pass::show(); - } + protected static function good() { + pass::show(); + } } class fail extends pass { - static function ok() { - pass::good(); - } + static function ok() { + pass::good(); + } - static function not_ok() { - pass::show(); - } + static function not_ok() { + pass::show(); + } } fail::ok(); diff --git a/tests/classes/private_003b.phpt b/tests/classes/private_003b.phpt index fe2f464ee8..9c5e5cbb9a 100644 --- a/tests/classes/private_003b.phpt +++ b/tests/classes/private_003b.phpt @@ -4,23 +4,23 @@ ZE2 A private method cannot be called in a derived class <?php class pass { - private function show() { - echo "Call show()\n"; - } + private function show() { + echo "Call show()\n"; + } - protected function good() { - $this->show(); - } + protected function good() { + $this->show(); + } } class fail extends pass { - public function ok() { - $this->good(); - } + public function ok() { + $this->good(); + } - public function not_ok() { - $this->show(); - } + public function not_ok() { + $this->show(); + } } $t = new fail(); diff --git a/tests/classes/private_004.phpt b/tests/classes/private_004.phpt index 13a4e90535..bfecff55b9 100644 --- a/tests/classes/private_004.phpt +++ b/tests/classes/private_004.phpt @@ -4,19 +4,19 @@ ZE2 A private method cannot be called in a derived class <?php class pass { - private static function show() { - echo "Call show()\n"; - } + private static function show() { + echo "Call show()\n"; + } - public static function do_show() { - pass::show(); - } + public static function do_show() { + pass::show(); + } } class fail extends pass { - static function do_show() { - fail::show(); - } + static function do_show() { + fail::show(); + } } pass::do_show(); diff --git a/tests/classes/private_004b.phpt b/tests/classes/private_004b.phpt index db139f65b7..302c617a5f 100644 --- a/tests/classes/private_004b.phpt +++ b/tests/classes/private_004b.phpt @@ -4,19 +4,19 @@ ZE2 A private method cannot be called in a derived class <?php class pass { - private function show() { - echo "Call show()\n"; - } + private function show() { + echo "Call show()\n"; + } - public function do_show() { - $this->show(); - } + public function do_show() { + $this->show(); + } } class fail extends pass { - function do_show() { - $this->show(); - } + function do_show() { + $this->show(); + } } $t = new pass(); diff --git a/tests/classes/private_005.phpt b/tests/classes/private_005.phpt index 0c6d978f79..1fb0e3e9fa 100644 --- a/tests/classes/private_005.phpt +++ b/tests/classes/private_005.phpt @@ -4,19 +4,19 @@ ZE2 A private method cannot be called in a derived class <?php class pass { - private static function show() { - echo "Call show()\n"; - } + private static function show() { + echo "Call show()\n"; + } - public static function do_show() { - pass::show(); - } + public static function do_show() { + pass::show(); + } } class fail extends pass { - static function do_show() { - pass::show(); - } + static function do_show() { + pass::show(); + } } pass::do_show(); diff --git a/tests/classes/private_006.phpt b/tests/classes/private_006.phpt index 895affac75..9f755abf8e 100644 --- a/tests/classes/private_006.phpt +++ b/tests/classes/private_006.phpt @@ -3,13 +3,13 @@ ZE2 A private method can be overwritten in a second derived class --FILE-- <?php class first { - private static function show() { - echo "Call show()\n"; - } + private static function show() { + echo "Call show()\n"; + } - public static function do_show() { - first::show(); - } + public static function do_show() { + first::show(); + } } first::do_show(); @@ -25,9 +25,9 @@ class third extends second { third::do_show(); class fail extends third { - static function show() { // cannot be redeclared - echo "Call show()\n"; - } + static function show() { // cannot be redeclared + echo "Call show()\n"; + } } echo "Done\n"; diff --git a/tests/classes/private_006b.phpt b/tests/classes/private_006b.phpt index 1c678601b6..cdb7f2166e 100644 --- a/tests/classes/private_006b.phpt +++ b/tests/classes/private_006b.phpt @@ -4,13 +4,13 @@ ZE2 A private method can be overwritten in a second derived class <?php class first { - private function show() { - echo "Call show()\n"; - } + private function show() { + echo "Call show()\n"; + } - public function do_show() { - $this->show(); - } + public function do_show() { + $this->show(); + } } $t1 = new first(); @@ -23,9 +23,9 @@ class second extends first { //$t2->do_show(); class third extends second { - private function show() { - echo "Call show()\n"; - } + private function show() { + echo "Call show()\n"; + } } $t3 = new third(); diff --git a/tests/classes/private_007.phpt b/tests/classes/private_007.phpt index abc2258bc2..84cdb137b8 100644 --- a/tests/classes/private_007.phpt +++ b/tests/classes/private_007.phpt @@ -4,17 +4,17 @@ ZE2 A derived class does not know about privates of ancestors <?php class Bar { - public static function pub() { - Bar::priv(); - } - private static function priv() { - echo "Bar::priv()\n"; - } + public static function pub() { + Bar::priv(); + } + private static function priv() { + echo "Bar::priv()\n"; + } } class Foo extends Bar { - public static function priv() { - echo "Foo::priv()\n"; - } + public static function priv() { + echo "Foo::priv()\n"; + } } Foo::pub(); diff --git a/tests/classes/private_007b.phpt b/tests/classes/private_007b.phpt index 3272d0c8a0..305048055f 100644 --- a/tests/classes/private_007b.phpt +++ b/tests/classes/private_007b.phpt @@ -4,17 +4,17 @@ ZE2 A derived class does not know about privates of ancestors <?php class Bar { - public function pub() { - $this->priv(); - } - private function priv() { - echo "Bar::priv()\n"; - } + public function pub() { + $this->priv(); + } + private function priv() { + echo "Bar::priv()\n"; + } } class Foo extends Bar { - public function priv() { - echo "Foo::priv()\n"; - } + public function priv() { + echo "Foo::priv()\n"; + } } $obj = new Foo(); diff --git a/tests/classes/private_members.phpt b/tests/classes/private_members.phpt index 4d8fd9eeb0..1b48722dbb 100644 --- a/tests/classes/private_members.phpt +++ b/tests/classes/private_members.phpt @@ -9,15 +9,15 @@ class base function __construct() { - echo __METHOD__ . "(begin)\n"; + echo __METHOD__ . "(begin)\n"; $this->member = 'base::member'; $this->test(); - echo __METHOD__ . "(end)\n"; + echo __METHOD__ . "(end)\n"; } function test() { - echo __METHOD__ . "\n"; + echo __METHOD__ . "\n"; print_r($this); } } @@ -28,18 +28,18 @@ class derived extends base function __construct() { - echo __METHOD__ . "(begin)\n"; - parent::__construct(); - parent::test(); - $this->test(); + echo __METHOD__ . "(begin)\n"; + parent::__construct(); + parent::test(); + $this->test(); $this->member = 'derived::member'; - echo __METHOD__ . "(end)\n"; + echo __METHOD__ . "(end)\n"; } function test() { - parent::test(); - echo __METHOD__ . "\n"; + parent::test(); + echo __METHOD__ . "\n"; print_r($this); } } diff --git a/tests/classes/private_members_serialization.phpt b/tests/classes/private_members_serialization.phpt index c196f7d8f9..1b04b6f59c 100644 --- a/tests/classes/private_members_serialization.phpt +++ b/tests/classes/private_members_serialization.phpt @@ -4,17 +4,17 @@ Verifies that it is possible to return private member names of parent classes in <?php class foo { - private $private = 'private'; - protected $protected = 'protected'; - public $public = 'public'; + private $private = 'private'; + protected $protected = 'protected'; + public $public = 'public'; } class bar extends foo { - public function __sleep() - { - return array("\0foo\0private", 'protected', 'public'); - } + public function __sleep() + { + return array("\0foo\0private", 'protected', 'public'); + } } var_dump(str_replace("\0", '\0', serialize(new bar()))); diff --git a/tests/classes/private_redeclare.phpt b/tests/classes/private_redeclare.phpt index b42cc7d7fe..cee59985c1 100644 --- a/tests/classes/private_redeclare.phpt +++ b/tests/classes/private_redeclare.phpt @@ -3,27 +3,27 @@ ZE2 A derived class does not know anything about inherited private methods --FILE-- <?php class base { - private function show() { - echo "base\n"; - } - function test() { - $this->show(); - } + private function show() { + echo "base\n"; + } + function test() { + $this->show(); + } } $t = new base(); $t->test(); class derived extends base { - function show() { - echo "derived\n"; - } - function test() { - echo "test\n"; - $this->show(); - parent::test(); - parent::show(); - } + function show() { + echo "derived\n"; + } + function test() { + echo "test\n"; + $this->show(); + parent::test(); + parent::show(); + } } $t = new derived(); diff --git a/tests/classes/property_recreate_private.phpt b/tests/classes/property_recreate_private.phpt index 35724d4b4d..8dc3e18eb0 100644 --- a/tests/classes/property_recreate_private.phpt +++ b/tests/classes/property_recreate_private.phpt @@ -3,19 +3,19 @@ Unsetting and recreating private properties. --FILE-- <?php class C { - private $p = 'test'; - function unsetPrivate() { - unset($this->p); - } - function setPrivate() { - $this->p = 'changed'; - } + private $p = 'test'; + function unsetPrivate() { + unset($this->p); + } + function setPrivate() { + $this->p = 'changed'; + } } class D extends C { - function setP() { - $this->p = 'changed in D'; - } + function setP() { + $this->p = 'changed in D'; + } } echo "Unset and recreate a superclass's private property:\n"; diff --git a/tests/classes/property_recreate_protected.phpt b/tests/classes/property_recreate_protected.phpt index ddbbb71fc9..11c3c7f900 100644 --- a/tests/classes/property_recreate_protected.phpt +++ b/tests/classes/property_recreate_protected.phpt @@ -3,19 +3,19 @@ Unsetting and recreating protected properties. --FILE-- <?php class C { - protected $p = 'test'; - function unsetProtected() { - unset($this->p); - } - function setProtected() { - $this->p = 'changed'; - } + protected $p = 'test'; + function unsetProtected() { + unset($this->p); + } + function setProtected() { + $this->p = 'changed'; + } } class D extends C { - function setP() { - $this->p = 'changed in D'; - } + function setP() { + $this->p = 'changed in D'; + } } $d = new D; diff --git a/tests/classes/protected_001.phpt b/tests/classes/protected_001.phpt index 44099b18fa..026a0f424b 100644 --- a/tests/classes/protected_001.phpt +++ b/tests/classes/protected_001.phpt @@ -4,13 +4,13 @@ ZE2 A protected method can only be called inside the class <?php class pass { - protected static function fail() { - echo "Call fail()\n"; - } + protected static function fail() { + echo "Call fail()\n"; + } - public static function good() { - pass::fail(); - } + public static function good() { + pass::fail(); + } } pass::good(); diff --git a/tests/classes/protected_001b.phpt b/tests/classes/protected_001b.phpt index 6f00ffc1b3..971436c844 100644 --- a/tests/classes/protected_001b.phpt +++ b/tests/classes/protected_001b.phpt @@ -4,13 +4,13 @@ ZE2 A protected method can only be called inside the class <?php class pass { - protected function fail() { - echo "Call fail()\n"; - } + protected function fail() { + echo "Call fail()\n"; + } - public function good() { - $this->fail(); - } + public function good() { + $this->fail(); + } } $t = new pass(); diff --git a/tests/classes/protected_002.phpt b/tests/classes/protected_002.phpt index da87200b6e..f3ddc15db9 100644 --- a/tests/classes/protected_002.phpt +++ b/tests/classes/protected_002.phpt @@ -4,22 +4,22 @@ ZE2 A protected method cannot be called in another class <?php class pass { - protected static function show() { - echo "Call pass::show()\n"; - } + protected static function show() { + echo "Call pass::show()\n"; + } - public static function do_show() { - pass::show(); - } + public static function do_show() { + pass::show(); + } } pass::do_show(); class fail { - public static function show() { - echo "Call fail::show()\n"; - pass::show(); - } + public static function show() { + echo "Call fail::show()\n"; + pass::show(); + } } fail::show(); diff --git a/tests/classes/serialize_001.phpt b/tests/classes/serialize_001.phpt index 25a22821e2..e0f7973cd7 100644 --- a/tests/classes/serialize_001.phpt +++ b/tests/classes/serialize_001.phpt @@ -5,43 +5,43 @@ ZE2 Serializable class Test implements Serializable { - public $data; + public $data; - function __construct($data) - { - echo __METHOD__ . "($data)\n"; - $this->data = $data; - } + function __construct($data) + { + echo __METHOD__ . "($data)\n"; + $this->data = $data; + } - function serialize() - { - echo __METHOD__ . "({$this->data})\n"; - return $this->data; - } + function serialize() + { + echo __METHOD__ . "({$this->data})\n"; + return $this->data; + } - function unserialize($serialized) - { - echo __METHOD__ . "($serialized)\n"; - $this->data = $serialized; - var_dump($this); - } + function unserialize($serialized) + { + echo __METHOD__ . "($serialized)\n"; + $this->data = $serialized; + var_dump($this); + } } $tests = array('String', NULL, 42, false); foreach($tests as $data) { - try - { - echo "==========\n"; - var_dump($data); - $ser = serialize(new Test($data)); - var_dump(unserialize($ser)); - } - catch(Exception $e) - { - echo 'Exception: ' . $e->getMessage() . "\n"; - } + try + { + echo "==========\n"; + var_dump($data); + $ser = serialize(new Test($data)); + var_dump(unserialize($ser)); + } + catch(Exception $e) + { + echo 'Exception: ' . $e->getMessage() . "\n"; + } } ?> diff --git a/tests/classes/singleton_001.phpt b/tests/classes/singleton_001.phpt index 45174158be..27d74122e2 100644 --- a/tests/classes/singleton_001.phpt +++ b/tests/classes/singleton_001.phpt @@ -4,24 +4,24 @@ ZE2 singleton <?php class Counter { - private $counter = 0; + private $counter = 0; - function increment_and_print() { - echo ++$this->counter; - echo "\n"; + function increment_and_print() { + echo ++$this->counter; + echo "\n"; } } class SingletonCounter { - private static $m_instance = NULL; + private static $m_instance = NULL; - static function Instance() { - if (self::$m_instance == NULL) { - self::$m_instance = new Counter(); - } - return self::$m_instance; - } + static function Instance() { + if (self::$m_instance == NULL) { + self::$m_instance = new Counter(); + } + return self::$m_instance; + } } SingletonCounter::Instance()->increment_and_print(); diff --git a/tests/classes/static_mix_1.phpt b/tests/classes/static_mix_1.phpt index 8dead36856..01704193cd 100644 --- a/tests/classes/static_mix_1.phpt +++ b/tests/classes/static_mix_1.phpt @@ -4,15 +4,15 @@ ZE2 You cannot overload a static method with a non static method <?php class pass { - static function show() { - echo "Call to function pass::show()\n"; - } + static function show() { + echo "Call to function pass::show()\n"; + } } class fail extends pass { - function show() { - echo "Call to function fail::show()\n"; - } + function show() { + echo "Call to function fail::show()\n"; + } } pass::show(); diff --git a/tests/classes/static_mix_2.phpt b/tests/classes/static_mix_2.phpt index bbf6f9c1dd..7f89ba3987 100644 --- a/tests/classes/static_mix_2.phpt +++ b/tests/classes/static_mix_2.phpt @@ -4,15 +4,15 @@ ZE2 You cannot overload a non static method with a static method <?php class pass { - function show() { - echo "Call to function pass::show()\n"; - } + function show() { + echo "Call to function pass::show()\n"; + } } class fail extends pass { - static function show() { - echo "Call to function fail::show()\n"; - } + static function show() { + echo "Call to function fail::show()\n"; + } } $t = new pass(); diff --git a/tests/classes/static_properties_001.phpt b/tests/classes/static_properties_001.phpt index e5e545fa22..5772a0dbcc 100644 --- a/tests/classes/static_properties_001.phpt +++ b/tests/classes/static_properties_001.phpt @@ -4,7 +4,7 @@ ZE2 Initializing static properties to arrays <?php class test { - static public $ar = array(); + static public $ar = array(); } var_dump(test::$ar); diff --git a/tests/classes/static_this.phpt b/tests/classes/static_this.phpt index f7a11f5481..a945d76c9d 100644 --- a/tests/classes/static_this.phpt +++ b/tests/classes/static_this.phpt @@ -5,21 +5,21 @@ ZE2 $this can be an argument to a static function class TestClass { - function __construct() - { - self::Test1(); - $this->Test1(); - } + function __construct() + { + self::Test1(); + $this->Test1(); + } - static function Test1() - { - var_dump($this); - } + static function Test1() + { + var_dump($this); + } - static function Test2($this) - { - var_dump($this); - } + static function Test2($this) + { + var_dump($this); + } } $obj = new TestClass; diff --git a/tests/classes/this.phpt b/tests/classes/this.phpt index 30ea83e285..418ea63912 100644 --- a/tests/classes/this.phpt +++ b/tests/classes/this.phpt @@ -10,7 +10,7 @@ class Foo { function replace($other) { - echo __METHOD__ . "\n"; + echo __METHOD__ . "\n"; $this = $other; print $this->prop; print $other->prop; @@ -18,7 +18,7 @@ class Foo function indirect($other) { - echo __METHOD__ . "\n"; + echo __METHOD__ . "\n"; $this = $other; $result = $this = $other; print $result->prop; @@ -27,8 +27,8 @@ class Foo function retrieve(&$other) { - echo __METHOD__ . "\n"; - $other = $this; + echo __METHOD__ . "\n"; + $other = $this; } } diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt index ba2bc3eb53..3053da9140 100644 --- a/tests/classes/tostring_001.phpt +++ b/tests/classes/tostring_001.phpt @@ -11,7 +11,7 @@ class test2 { function __toString() { - echo __METHOD__ . "()\n"; + echo __METHOD__ . "()\n"; return "Converted\n"; } } @@ -20,7 +20,7 @@ class test3 { function __toString() { - echo __METHOD__ . "()\n"; + echo __METHOD__ . "()\n"; return 42; } } diff --git a/tests/classes/tostring_002.phpt b/tests/classes/tostring_002.phpt index 7dda92339e..3977ad883f 100644 --- a/tests/classes/tostring_002.phpt +++ b/tests/classes/tostring_002.phpt @@ -5,15 +5,15 @@ ZE2 __toString() in __destruct class Test { - function __toString() - { - return "Hello\n"; - } + function __toString() + { + return "Hello\n"; + } - function __destruct() - { - echo $this; - } + function __destruct() + { + echo $this; + } } $o = new Test; diff --git a/tests/classes/tostring_003.phpt b/tests/classes/tostring_003.phpt index 4dad51f2cf..87a5fe42e1 100644 --- a/tests/classes/tostring_003.phpt +++ b/tests/classes/tostring_003.phpt @@ -5,26 +5,26 @@ ZE2 __toString() in __destruct/exception class Test { - function __toString() - { - throw new Exception("Damn!"); - return "Hello\n"; - } + function __toString() + { + throw new Exception("Damn!"); + return "Hello\n"; + } - function __destruct() - { - echo $this; - } + function __destruct() + { + echo $this; + } } try { - $o = new Test; - $o = NULL; + $o = new Test; + $o = NULL; } catch(Exception $e) { - var_dump($e->getMessage()); + var_dump($e->getMessage()); } ?> diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt index 3627cbf215..8cde860d56 100644 --- a/tests/classes/tostring_004.phpt +++ b/tests/classes/tostring_004.phpt @@ -28,9 +28,9 @@ try { echo "\n\nObject with bad __toString():\n"; class badToString { - function __toString() { - return 0; - } + function __toString() { + return 0; + } } $obj = new badToString; diff --git a/tests/classes/type_hinting_001.phpt b/tests/classes/type_hinting_001.phpt index 35356581f4..fdc74a3194 100644 --- a/tests/classes/type_hinting_001.phpt +++ b/tests/classes/type_hinting_001.phpt @@ -4,21 +4,21 @@ ZE2 class type hinting <?php interface Foo { - function a(Foo $foo); + function a(Foo $foo); } interface Bar { - function b(Bar $bar); + function b(Bar $bar); } class FooBar implements Foo, Bar { - function a(Foo $foo) { - // ... - } + function a(Foo $foo) { + // ... + } - function b(Bar $bar) { - // ... - } + function b(Bar $bar) { + // ... + } } class Blort { diff --git a/tests/classes/type_hinting_002.phpt b/tests/classes/type_hinting_002.phpt index b65bc85c93..23d201a51a 100644 --- a/tests/classes/type_hinting_002.phpt +++ b/tests/classes/type_hinting_002.phpt @@ -4,7 +4,7 @@ ZE2 class type hinting non existing class <?php class Foo { - function a(NonExisting $foo) {} + function a(NonExisting $foo) {} } $o = new Foo; diff --git a/tests/classes/type_hinting_003.phpt b/tests/classes/type_hinting_003.phpt index fb788e3d9c..9dfbd7c3b8 100644 --- a/tests/classes/type_hinting_003.phpt +++ b/tests/classes/type_hinting_003.phpt @@ -5,29 +5,29 @@ ZE2 class type hinting with arrays class Test { - static function f1(array $ar) - { - echo __METHOD__ . "()\n"; - var_dump($ar); - } + static function f1(array $ar) + { + echo __METHOD__ . "()\n"; + var_dump($ar); + } - static function f2(array $ar = NULL) - { - echo __METHOD__ . "()\n"; - var_dump($ar); - } + static function f2(array $ar = NULL) + { + echo __METHOD__ . "()\n"; + var_dump($ar); + } - static function f3(array $ar = array()) - { - echo __METHOD__ . "()\n"; - var_dump($ar); - } + static function f3(array $ar = array()) + { + echo __METHOD__ . "()\n"; + var_dump($ar); + } - static function f4(array $ar = array(25)) - { - echo __METHOD__ . "()\n"; - var_dump($ar); - } + static function f4(array $ar = array(25)) + { + echo __METHOD__ . "()\n"; + var_dump($ar); + } } Test::f1(array(42)); diff --git a/tests/classes/unset_properties.phpt b/tests/classes/unset_properties.phpt index 417542ddea..fa576713d5 100644 --- a/tests/classes/unset_properties.phpt +++ b/tests/classes/unset_properties.phpt @@ -6,68 +6,68 @@ methods themselves. class Test { - public $publicProperty = 'publicProperty set'; - - protected $protectedProperty = 'protectedProperty set'; - - private $privateProperty = 'privateProperty set'; - - public function __get($name) - { - return '__get "' . $name . '"'; - } - - public function __set($name, $value) - { - $this->$name = $value; - echo '__set "' . $name . '" to "' . $value . '"'; - } - - public function __isset($name) - { - echo '__isset "' . $name . '"'; - return isset($this->$name); - } - - public function getPublicProperty() - { - return $this->publicProperty; - } - - public function setPublicProperty($publicProperty) - { - $this->publicProperty = $publicProperty; - } - - public function unsetProtectedProperty() - { - unset($this->protectedProperty); - } - - public function getProtectedProperty() - { - return $this->protectedProperty; - } - - public function setProtectedProperty($protectedProperty) - { - $this->protectedProperty = $protectedProperty; - } - - public function unsetPrivateProperty() - { - unset($this->privateProperty); - } - - public function getPrivateProperty() - { - return $this->privateProperty; - } - - public function setPrivateProperty($privateProperty) - { - $this->privateProperty = $privateProperty; - } + public $publicProperty = 'publicProperty set'; + + protected $protectedProperty = 'protectedProperty set'; + + private $privateProperty = 'privateProperty set'; + + public function __get($name) + { + return '__get "' . $name . '"'; + } + + public function __set($name, $value) + { + $this->$name = $value; + echo '__set "' . $name . '" to "' . $value . '"'; + } + + public function __isset($name) + { + echo '__isset "' . $name . '"'; + return isset($this->$name); + } + + public function getPublicProperty() + { + return $this->publicProperty; + } + + public function setPublicProperty($publicProperty) + { + $this->publicProperty = $publicProperty; + } + + public function unsetProtectedProperty() + { + unset($this->protectedProperty); + } + + public function getProtectedProperty() + { + return $this->protectedProperty; + } + + public function setProtectedProperty($protectedProperty) + { + $this->protectedProperty = $protectedProperty; + } + + public function unsetPrivateProperty() + { + unset($this->privateProperty); + } + + public function getPrivateProperty() + { + return $this->privateProperty; + } + + public function setPrivateProperty($privateProperty) + { + $this->privateProperty = $privateProperty; + } } // verifying public property diff --git a/tests/classes/visibility_000a.phpt b/tests/classes/visibility_000a.phpt index 00e918ad30..276e7a9f79 100644 --- a/tests/classes/visibility_000a.phpt +++ b/tests/classes/visibility_000a.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - protected function f0() {} + protected function f0() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_000b.phpt b/tests/classes/visibility_000b.phpt index aeb3078b72..56e5fd9c27 100644 --- a/tests/classes/visibility_000b.phpt +++ b/tests/classes/visibility_000b.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - private function f0() {} + private function f0() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_000c.phpt b/tests/classes/visibility_000c.phpt index d1a7c9f1e1..c56311d72b 100644 --- a/tests/classes/visibility_000c.phpt +++ b/tests/classes/visibility_000c.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - function f0() {} + function f0() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_001a.phpt b/tests/classes/visibility_001a.phpt index 50baf64d67..bb1a7c2714 100644 --- a/tests/classes/visibility_001a.phpt +++ b/tests/classes/visibility_001a.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - protected function f1() {} + protected function f1() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_001b.phpt b/tests/classes/visibility_001b.phpt index 626b5303f8..666a530f36 100644 --- a/tests/classes/visibility_001b.phpt +++ b/tests/classes/visibility_001b.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - private function f1() {} + private function f1() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_001c.phpt b/tests/classes/visibility_001c.phpt index 956c6762df..8185beddc2 100644 --- a/tests/classes/visibility_001c.phpt +++ b/tests/classes/visibility_001c.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - function f1() {} + function f1() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_002a.phpt b/tests/classes/visibility_002a.phpt index 2fd402070d..c1a93482a5 100644 --- a/tests/classes/visibility_002a.phpt +++ b/tests/classes/visibility_002a.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - protected function f2() {} + protected function f2() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_002b.phpt b/tests/classes/visibility_002b.phpt index a8b1c5e79e..a46386d19c 100644 --- a/tests/classes/visibility_002b.phpt +++ b/tests/classes/visibility_002b.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - private function f2() {} + private function f2() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_002c.phpt b/tests/classes/visibility_002c.phpt index 64560171cc..406a16dd20 100644 --- a/tests/classes/visibility_002c.phpt +++ b/tests/classes/visibility_002c.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - function f2() {} + function f2() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_003a.phpt b/tests/classes/visibility_003a.phpt index 17f5b49eb9..4a9bb97f9c 100644 --- a/tests/classes/visibility_003a.phpt +++ b/tests/classes/visibility_003a.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - public function f3() {} + public function f3() {} } echo "Done\n"; diff --git a/tests/classes/visibility_003b.phpt b/tests/classes/visibility_003b.phpt index 474e0df235..504408e68f 100644 --- a/tests/classes/visibility_003b.phpt +++ b/tests/classes/visibility_003b.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - private function f3() {} + private function f3() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_003c.phpt b/tests/classes/visibility_003c.phpt index 7ac3239f59..e396331110 100644 --- a/tests/classes/visibility_003c.phpt +++ b/tests/classes/visibility_003c.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - function f3() {} + function f3() {} } echo "Done\n"; diff --git a/tests/classes/visibility_004a.phpt b/tests/classes/visibility_004a.phpt index a6acb40569..115d5d743e 100644 --- a/tests/classes/visibility_004a.phpt +++ b/tests/classes/visibility_004a.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - public function f4() {} + public function f4() {} } echo "Done\n"; diff --git a/tests/classes/visibility_004b.phpt b/tests/classes/visibility_004b.phpt index 9e416fc6ae..203ae878ff 100644 --- a/tests/classes/visibility_004b.phpt +++ b/tests/classes/visibility_004b.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - protected function f4() {} + protected function f4() {} } echo "Done\n"; // shouldn't be displayed diff --git a/tests/classes/visibility_004c.phpt b/tests/classes/visibility_004c.phpt index abe25b1b39..b2d0939bb9 100644 --- a/tests/classes/visibility_004c.phpt +++ b/tests/classes/visibility_004c.phpt @@ -4,25 +4,25 @@ ZE2 A redeclared method must have the same or higher visibility <?php class father { - function f0() {} - function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + function f0() {} + function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class same extends father { - // overload fn with same visibility - function f0() {} - public function f1() {} - public function f2() {} - protected function f3() {} - private function f4() {} + // overload fn with same visibility + function f0() {} + public function f1() {} + public function f2() {} + protected function f3() {} + private function f4() {} } class fail extends same { - function f4() {} + function f4() {} } echo "Done\n"; diff --git a/tests/classes/visibility_005.phpt b/tests/classes/visibility_005.phpt index 859a5f7b6c..ac7a2dd35a 100644 --- a/tests/classes/visibility_005.phpt +++ b/tests/classes/visibility_005.phpt @@ -5,16 +5,16 @@ ZE2 foreach and property visibility class base { - public $a=1; - protected $b=2; - private $c=3; + public $a=1; + protected $b=2; + private $c=3; - function f() - { - foreach($this as $k=>$v) { - echo "$k=>$v\n"; - } - } + function f() + { + foreach($this as $k=>$v) { + echo "$k=>$v\n"; + } + } } class derived extends base @@ -27,7 +27,7 @@ echo "===base::function===\n"; $o->f(); echo "===base,foreach===\n"; foreach($o as $k=>$v) { - echo "$k=>$v\n"; + echo "$k=>$v\n"; } $o = new derived; @@ -36,7 +36,7 @@ echo "===derived::function===\n"; $o->f(); echo "===derived,foreach===\n"; foreach($o as $k=>$v) { - echo "$k=>$v\n"; + echo "$k=>$v\n"; } ?> diff --git a/tests/func/003.phpt b/tests/func/003.phpt index 8234af2e17..2333947249 100644 --- a/tests/func/003.phpt +++ b/tests/func/003.phpt @@ -89,10 +89,10 @@ echo "$result\n"; function andi($i, $j) { - for ($k=$i ; $k<=$j ; $k++) { - if ($k >5) continue; - echo "$k\n"; - } + for ($k=$i ; $k<=$j ; $k++) { + if ($k >5) continue; + echo "$k\n"; + } } andi (3,10); diff --git a/tests/func/005.phpt b/tests/func/005.phpt index 1ba45123c4..6373d2e550 100644 --- a/tests/func/005.phpt +++ b/tests/func/005.phpt @@ -5,7 +5,7 @@ Testing register_shutdown_function() function foo() { - print "foo"; + print "foo"; } register_shutdown_function("foo"); diff --git a/tests/func/005a.phpt b/tests/func/005a.phpt index 8cd0d211ab..a7ed5dbfdd 100644 --- a/tests/func/005a.phpt +++ b/tests/func/005a.phpt @@ -13,7 +13,7 @@ echo "Start\n"; function boo() { - echo "Shutdown\n"; + echo "Shutdown\n"; } register_shutdown_function("boo"); diff --git a/tests/func/010.phpt b/tests/func/010.phpt index 4c28dea1b7..8b21df31ea 100644 --- a/tests/func/010.phpt +++ b/tests/func/010.phpt @@ -14,15 +14,15 @@ $limit = $boundary+42; function test($a,$b) { - var_dump($a === $b); - test2($a,$b); + var_dump($a === $b); + test2($a,$b); } function test2($a, $b) { - if ($a !== $b) { - var_dump("something went wrong: $a !== $b"); - } + if ($a !== $b) { + var_dump("something went wrong: $a !== $b"); + } } @@ -30,25 +30,25 @@ function test2($a, $b) $str = "<?php\nfunction x("; for($i=0; $i < $limit; ++$i) { - $str .= '$v'.dechex($i).($i===($limit-1) ? '' : ','); + $str .= '$v'.dechex($i).($i===($limit-1) ? '' : ','); } $str .= ') { - test($v42, \'42\'); - test(\'4000\', $v4000); - test2($v300, \'300\'); - test($v0, \'0\'); // first - test($v'.dechex($limit-1).", '".dechex($limit-1).'\'); // last - test($v'.dechex($boundary).", '".dechex($boundary).'\'); //boundary - test($v'.dechex($boundary+1).", '".dechex($boundary+1).'\'); //boundary+1 - test($v'.dechex($boundary-1).", '".dechex($boundary-1).'\'); //boundary-1 + test($v42, \'42\'); + test(\'4000\', $v4000); + test2($v300, \'300\'); + test($v0, \'0\'); // first + test($v'.dechex($limit-1).", '".dechex($limit-1).'\'); // last + test($v'.dechex($boundary).", '".dechex($boundary).'\'); //boundary + test($v'.dechex($boundary+1).", '".dechex($boundary+1).'\'); //boundary+1 + test($v'.dechex($boundary-1).", '".dechex($boundary-1).'\'); //boundary-1 }'; // generate the function call $str .= "\n\nx("; for($i=0; $i< $limit; ++$i) { - $str .= "'".dechex($i)."'".($i===($limit-1) ? '' : ','); + $str .= "'".dechex($i)."'".($i===($limit-1) ? '' : ','); } $str .= ");\n"; diff --git a/tests/lang/002.phpt b/tests/lang/002.phpt index 251f90b0a2..b1b4b0849d 100644 --- a/tests/lang/002.phpt +++ b/tests/lang/002.phpt @@ -4,8 +4,8 @@ Simple While Loop Test <?php $a=1; while ($a<10) { - echo $a; - $a++; + echo $a; + $a++; } ?> --EXPECT-- diff --git a/tests/lang/003.phpt b/tests/lang/003.phpt index a580fc60cd..d6f85e0ad0 100644 --- a/tests/lang/003.phpt +++ b/tests/lang/003.phpt @@ -4,15 +4,15 @@ Simple Switch Test <?php $a=1; switch($a) { - case 0: - echo "bad"; - break; - case 1: - echo "good"; - break; - default: - echo "bad"; - break; + case 0: + echo "bad"; + break; + case 1: + echo "good"; + break; + default: + echo "bad"; + break; } ?> --EXPECT-- diff --git a/tests/lang/004.phpt b/tests/lang/004.phpt index 9ca3492cde..5a4ed8797c 100644 --- a/tests/lang/004.phpt +++ b/tests/lang/004.phpt @@ -4,9 +4,9 @@ Simple If/Else Test <?php $a=1; if($a==0) { - echo "bad"; + echo "bad"; } else { - echo "good"; + echo "good"; } ?> --EXPECT-- diff --git a/tests/lang/005.phpt b/tests/lang/005.phpt index fe3633b58b..cb8de72e09 100644 --- a/tests/lang/005.phpt +++ b/tests/lang/005.phpt @@ -5,11 +5,11 @@ Simple If/ElseIf/Else Test $a=1; if($a==0) { - echo "bad"; + echo "bad"; } elseif($a==3) { - echo "bad"; + echo "bad"; } else { - echo "good"; + echo "good"; } ?> --EXPECT-- diff --git a/tests/lang/006.phpt b/tests/lang/006.phpt index 5056b8a4ee..c8ca378d46 100644 --- a/tests/lang/006.phpt +++ b/tests/lang/006.phpt @@ -6,17 +6,17 @@ $a=1; $b=2; if($a==0) { - echo "bad"; + echo "bad"; } elseif($a==3) { - echo "bad"; + echo "bad"; } else { - if($b==1) { - echo "bad"; - } elseif($b==2) { - echo "good"; - } else { - echo "bad"; - } + if($b==1) { + echo "bad"; + } elseif($b==2) { + echo "good"; + } else { + echo "bad"; + } } ?> --EXPECT-- diff --git a/tests/lang/007.phpt b/tests/lang/007.phpt index 946ae9babb..735de94974 100644 --- a/tests/lang/007.phpt +++ b/tests/lang/007.phpt @@ -7,14 +7,14 @@ $a = 10; function Test() { - static $a=1; - global $b; - $c = 1; - $b = 5; - echo "$a $b "; - $a++; - $c++; - echo "$a $c "; + static $a=1; + global $b; + $c = 1; + $b = 5; + echo "$a $b "; + $a++; + $c++; + echo "$a $c "; } Test(); diff --git a/tests/lang/008.phpt b/tests/lang/008.phpt index 8633b6049a..6b5ae75d2d 100644 --- a/tests/lang/008.phpt +++ b/tests/lang/008.phpt @@ -5,10 +5,10 @@ Testing recursive function function Test() { - static $a=1; - echo "$a "; - $a++; - if($a<10): Test(); endif; + static $a=1; + echo "$a "; + $a++; + if($a<10): Test(); endif; } Test(); diff --git a/tests/lang/009.phpt b/tests/lang/009.phpt index 8621a73e50..a5403d696a 100644 --- a/tests/lang/009.phpt +++ b/tests/lang/009.phpt @@ -3,7 +3,7 @@ Testing function parameter passing --FILE-- <?php function test ($a,$b) { - echo $a+$b; + echo $a+$b; } test(1,2); ?> diff --git a/tests/lang/010.phpt b/tests/lang/010.phpt index 603abe34d5..707c2bfae6 100644 --- a/tests/lang/010.phpt +++ b/tests/lang/010.phpt @@ -3,8 +3,8 @@ Testing function parameter passing with a return value --FILE-- <?php function test ($b) { - $b++; - return($b); + $b++; + return($b); } $a = test(1); echo $a; diff --git a/tests/lang/011.phpt b/tests/lang/011.phpt index b7946b7460..99a2d1c6a8 100644 --- a/tests/lang/011.phpt +++ b/tests/lang/011.phpt @@ -4,8 +4,8 @@ Testing nested functions <?php function F() { - $a = "Hello "; - return($a); + $a = "Hello "; + return($a); } function G() diff --git a/tests/lang/012.phpt b/tests/lang/012.phpt index 203d7cebe3..0f88fe21d7 100644 --- a/tests/lang/012.phpt +++ b/tests/lang/012.phpt @@ -3,15 +3,15 @@ Testing stack after early function return --FILE-- <?php function F () { - if(1) { - return("Hello"); - } + if(1) { + return("Hello"); + } } $i=0; while ($i<2) { - echo F(); - $i++; + echo F(); + $i++; } ?> --EXPECT-- diff --git a/tests/lang/014.phpt b/tests/lang/014.phpt index fe6f86e22a..b2d605c8ea 100644 --- a/tests/lang/014.phpt +++ b/tests/lang/014.phpt @@ -3,7 +3,7 @@ Testing eval function inside user-defined function --FILE-- <?php function F ($a) { - eval($a); + eval($a); } error_reporting(0); diff --git a/tests/lang/015.inc b/tests/lang/015.inc index fae56c4810..a528d8cd9f 100644 --- a/tests/lang/015.inc +++ b/tests/lang/015.inc @@ -1,3 +1,3 @@ <?php - echo "Hello"; + echo "Hello"; ?> diff --git a/tests/lang/016.inc b/tests/lang/016.inc index 56aa85d65b..453755d870 100644 --- a/tests/lang/016.inc +++ b/tests/lang/016.inc @@ -1,5 +1,5 @@ <?php function MyFunc ($a) { - echo $a; + echo $a; } ?> diff --git a/tests/lang/017.phpt b/tests/lang/017.phpt index fb90964820..264b3906fe 100644 --- a/tests/lang/017.phpt +++ b/tests/lang/017.phpt @@ -4,14 +4,14 @@ Testing user-defined function falling out of an If into another <?php $a = 1; function Test ($a) { - if ($a<3) { - return(3); - } + if ($a<3) { + return(3); + } } if ($a < Test($a)) { - echo "$a\n"; - $a++; + echo "$a\n"; + $a++; } ?> --EXPECT-- diff --git a/tests/lang/020.phpt b/tests/lang/020.phpt index 9428ec5e6f..97c928d200 100644 --- a/tests/lang/020.phpt +++ b/tests/lang/020.phpt @@ -8,38 +8,38 @@ $i="abc"; for ($j=0; $j<10; $j++) { switch (1) { case 1: - echo "In branch 1\n"; - switch ($i) { - case "ab": - echo "This doesn't work... :(\n"; - break; - case "abcd": - echo "This works!\n"; - break; - case "blah": - echo "Hmmm, no worki\n"; - break; - default: - echo "Inner default...\n"; - } - for ($blah=0; $blah<200; $blah++) { - if ($blah==100) { - echo "blah=$blah\n"; - } - } - break; + echo "In branch 1\n"; + switch ($i) { + case "ab": + echo "This doesn't work... :(\n"; + break; + case "abcd": + echo "This works!\n"; + break; + case "blah": + echo "Hmmm, no worki\n"; + break; + default: + echo "Inner default...\n"; + } + for ($blah=0; $blah<200; $blah++) { + if ($blah==100) { + echo "blah=$blah\n"; + } + } + break; case 2: - echo "In branch 2\n"; - break; + echo "In branch 2\n"; + break; case $i: - echo "In branch \$i\n"; - break; + echo "In branch \$i\n"; + break; case 4: - echo "In branch 4\n"; - break; + echo "In branch 4\n"; + break; default: - echo "Hi, I'm default\n"; - break; + echo "Hi, I'm default\n"; + break; } } ?> diff --git a/tests/lang/022.phpt b/tests/lang/022.phpt index 9660530bc7..74c4e290a8 100644 --- a/tests/lang/022.phpt +++ b/tests/lang/022.phpt @@ -5,24 +5,24 @@ Switch test 3 function switchtest ($i, $j) { - switch ($i) { - case 0: - switch($j) { - case 0: - echo "zero"; - break; - case 1: - echo "one"; - break; - default: - echo $j; - break; - } - echo "\n"; - break; - default: - echo "Default taken\n"; - } + switch ($i) { + case 0: + switch($j) { + case 0: + echo "zero"; + break; + case 1: + echo "one"; + break; + default: + echo $j; + break; + } + echo "\n"; + break; + default: + echo "Default taken\n"; + } } for ($i=0; $i<3; $i++) { for ($k=0; $k<10; $k++) { diff --git a/tests/lang/023-1.inc b/tests/lang/023-1.inc index 153f5d7668..e4c480c730 100644 --- a/tests/lang/023-1.inc +++ b/tests/lang/023-1.inc @@ -59,31 +59,31 @@ Correct result - 3: <?php echo $j%$i; ?><br> /* sick if/elseif/else test by Andi :) */ $a = 5; if ($a == "4") { - echo "This "." does "." not "." work<br>\n"; + echo "This "." does "." not "." work<br>\n"; } elseif ($a == "5") { - echo "This "." works<br>\n"; - $a = 6; - if ("andi" == ($test = "andi")) { - echo "this_still_works<br>\n"; - } elseif (1) { - echo "should_not_print<br>\n"; - } else { - echo "should_not_print<br>\n"; - } + echo "This "." works<br>\n"; + $a = 6; + if ("andi" == ($test = "andi")) { + echo "this_still_works<br>\n"; + } elseif (1) { + echo "should_not_print<br>\n"; + } else { + echo "should_not_print<br>\n"; + } if (44 == 43) { - echo "should_not_print<br>\n"; - } else { - echo "should_print<br>\n"; - } + echo "should_not_print<br>\n"; + } else { + echo "should_print<br>\n"; + } } elseif ($a == 6) { - echo "this "."broken<br>\n"; - if (0) { - echo "this_should_not_print<br>\n"; - } else { - echo "TestingDanglingElse_This_Should_not_print<br>\n"; - } + echo "this "."broken<br>\n"; + if (0) { + echo "this_should_not_print<br>\n"; + } else { + echo "TestingDanglingElse_This_Should_not_print<br>\n"; + } } else { - echo "This "."does "." not"." work<br>\n"; + echo "This "."does "." not"." work<br>\n"; } ?> @@ -277,18 +277,18 @@ echo "commented out..."; $i = 10; $a = 'b'; while ($i > 0) { - $a = $a . 'a'; - echo "$a<br>\n"; - $resize[$a] = $i; - $i--; + $a = $a . 'a'; + echo "$a<br>\n"; + $resize[$a] = $i; + $i--; } $i = 10; $a = 'b'; while ($i > 0) { - $a = $a . 'a'; - echo "$a<br>\n"; - echo $resize[$a]."<br>\n"; - $i--; + $a = $a . 'a'; + echo "$a<br>\n"; + echo $resize[$a]."<br>\n"; + $i--; } ?> **************************<br> diff --git a/tests/lang/024.phpt b/tests/lang/024.phpt index 357846555a..1e2fd76f0b 100644 --- a/tests/lang/024.phpt +++ b/tests/lang/024.phpt @@ -76,31 +76,31 @@ Correct result - 3: <?php echo $j%$i; ?> /* sick if/elseif/else test by Andi :) */ $a = 5; if ($a == "4") { - echo "This "." does "." not "." work\n"; + echo "This "." does "." not "." work\n"; } elseif ($a == "5") { - echo "This "." works\n"; - $a = 6; - if ("andi" == ($test = "andi")) { - echo "this_still_works\n"; - } elseif (1) { - echo "should_not_print\n"; - } else { - echo "should_not_print\n"; - } + echo "This "." works\n"; + $a = 6; + if ("andi" == ($test = "andi")) { + echo "this_still_works\n"; + } elseif (1) { + echo "should_not_print\n"; + } else { + echo "should_not_print\n"; + } if (44 == 43) { - echo "should_not_print\n"; - } else { - echo "should_print\n"; - } + echo "should_not_print\n"; + } else { + echo "should_print\n"; + } } elseif ($a == 6) { - echo "this "."broken\n"; - if (0) { - echo "this_should_not_print\n"; - } else { - echo "TestingDanglingElse_This_Should_not_print\n"; - } + echo "this "."broken\n"; + if (0) { + echo "this_should_not_print\n"; + } else { + echo "TestingDanglingElse_This_Should_not_print\n"; + } } else { - echo "This "."does "." not"." work\n"; + echo "This "."does "." not"." work\n"; } ?> @@ -292,18 +292,18 @@ echo "commented out..."; $i = 10; $a = "b"; while ($i > 0) { - $a = $a . "a"; - echo "$a\n"; - $resize[$a] = $i; - $i--; + $a = $a . "a"; + echo "$a\n"; + $resize[$a] = $i; + $i--; } $i = 10; $a = "b"; while ($i > 0) { - $a = $a . "a"; - echo "$a\n"; - echo $resize[$a]."\n"; - $i--; + $a = $a . "a"; + echo "$a\n"; + echo $resize[$a]."\n"; + $i--; } ?> ************************** diff --git a/tests/lang/025.phpt b/tests/lang/025.phpt index 13c02d31d4..a49b8abb5a 100644 --- a/tests/lang/025.phpt +++ b/tests/lang/025.phpt @@ -3,15 +3,15 @@ Mean recursion test --FILE-- <?php function RekTest ($nr) { - echo " $nr "; - $j=$nr+1; - while ($j < 10) { - echo " a "; - RekTest($j); - $j++; - echo " b $j "; - } - echo "\n"; + echo " $nr "; + $j=$nr+1; + while ($j < 10) { + echo " a "; + RekTest($j); + $j++; + echo " b $j "; + } + echo "\n"; } RekTest(0); diff --git a/tests/lang/027.phpt b/tests/lang/027.phpt index 9c826cfe93..3bcbe3ae4b 100644 --- a/tests/lang/027.phpt +++ b/tests/lang/027.phpt @@ -4,8 +4,8 @@ Testing do-while loop <?php $i=3; do { - echo $i; - $i--; + echo $i; + $i--; } while($i>0); ?> --EXPECT-- diff --git a/tests/lang/028.phpt b/tests/lang/028.phpt index e455c3b446..746101cefe 100644 --- a/tests/lang/028.phpt +++ b/tests/lang/028.phpt @@ -7,43 +7,43 @@ error_reporting(1023); function print_stuff($stuff) { - print $stuff; + print $stuff; } function still_working() { - return "I'm still alive"; + return "I'm still alive"; } function dafna() { - static $foo = 0; + static $foo = 0; - print "Dafna!\n"; - print call_user_func("still_working")."\n"; - $foo++; - return (string) $foo; + print "Dafna!\n"; + print call_user_func("still_working")."\n"; + $foo++; + return (string) $foo; } class dafna_class { - function __construct() { - $this->myname = "Dafna"; - } - function GetMyName() { - return $this->myname; - } - function SetMyName($name) { - $this->myname = $name; - } + function __construct() { + $this->myname = "Dafna"; + } + function GetMyName() { + return $this->myname; + } + function SetMyName($name) { + $this->myname = $name; + } }; for ($i=0; $i<200; $i++): - print "$i\n"; - call_user_func("dafna"); - call_user_func("print_stuff","Hey there!!\n"); - print "$i\n"; + print "$i\n"; + call_user_func("dafna"); + call_user_func("print_stuff","Hey there!!\n"); + print "$i\n"; endfor; diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt index 7f94b2eb74..1d88fa9d69 100644 --- a/tests/lang/030.phpt +++ b/tests/lang/030.phpt @@ -3,19 +3,19 @@ $this in constructor test --FILE-- <?php class foo { - function __construct($name) { - $GLOBALS['List']= &$this; - $this->Name = $name; - $GLOBALS['List']->echoName(); - } + function __construct($name) { + $GLOBALS['List']= &$this; + $this->Name = $name; + $GLOBALS['List']->echoName(); + } - function echoName() { - $GLOBALS['names'][]=$this->Name; - } + function echoName() { + $GLOBALS['names'][]=$this->Name; + } } function &foo2(&$foo) { - return $foo; + return $foo; } diff --git a/tests/lang/032.phpt b/tests/lang/032.phpt index abc98f752d..86d70abbe5 100644 --- a/tests/lang/032.phpt +++ b/tests/lang/032.phpt @@ -3,29 +3,29 @@ Class method registration --FILE-- <?php class A { - function foo() {} + function foo() {} } class B extends A { - function foo() {} + function foo() {} } class C extends B { - function foo() {} + function foo() {} } class D extends A { } class F extends D { - function foo() {} + function foo() {} } // Following class definition should fail, but cannot test /* class X { - function foo() {} - function foo() {} + function foo() {} + function foo() {} } */ diff --git a/tests/lang/033.phpt b/tests/lang/033.phpt index 46db0129b4..4bba5e8783 100644 --- a/tests/lang/033.phpt +++ b/tests/lang/033.phpt @@ -7,34 +7,34 @@ $a = 1; echo "If: "; if ($a) echo 1; else echo 0; if ($a): - echo 1; + echo 1; else: - echo 0; + echo 0; endif; echo "\nWhile: "; while ($a<5) echo $a++; while ($a<9): - echo ++$a; + echo ++$a; endwhile; echo "\nFor: "; for($a=0;$a<5;$a++) echo $a; for($a=0;$a<5;$a++): - echo $a; + echo $a; endfor; echo "\nSwitch: "; switch ($a): - case 0; - echo 0; - break; - case 5: - echo 1; - break; - default; - echo 0; - break; + case 0; + echo 0; + break; + case 5: + echo 1; + break; + default; + echo 0; + break; endswitch; ?> diff --git a/tests/lang/035.phpt b/tests/lang/035.phpt index bc49af99a5..0292868d7f 100644 --- a/tests/lang/035.phpt +++ b/tests/lang/035.phpt @@ -3,33 +3,33 @@ ZE2: set_exception_handler() --FILE-- <?php class MyException extends Exception { - function __construct($_error) { - $this->error = $_error; - } + function __construct($_error) { + $this->error = $_error; + } - function getException() - { - return $this->error; - } + function getException() + { + return $this->error; + } } function ThrowException() { - throw new MyException("'This is an exception!'"); + throw new MyException("'This is an exception!'"); } try { } catch (MyException $exception) { - print "There shouldn't be an exception: " . $exception->getException(); - print "\n"; + print "There shouldn't be an exception: " . $exception->getException(); + print "\n"; } try { - ThrowException(); + ThrowException(); } catch (MyException $exception) { - print "There was an exception: " . $exception->getException(); - print "\n"; + print "There was an exception: " . $exception->getException(); + print "\n"; } ?> --EXPECT-- diff --git a/tests/lang/036.phpt b/tests/lang/036.phpt index 474316e363..973deb6a0a 100644 --- a/tests/lang/036.phpt +++ b/tests/lang/036.phpt @@ -3,20 +3,20 @@ Child public element should not override parent private element in parent method --FILE-- <?php class par { - private $id = "foo"; + private $id = "foo"; - function displayMe() - { - print $this->id; - } + function displayMe() + { + print $this->id; + } }; class chld extends par { - public $id = "bar"; - function displayHim() - { - parent::displayMe(); - } + public $id = "bar"; + function displayHim() + { + parent::displayMe(); + } }; diff --git a/tests/lang/037.phpt b/tests/lang/037.phpt index c2a1ee312f..3d316f571c 100644 --- a/tests/lang/037.phpt +++ b/tests/lang/037.phpt @@ -4,21 +4,21 @@ <?php class par { - private $id="foo"; + private $id="foo"; - function displayMe() - { - $this->displayChild(); - } + function displayMe() + { + $this->displayChild(); + } }; class chld extends par { - private $id = "bar"; + private $id = "bar"; - function displayChild() - { - print $this->id; - } + function displayChild() + { + print $this->id; + } }; diff --git a/tests/lang/038.phpt b/tests/lang/038.phpt index 92f340c3f2..677c11be9c 100644 --- a/tests/lang/038.phpt +++ b/tests/lang/038.phpt @@ -5,17 +5,17 @@ Convert warnings to exceptions class MyException extends Exception { - function __construct($errstr, $errno=0, $errfile='', $errline='') - { - parent::__construct($errstr, $errno); - $this->file = $errfile; - $this->line = $errline; - } + function __construct($errstr, $errno=0, $errfile='', $errline='') + { + parent::__construct($errstr, $errno); + $this->file = $errfile; + $this->line = $errline; + } } function Error2Exception($errno, $errstr, $errfile, $errline) { - throw new MyException($errstr, $errno);//, $errfile, $errline); + throw new MyException($errstr, $errno);//, $errfile, $errline); } $err_msg = 'no exception'; @@ -23,13 +23,13 @@ set_error_handler('Error2Exception'); try { - $con = fopen("/tmp/a_file_that_does_not_exist",'r'); + $con = fopen("/tmp/a_file_that_does_not_exist",'r'); } catch (Exception $e) { - $trace = $e->getTrace(); - var_dump($trace[0]['function']); - var_dump($trace[1]['function']); + $trace = $e->getTrace(); + var_dump($trace[0]['function']); + var_dump($trace[1]['function']); } ?> diff --git a/tests/lang/039.phpt b/tests/lang/039.phpt index 764991fbb3..98d0902f53 100644 --- a/tests/lang/039.phpt +++ b/tests/lang/039.phpt @@ -9,17 +9,17 @@ interface Catchable class MyException extends Exception implements Catchable { - function __construct($errstr, $errno, $errfile, $errline) - { - parent::__construct($errstr, $errno); - $this->file = $errfile; - $this->line = $errline; - } + function __construct($errstr, $errno, $errfile, $errline) + { + parent::__construct($errstr, $errno); + $this->file = $errfile; + $this->line = $errline; + } } function Error2Exception($errno, $errstr, $errfile, $errline) { - throw new MyException($errstr, $errno, $errfile, $errline); + throw new MyException($errstr, $errno, $errfile, $errline); } $err_msg = 'no exception'; @@ -27,15 +27,15 @@ set_error_handler('Error2Exception'); try { - $con = fopen('/tmp/a_file_that_does_not_exist','r'); + $con = fopen('/tmp/a_file_that_does_not_exist','r'); } catch (Catchable $e) { - echo "Catchable\n"; + echo "Catchable\n"; } catch (Exception $e) { - echo "Exception\n"; + echo "Exception\n"; } ?> diff --git a/tests/lang/bug18872.phpt b/tests/lang/bug18872.phpt index 5e5333879d..1b4dd64ea1 100644 --- a/tests/lang/bug18872.phpt +++ b/tests/lang/bug18872.phpt @@ -3,11 +3,11 @@ Bug #18872 (class constant used as default parameter) --FILE-- <?php class FooBar { - const BIFF = 3; + const BIFF = 3; } function foo($biff = FooBar::BIFF) { - echo $biff . "\n"; + echo $biff . "\n"; } foo(); diff --git a/tests/lang/bug19943.phpt b/tests/lang/bug19943.phpt index c951190511..2266e09165 100644 --- a/tests/lang/bug19943.phpt +++ b/tests/lang/bug19943.phpt @@ -2,18 +2,18 @@ Bug #19943 (memleaks) --FILE-- <?php - $ar = array(); - for ($count = 0; $count < 10; $count++) { - $ar[$count] = "$count"; - @$ar[$count]['idx'] = "$count"; - } + $ar = array(); + for ($count = 0; $count < 10; $count++) { + $ar[$count] = "$count"; + @$ar[$count]['idx'] = "$count"; + } - for ($count = 0; $count < 10; $count++) { - echo $ar[$count]." -- ".@$ar[$count]['idx']."\n"; - } - $a = "0123456789"; - $a[9] = $a[0]; - var_dump($a); + for ($count = 0; $count < 10; $count++) { + echo $ar[$count]." -- ".@$ar[$count]['idx']."\n"; + } + $a = "0123456789"; + $a[9] = $a[0]; + var_dump($a); ?> --EXPECT-- 0 -- 0 diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt index 0d040c82d9..5ab5677dd6 100644 --- a/tests/lang/bug20175.phpt +++ b/tests/lang/bug20175.phpt @@ -16,18 +16,18 @@ print zend_version()."\n"; $foo_count = 0; function foo_global() { - global $foo_count; - echo "foo_global()\n"; - return 'foo:' . ++$foo_count; + global $foo_count; + echo "foo_global()\n"; + return 'foo:' . ++$foo_count; } function foo_static() { - static $foo_value; - echo "foo_static()\n"; - if (!isset($foo_value)) { - $foo_value = foo_global(); - } - return $foo_value; + static $foo_value; + echo "foo_static()\n"; + if (!isset($foo_value)) { + $foo_value = foo_global(); + } + return $foo_value; } /* Part 2: @@ -40,18 +40,18 @@ function foo_static() { $bar_count = 0; function bar_global() { - global $bar_count; - echo "bar_global()\n"; - return 'bar:' . ++$bar_count; + global $bar_count; + echo "bar_global()\n"; + return 'bar:' . ++$bar_count; } function bar_static() { - static $bar_value; - echo "bar_static()\n"; - if (!isset($bar_value)) { - $bar_value = &bar_global(); - } - return $bar_value; + static $bar_value; + echo "bar_static()\n"; + if (!isset($bar_value)) { + $bar_value = &bar_global(); + } + return $bar_value; } /* Part 3: TO BE DISCUSSED @@ -66,19 +66,19 @@ $wow_count = 0; $wow_name = ''; function &wow_global() { - global $wow_count, $wow_name; - echo "wow_global()\n"; - $wow_name = 'wow:' . ++$wow_count; - return $wow_name; + global $wow_count, $wow_name; + echo "wow_global()\n"; + $wow_name = 'wow:' . ++$wow_count; + return $wow_name; } function wow_static() { - static $wow_value; - echo "wow_static()\n"; - if (!isset($wow_value)) { - $wow_value = &wow_global(); - } - return $wow_value; + static $wow_value; + echo "wow_static()\n"; + if (!isset($wow_value)) { + $wow_value = &wow_global(); + } + return $wow_value; }*/ /* Part 4: @@ -93,29 +93,29 @@ function wow_static() { */ $oop_global = 0; class oop_class { - var $oop_name; + var $oop_name; - function __construct() { - global $oop_global; - echo "oop_class()\n"; - $this->oop_name = 'oop:' . ++$oop_global; - } + function __construct() { + global $oop_global; + echo "oop_class()\n"; + $this->oop_name = 'oop:' . ++$oop_global; + } } class oop_test { - static $oop_value; - - function __construct() { - echo "oop_test()\n"; - } - - function oop_static() { - echo "oop_static()\n"; - if (!isset(self::$oop_value)) { - self::$oop_value = new oop_class; - } - echo self::$oop_value->oop_name; - } + static $oop_value; + + function __construct() { + echo "oop_test()\n"; + } + + function oop_static() { + echo "oop_static()\n"; + if (!isset(self::$oop_value)) { + self::$oop_value = new oop_class; + } + echo self::$oop_value->oop_name; + } } print foo_static()."\n"; diff --git a/tests/lang/bug21094.phpt b/tests/lang/bug21094.phpt index 346185ba83..68928e9155 100644 --- a/tests/lang/bug21094.phpt +++ b/tests/lang/bug21094.phpt @@ -3,9 +3,9 @@ Bug #21094 (set_error_handler not accepting methods) --FILE-- <?php class test { - function hdlr($errno, $errstr, $errfile, $errline) { - printf("[%d] errstr: %s, errfile: %s, errline: %d\n", $errno, $errstr, $errfile, $errline, $errstr); - } + function hdlr($errno, $errstr, $errfile, $errline) { + printf("[%d] errstr: %s, errfile: %s, errline: %d\n", $errno, $errstr, $errfile, $errline, $errstr); + } } set_error_handler(array(new test(), "hdlr")); diff --git a/tests/lang/bug21669.phpt b/tests/lang/bug21669.phpt index 643b0695ee..17db108157 100644 --- a/tests/lang/bug21669.phpt +++ b/tests/lang/bug21669.phpt @@ -3,17 +3,17 @@ Bug #21669 ("$obj = new $this->var;" doesn't work) --FILE-- <?php class Test { - function say_hello() { - echo "Hello world"; - } + function say_hello() { + echo "Hello world"; + } } class Factory { - public $name = "Test"; - function create() { - $obj = new $this->name; /* Parse error */ - return $obj; - } + public $name = "Test"; + function create() { + $obj = new $this->name; /* Parse error */ + return $obj; + } } $factory = new Factory; $test = $factory->create(); diff --git a/tests/lang/bug21849.phpt b/tests/lang/bug21849.phpt index def754a3a6..3b7f664f86 100644 --- a/tests/lang/bug21849.phpt +++ b/tests/lang/bug21849.phpt @@ -3,11 +3,11 @@ Bug #21849 (self::constant doesn't work as method's default parameter) --FILE-- <?php class foo { - const bar = "fubar\n"; + const bar = "fubar\n"; - function __construct($arg = self::bar) { - echo $arg; - } + function __construct($arg = self::bar) { + echo $arg; + } } new foo(); diff --git a/tests/lang/bug21961.phpt b/tests/lang/bug21961.phpt index 93e4374220..a03c382eb3 100644 --- a/tests/lang/bug21961.phpt +++ b/tests/lang/bug21961.phpt @@ -5,47 +5,47 @@ Bug #21961 (get_parent_class() segfault) class man { - public $name, $bars; - function __construct() - { - $this->name = 'Mr. X'; - $this->bars = array(); - } - - function getdrunk($where) - { - $this->bars[] = new bar($where); - } - - function getName() - { - return $this->name; - } + public $name, $bars; + function __construct() + { + $this->name = 'Mr. X'; + $this->bars = array(); + } + + function getdrunk($where) + { + $this->bars[] = new bar($where); + } + + function getName() + { + return $this->name; + } } class bar extends man { - public $name; - - function __construct($w) - { - $this->name = $w; - } - - function getName() - { - return $this->name; - } - - function whosdrunk() - { - $who = get_parent_class($this); - if($who == NULL) - { - return 'nobody'; - } - return eval("return ".$who.'::getName();'); - } + public $name; + + function __construct($w) + { + $this->name = $w; + } + + function getName() + { + return $this->name; + } + + function whosdrunk() + { + $who = get_parent_class($this); + if($who == NULL) + { + return 'nobody'; + } + return eval("return ".$who.'::getName();'); + } } $x = new man; diff --git a/tests/lang/bug22510.phpt b/tests/lang/bug22510.phpt index 842373c6c6..e79972d29e 100644 --- a/tests/lang/bug22510.phpt +++ b/tests/lang/bug22510.phpt @@ -4,74 +4,74 @@ Bug #22510 (segfault among complex references) <?php class foo { - public $list = array(); - - function finalize() { - print __CLASS__."::".__FUNCTION__."\n"; - $cl = &$this->list; - } - - function &method1() { - print __CLASS__."::".__FUNCTION__."\n"; - return @$this->foo; - } - - function &method2() { - print __CLASS__."::".__FUNCTION__."\n"; - return $this->foo; - } - - function method3() { - print __CLASS__."::".__FUNCTION__."\n"; - return @$this->foo; - } + public $list = array(); + + function finalize() { + print __CLASS__."::".__FUNCTION__."\n"; + $cl = &$this->list; + } + + function &method1() { + print __CLASS__."::".__FUNCTION__."\n"; + return @$this->foo; + } + + function &method2() { + print __CLASS__."::".__FUNCTION__."\n"; + return $this->foo; + } + + function method3() { + print __CLASS__."::".__FUNCTION__."\n"; + return @$this->foo; + } } class bar { - function run1() { - print __CLASS__."::".__FUNCTION__."\n"; - $this->instance = new foo(); - $this->instance->method1($this); - $this->instance->method1($this); - } - - function run2() { - print __CLASS__."::".__FUNCTION__."\n"; - $this->instance = new foo(); - $this->instance->method2($this); - $this->instance->method2($this); - } - - function run3() { - print __CLASS__."::".__FUNCTION__."\n"; - $this->instance = new foo(); - $this->instance->method3($this); - $this->instance->method3($this); - } + function run1() { + print __CLASS__."::".__FUNCTION__."\n"; + $this->instance = new foo(); + $this->instance->method1($this); + $this->instance->method1($this); + } + + function run2() { + print __CLASS__."::".__FUNCTION__."\n"; + $this->instance = new foo(); + $this->instance->method2($this); + $this->instance->method2($this); + } + + function run3() { + print __CLASS__."::".__FUNCTION__."\n"; + $this->instance = new foo(); + $this->instance->method3($this); + $this->instance->method3($this); + } } function ouch(&$bar) { - print __FUNCTION__."\n"; - @$a = $a; - $bar->run1(); + print __FUNCTION__."\n"; + @$a = $a; + $bar->run1(); } function ok1(&$bar) { - print __FUNCTION__."\n"; - $bar->run1(); + print __FUNCTION__."\n"; + $bar->run1(); } function ok2(&$bar) { - print __FUNCTION__."\n"; - @$a = $a; - $bar->run2(); + print __FUNCTION__."\n"; + @$a = $a; + $bar->run2(); } function ok3(&$bar) { - print __FUNCTION__."\n"; - @$a = $a; - $bar->run3(); + print __FUNCTION__."\n"; + @$a = $a; + $bar->run3(); } $foo = new bar(); diff --git a/tests/lang/bug22592.phpt b/tests/lang/bug22592.phpt index 6999c0bccf..24b5f50fdf 100644 --- a/tests/lang/bug22592.phpt +++ b/tests/lang/bug22592.phpt @@ -3,7 +3,7 @@ Bug #22592 (cascading assignments to strings with curly braces broken) --FILE-- <?php function error_hdlr($errno, $errstr) { - echo "[$errstr]\n"; + echo "[$errstr]\n"; } set_error_handler('error_hdlr'); diff --git a/tests/lang/bug24054.phpt b/tests/lang/bug24054.phpt index 4ee5d631e6..267057f165 100644 --- a/tests/lang/bug24054.phpt +++ b/tests/lang/bug24054.phpt @@ -6,12 +6,12 @@ Bug #24054 (Assignment operator *= broken) define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), - is_int(LONG_MIN-1),is_int(LONG_MAX+1)); + is_int(LONG_MIN-1),is_int(LONG_MAX+1)); - $i = LONG_MAX; + $i = LONG_MAX; - $j = $i * 1001; - $i *= 1001; + $j = $i * 1001; + $i *= 1001; $tests = <<<TESTS $i === $j diff --git a/tests/lang/bug24436.phpt b/tests/lang/bug24436.phpt index b0cfbe0931..cb14d29919 100644 --- a/tests/lang/bug24436.phpt +++ b/tests/lang/bug24436.phpt @@ -3,10 +3,10 @@ Bug #24436 (isset() and empty() produce errors with non-existent variables in ob --FILE-- <?php class test { - function __construct() { - if (empty($this->test[0][0])) { print "test1";} - if (!isset($this->test[0][0])) { print "test2";} - } + function __construct() { + if (empty($this->test[0][0])) { print "test1";} + if (!isset($this->test[0][0])) { print "test2";} + } } $test1 = new test(); diff --git a/tests/lang/bug24499.phpt b/tests/lang/bug24499.phpt index 263293391f..b7a35115ae 100644 --- a/tests/lang/bug24499.phpt +++ b/tests/lang/bug24499.phpt @@ -7,7 +7,7 @@ class Id { public function tester($obj) { - $obj->id = "bar"; + $obj->id = "bar"; } } diff --git a/tests/lang/bug24640.phpt b/tests/lang/bug24640.phpt index 6f5c8f5272..7095fed1fe 100644 --- a/tests/lang/bug24640.phpt +++ b/tests/lang/bug24640.phpt @@ -7,11 +7,11 @@ serialize_precision=17 <?php function test($v) { - echo var_export($v, true) . "\n"; - var_dump($v); - echo "$v\n"; - print_r($v); - echo "\n------\n"; + echo var_export($v, true) . "\n"; + var_dump($v); + echo "$v\n"; + print_r($v); + echo "\n------\n"; } test(1.7e+300); diff --git a/tests/lang/bug24658.phpt b/tests/lang/bug24658.phpt index a53457d5d9..4baa195242 100644 --- a/tests/lang/bug24658.phpt +++ b/tests/lang/bug24658.phpt @@ -4,16 +4,16 @@ Bug #24658 (combo of typehint / reference causes crash) <?php class foo {} function no_typehint($a) { - var_dump($a); + var_dump($a); } function typehint(foo $a) { - var_dump($a); + var_dump($a); } function no_typehint_ref(&$a) { - var_dump($a); + var_dump($a); } function typehint_ref(foo &$a) { - var_dump($a); + var_dump($a); } $v = new foo(); $a = array(new foo(), 1, 2); diff --git a/tests/lang/bug24783.phpt b/tests/lang/bug24783.phpt index 8c8cd6ee01..74885f149e 100644 --- a/tests/lang/bug24783.phpt +++ b/tests/lang/bug24783.phpt @@ -3,11 +3,11 @@ Bug #24783 ($key not binary safe in "foreach($arr as $key => $val)") --FILE-- <?php error_reporting(E_ALL); - $arr = array ("foo\0bar" => "foo\0bar"); - foreach ($arr as $key => $val) { - echo strlen($key), ': '; - echo urlencode($key), ' => ', urlencode($val), "\n"; - } + $arr = array ("foo\0bar" => "foo\0bar"); + foreach ($arr as $key => $val) { + echo strlen($key), ': '; + echo urlencode($key), ' => ', urlencode($val), "\n"; + } ?> --EXPECT-- 7: foo%00bar => foo%00bar diff --git a/tests/lang/bug24908.phpt b/tests/lang/bug24908.phpt index 910b715a05..4c40a9fd81 100644 --- a/tests/lang/bug24908.phpt +++ b/tests/lang/bug24908.phpt @@ -5,12 +5,12 @@ variables_order=GPS --FILE-- <?php class test { - function __construct() { - if (count($_SERVER)) echo "O"; - } - function __destruct() { - if (count($_SERVER)) echo "K\n"; - } + function __construct() { + if (count($_SERVER)) echo "O"; + } + function __destruct() { + if (count($_SERVER)) echo "K\n"; + } } $test = new test(); ?> diff --git a/tests/lang/bug24951.phpt b/tests/lang/bug24951.phpt index 5538e13815..7d5df2030f 100644 --- a/tests/lang/bug24951.phpt +++ b/tests/lang/bug24951.phpt @@ -4,26 +4,26 @@ Bug #24951 (ob_flush() destroys output handler) <?php function test($s, $mode) { - return (($mode & PHP_OUTPUT_HANDLER_START)?"[":"") . $s . (($mode & PHP_OUTPUT_HANDLER_END)?"]\n":""); + return (($mode & PHP_OUTPUT_HANDLER_START)?"[":"") . $s . (($mode & PHP_OUTPUT_HANDLER_END)?"]\n":""); } function t1() { - ob_start("test"); - echo "Hello from t1 1 "; + ob_start("test"); + echo "Hello from t1 1 "; echo "Hello from t1 2 "; ob_end_flush(); } function t2() { - ob_start("test"); - echo "Hello from t2 1 "; + ob_start("test"); + echo "Hello from t2 1 "; ob_flush(); echo "Hello from t2 2 "; ob_end_flush(); } function t3() { - ob_start("test"); + ob_start("test"); echo "Hello from t3 1 "; ob_clean(); echo "Hello from t3 2 "; diff --git a/tests/lang/bug25547.phpt b/tests/lang/bug25547.phpt index eae32e7223..238757592e 100644 --- a/tests/lang/bug25547.phpt +++ b/tests/lang/bug25547.phpt @@ -5,13 +5,13 @@ Bug #25547 (error_handler and array index with function call) function handler($errno, $errstr, $errfile, $errline) { - echo __FUNCTION__ . "($errstr)\n"; + echo __FUNCTION__ . "($errstr)\n"; } set_error_handler('handler'); function foo($x) { - return "foo"; + return "foo"; } $output = array(); diff --git a/tests/lang/bug25652.phpt b/tests/lang/bug25652.phpt index b0125de085..037caf3a80 100644 --- a/tests/lang/bug25652.phpt +++ b/tests/lang/bug25652.phpt @@ -3,19 +3,19 @@ Bug #25652 (Calling Global functions dynamically fails from Class scope) --FILE-- <?php - function testfunc ($var) { - echo "testfunc $var\n"; - } + function testfunc ($var) { + echo "testfunc $var\n"; + } - class foo { - public $arr = array('testfunc'); - function bar () { - $this->arr[0]('testvalue'); - } - } + class foo { + public $arr = array('testfunc'); + function bar () { + $this->arr[0]('testvalue'); + } + } - $a = new foo (); - $a->bar (); + $a = new foo (); + $a->bar (); ?> --EXPECT-- diff --git a/tests/lang/bug25922.phpt b/tests/lang/bug25922.phpt index 796ef6df82..96e8f596f1 100644 --- a/tests/lang/bug25922.phpt +++ b/tests/lang/bug25922.phpt @@ -6,15 +6,15 @@ error_reporting=2047 <?php function my_error_handler($error, $errmsg='', $errfile='', $errline=0, $errcontext='') { - echo "$errmsg\n"; - $errcontext = ''; + echo "$errmsg\n"; + $errcontext = ''; } set_error_handler('my_error_handler'); function test() { - echo "Undefined index here: '{$data['HTTP_HEADER']}'\n"; + echo "Undefined index here: '{$data['HTTP_HEADER']}'\n"; } test(); ?> diff --git a/tests/lang/bug26696.phpt b/tests/lang/bug26696.phpt index a73694c95a..1d10297b12 100644 --- a/tests/lang/bug26696.phpt +++ b/tests/lang/bug26696.phpt @@ -6,20 +6,20 @@ Bug #26696 (string index in a switch() crashes with multiple matches) $str = 'asdd/?'; $len = strlen($str); for ($i = 0; $i < $len; $i++) { - switch ($str[$i]) { - case '?': - echo "OK\n"; - break; - } + switch ($str[$i]) { + case '?': + echo "OK\n"; + break; + } } $str = '*'; switch ($str[0]) { - case '*'; - echo "OK\n"; - break; - default: - echo 'Default RAN!'; + case '*'; + echo "OK\n"; + break; + default: + echo 'Default RAN!'; } ?> diff --git a/tests/lang/bug26866.phpt b/tests/lang/bug26866.phpt index abb99c34fd..7761b65d8a 100644 --- a/tests/lang/bug26866.phpt +++ b/tests/lang/bug26866.phpt @@ -3,22 +3,22 @@ Bug #26866 (segfault when exception raised in __get) --FILE-- <?php class bar { - function get_name() { - return 'bar'; - } + function get_name() { + return 'bar'; + } } class foo { - function __get($sName) { - throw new Exception('Exception!'); - return new bar(); - } + function __get($sName) { + throw new Exception('Exception!'); + return new bar(); + } } $foo = new foo(); try { - echo $foo->bar->get_name(); + echo $foo->bar->get_name(); } catch (Exception $E) { - echo "Exception raised!\n"; + echo "Exception raised!\n"; } ?> --EXPECT-- diff --git a/tests/lang/bug26869.phpt b/tests/lang/bug26869.phpt index 77dd2592ed..065cf1dd67 100644 --- a/tests/lang/bug26869.phpt +++ b/tests/lang/bug26869.phpt @@ -2,10 +2,10 @@ Bug #26869 (constant as the key of static array) --FILE-- <?php - define("A", "1"); - static $a=array(A => 1); - var_dump($a); - var_dump(isset($a[A])); + define("A", "1"); + static $a=array(A => 1); + var_dump($a); + var_dump(isset($a[A])); ?> --EXPECT-- array(1) { diff --git a/tests/lang/bug27354.phpt b/tests/lang/bug27354.phpt index e10ad9c924..c6ce9804fd 100644 --- a/tests/lang/bug27354.phpt +++ b/tests/lang/bug27354.phpt @@ -2,10 +2,10 @@ Bug #27354 (Modulus operator crashes PHP) --FILE-- <?php - var_dump(-2147483647 % -1); - var_dump(-2147483649 % -1); - var_dump(-2147483648 % -1); - var_dump(-2147483648 % -2); + var_dump(-2147483647 % -1); + var_dump(-2147483649 % -1); + var_dump(-2147483648 % -1); + var_dump(-2147483648 % -2); ?> --EXPECTF-- int(%i) diff --git a/tests/lang/bug27439.phpt b/tests/lang/bug27439.phpt index de4bcd05a7..ceb714d81b 100644 --- a/tests/lang/bug27439.phpt +++ b/tests/lang/bug27439.phpt @@ -4,54 +4,54 @@ Bug #27439 (foreach() with $this segfaults) <?php class test_props { - public $a = 1; - public $b = 2; - public $c = 3; + public $a = 1; + public $b = 2; + public $c = 3; } class test { - public $array = array(1,2,3); - public $string = "string"; + public $array = array(1,2,3); + public $string = "string"; - public function __construct() { - $this->object = new test_props; - } + public function __construct() { + $this->object = new test_props; + } - public function getArray() { - return $this->array; - } + public function getArray() { + return $this->array; + } - public function getString() { - return $this->string; - } + public function getString() { + return $this->string; + } - public function case1() { - foreach ($this->array as $foo) { - echo $foo; - } - } + public function case1() { + foreach ($this->array as $foo) { + echo $foo; + } + } - public function case2() { - foreach ($this->foobar as $foo); - } + public function case2() { + foreach ($this->foobar as $foo); + } - public function case3() { - foreach ($this->string as $foo); - } + public function case3() { + foreach ($this->string as $foo); + } - public function case4() { - foreach ($this->getArray() as $foo); - } + public function case4() { + foreach ($this->getArray() as $foo); + } - public function case5() { - foreach ($this->getString() as $foo); - } + public function case5() { + foreach ($this->getString() as $foo); + } - public function case6() { - foreach ($this->object as $foo) { - echo $foo; - } - } + public function case6() { + foreach ($this->object as $foo) { + echo $foo; + } + } } $test = new test(); $test->case1(); diff --git a/tests/lang/bug27535.phpt b/tests/lang/bug27535.phpt index 604b2d3d04..a8294e0f09 100644 --- a/tests/lang/bug27535.phpt +++ b/tests/lang/bug27535.phpt @@ -5,19 +5,19 @@ Bug #27535 (Objects pointing to each other cause Apache to crash) class Class1 { - public $_Class2_obj; + public $_Class2_obj; } class Class2 { - public $storage = ''; + public $storage = ''; - function __construct() - { - $this->storage = new Class1(); + function __construct() + { + $this->storage = new Class1(); - $this->storage->_Class2_obj = $this; - } + $this->storage->_Class2_obj = $this; + } } $foo = new Class2(); diff --git a/tests/lang/bug28800.phpt b/tests/lang/bug28800.phpt index 1b84cd6d0d..2845ca7c88 100644 --- a/tests/lang/bug28800.phpt +++ b/tests/lang/bug28800.phpt @@ -2,10 +2,10 @@ Bug #28800 (Incorrect string to number conversion for strings starting with 'inf') --FILE-- <?php - $strings = array('into', 'info', 'inf', 'infinity', 'infin', 'inflammable'); - foreach ($strings as $v) { - echo ($v+0)."\n"; - } + $strings = array('into', 'info', 'inf', 'infinity', 'infin', 'inflammable'); + foreach ($strings as $v) { + echo ($v+0)."\n"; + } ?> --EXPECTF-- Warning: A non-numeric value encountered in %s on line %d diff --git a/tests/lang/bug29944.phpt b/tests/lang/bug29944.phpt index 19321ca574..d0f2dd2943 100644 --- a/tests/lang/bug29944.phpt +++ b/tests/lang/bug29944.phpt @@ -5,12 +5,12 @@ Bug #29944 (function defined in switch crashes PHP) $a = 1; $b = "1"; switch ($a) { - case 1: - function foo($bar) { - if (preg_match('/\d/', $bar)) return true; - return false; - } - echo foo($b); + case 1: + function foo($bar) { + if (preg_match('/\d/', $bar)) return true; + return false; + } + echo foo($b); } ?> diff --git a/tests/lang/bug30862.phpt b/tests/lang/bug30862.phpt index 7f2d3ed4ae..531dc0b482 100644 --- a/tests/lang/bug30862.phpt +++ b/tests/lang/bug30862.phpt @@ -3,7 +3,7 @@ Bug #30862 (Static array with boolean indexes) --FILE-- <?php class T { - static $a = array(false=>"false", true=>"true"); + static $a = array(false=>"false", true=>"true"); } print_r(T::$a); ?> @@ -12,7 +12,7 @@ print_r(T::$a); define("X",0); define("Y",1); class T2 { - static $a = array(X=>"false", Y=>"true"); + static $a = array(X=>"false", Y=>"true"); } print_r(T2::$a); ?> diff --git a/tests/lang/bug32828.phpt b/tests/lang/bug32828.phpt index b5772afc52..fc168971e6 100644 --- a/tests/lang/bug32828.phpt +++ b/tests/lang/bug32828.phpt @@ -5,7 +5,7 @@ Bug #32828 (Throwing exception in output_callback function with ob_start and ob_ function output_handler($buffer) { - throw new Exception; + throw new Exception; } ob_start('output_handler'); diff --git a/tests/lang/bug43958.phpt b/tests/lang/bug43958.phpt index 498b132447..10a083a3f2 100644 --- a/tests/lang/bug43958.phpt +++ b/tests/lang/bug43958.phpt @@ -4,9 +4,9 @@ Bug #43958 (class name added into the error message) <?php class MyClass { - static public function loadCode($p) { - return include $p; - } + static public function loadCode($p) { + return include $p; + } } MyClass::loadCode('file-which-does-not-exist-on-purpose.php'); diff --git a/tests/lang/bug73329.phpt b/tests/lang/bug73329.phpt index 57117bf550..a4f7a53fa7 100644 --- a/tests/lang/bug73329.phpt +++ b/tests/lang/bug73329.phpt @@ -2,12 +2,12 @@ Bug #73329 (Float)"Nano" == NAN --FILE-- <?php - var_dump( - (float)"nanite", - (float)"nan", - (float)"inf", - (float)"infusorian" - ); + var_dump( + (float)"nanite", + (float)"nan", + (float)"inf", + (float)"infusorian" + ); ?> --EXPECT-- float(0) diff --git a/tests/lang/bug7515.phpt b/tests/lang/bug7515.phpt index 8927c5df94..6c8632c0fa 100644 --- a/tests/lang/bug7515.phpt +++ b/tests/lang/bug7515.phpt @@ -3,7 +3,7 @@ Bug #7515 (weird & invisible referencing of objects) --FILE-- <?php class obj { - function method() {} + function method() {} } $o = new stdClass; diff --git a/tests/lang/catchable_error_001.phpt b/tests/lang/catchable_error_001.phpt index b11a7c8d96..499ac14430 100644 --- a/tests/lang/catchable_error_001.phpt +++ b/tests/lang/catchable_error_001.phpt @@ -2,21 +2,21 @@ Catchable fatal error [1] --FILE-- <?php - class Foo { - } + class Foo { + } - function blah (Foo $a) - { - } + function blah (Foo $a) + { + } - function error() - { - $a = func_get_args(); - var_dump($a); - } + function error() + { + $a = func_get_args(); + var_dump($a); + } - blah (new StdClass); - echo "ALIVE!\n"; + blah (new StdClass); + echo "ALIVE!\n"; ?> --EXPECTF-- Fatal error: Uncaught TypeError: Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php:5 diff --git a/tests/lang/catchable_error_002.phpt b/tests/lang/catchable_error_002.phpt index 10312533c1..7cdc02c899 100644 --- a/tests/lang/catchable_error_002.phpt +++ b/tests/lang/catchable_error_002.phpt @@ -2,27 +2,27 @@ Catchable fatal error [2] --FILE-- <?php - class Foo { - } + class Foo { + } - function blah (Foo $a) - { - } + function blah (Foo $a) + { + } - function error() - { - $a = func_get_args(); - var_dump($a); - } + function error() + { + $a = func_get_args(); + var_dump($a); + } - set_error_handler('error'); + set_error_handler('error'); - try { - blah (new StdClass); - } catch (Error $ex) { - echo $ex->getMessage(), "\n"; - } - echo "ALIVE!\n"; + try { + blah (new StdClass); + } catch (Error $ex) { + echo $ex->getMessage(), "\n"; + } + echo "ALIVE!\n"; ?> --EXPECTF-- Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d diff --git a/tests/lang/compare_objects_basic1.phpt b/tests/lang/compare_objects_basic1.phpt index 9a4c762075..7df64e95c7 100644 --- a/tests/lang/compare_objects_basic1.phpt +++ b/tests/lang/compare_objects_basic1.phpt @@ -10,17 +10,17 @@ class class1{} class class2{} class class3{ - public $aaa; - private $bbb; - protected $ccc; + public $aaa; + private $bbb; + protected $ccc; } class class4 extends class3{ } class class5 extends class3{ - public $ddd; - private $eee; + public $ddd; + private $eee; } // Define a bunch of objects all of which will use standard compare object handler diff --git a/tests/lang/engine_assignExecutionOrder_001.phpt b/tests/lang/engine_assignExecutionOrder_001.phpt index a70e3eee93..e50daa7d17 100644 --- a/tests/lang/engine_assignExecutionOrder_001.phpt +++ b/tests/lang/engine_assignExecutionOrder_001.phpt @@ -4,13 +4,13 @@ Evaluation order during assignments. <?php function f() { - echo "in f()\n"; - return "name"; + echo "in f()\n"; + return "name"; } function g() { - echo "in g()\n"; - return "assigned value"; + echo "in g()\n"; + return "assigned value"; } @@ -41,9 +41,9 @@ var_dump($oc); class C { - public static $name = "original"; - public static $a = array(); - public static $string = "hello"; + public static $name = "original"; + public static $a = array(); + public static $string = "hello"; } echo "\n\nOrder with static property assignment:\n"; C::${f()} = g(); @@ -56,12 +56,12 @@ var_dump(C::$a); echo "\n\nOrder with indexed string assignment:\n"; $string = "hello"; function getOffset() { - echo "in getOffset()\n"; - return 0; + echo "in getOffset()\n"; + return 0; } function newChar() { - echo "in newChar()\n"; - return 'j'; + echo "in newChar()\n"; + return 'j'; } $string[getOffset()] = newChar(); var_dump($string); diff --git a/tests/lang/engine_assignExecutionOrder_008.phpt b/tests/lang/engine_assignExecutionOrder_008.phpt index 76b0cb1a7c..4b2aeb3451 100644 --- a/tests/lang/engine_assignExecutionOrder_008.phpt +++ b/tests/lang/engine_assignExecutionOrder_008.phpt @@ -51,7 +51,7 @@ echo $a[$i->p[0]->p=f()][++$i->p[0]->p]; unset($i); Class C { - static $p; + static $p; } echo "\n" . 'C::$p=f(): '; diff --git a/tests/lang/engine_assignExecutionOrder_009.phpt b/tests/lang/engine_assignExecutionOrder_009.phpt index 5401ecc287..b7086237ed 100644 --- a/tests/lang/engine_assignExecutionOrder_009.phpt +++ b/tests/lang/engine_assignExecutionOrder_009.phpt @@ -3,8 +3,8 @@ Execution ordering with comparison operators. --FILE-- <?php function f($x) { - echo "f($x) "; - return $x; + echo "f($x) "; + return $x; } echo "Function call args:\n"; diff --git a/tests/lang/error_2_exception_001.phpt b/tests/lang/error_2_exception_001.phpt index 6ef3a52676..32d85bf1cb 100644 --- a/tests/lang/error_2_exception_001.phpt +++ b/tests/lang/error_2_exception_001.phpt @@ -4,22 +4,22 @@ ZE2 errors caught as exceptions <?php class MyException extends Exception { - function __construct($_errno, $_errmsg) { - $this->errno = $_errno; - $this->errmsg = $_errmsg; - } - - function getErrno() { - return $this->errno; - } - - function getErrmsg() { - return $this->errmsg; - } + function __construct($_errno, $_errmsg) { + $this->errno = $_errno; + $this->errmsg = $_errmsg; + } + + function getErrno() { + return $this->errno; + } + + function getErrmsg() { + return $this->errmsg; + } } function ErrorsToExceptions($errno, $errmsg) { - throw new MyException($errno, $errmsg); + throw new MyException($errno, $errmsg); } set_error_handler("ErrorsToExceptions"); @@ -29,13 +29,13 @@ set_error_handler("ErrorsToExceptions"); try { } catch (MyException $exception) { - echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; + echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; } try { - trigger_error("I will become an exception", E_USER_ERROR); + trigger_error("I will become an exception", E_USER_ERROR); } catch (MyException $exception) { - echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; + echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; } ?> diff --git a/tests/lang/foreachLoop.001.phpt b/tests/lang/foreachLoop.001.phpt index a7ec701fd1..a3315ade9d 100644 --- a/tests/lang/foreachLoop.001.phpt +++ b/tests/lang/foreachLoop.001.phpt @@ -6,10 +6,10 @@ Foreach loop tests - basic loop with just value and key => value. $a = array("a","b","c"); foreach ($a as $v) { - var_dump($v); + var_dump($v); } foreach ($a as $k => $v) { - var_dump($k, $v); + var_dump($k, $v); } //check key and value after the loop. var_dump($k, $v); @@ -17,10 +17,10 @@ var_dump($k, $v); echo "\n"; //Dynamic array foreach (array("d","e","f") as $v) { - var_dump($v); + var_dump($v); } foreach (array("d","e","f") as $k => $v) { - var_dump($k, $v); + var_dump($k, $v); } //check key and value after the loop. var_dump($k, $v); diff --git a/tests/lang/foreachLoop.002.phpt b/tests/lang/foreachLoop.002.phpt index e0426e810f..fe2434fbe4 100644 --- a/tests/lang/foreachLoop.002.phpt +++ b/tests/lang/foreachLoop.002.phpt @@ -6,15 +6,15 @@ Foreach loop tests - modifying the array during the loop. echo "\nDirectly changing array values.\n"; $a = array("original.1","original.2","original.3"); foreach ($a as $k=>$v) { - $a[$k]="changed.$k"; - var_dump($v); + $a[$k]="changed.$k"; + var_dump($v); } var_dump($a); echo "\nModifying the foreach \$value.\n"; $a = array("original.1","original.2","original.3"); foreach ($a as $k=>$v) { - $v="changed.$k"; + $v="changed.$k"; } var_dump($a); @@ -22,7 +22,7 @@ var_dump($a); echo "\nModifying the foreach &\$value.\n"; $a = array("original.1","original.2","original.3"); foreach ($a as $k=>&$v) { - $v="changed.$k"; + $v="changed.$k"; } var_dump($a); @@ -30,12 +30,12 @@ echo "\nPushing elements onto an unreferenced array.\n"; $a = array("original.1","original.2","original.3"); $counter=0; foreach ($a as $v) { - array_push($a, "new.$counter"); + array_push($a, "new.$counter"); - //avoid infinite loop if test is failing + //avoid infinite loop if test is failing if ($counter++>10) { - echo "Loop detected\n"; - break; + echo "Loop detected\n"; + break; } } var_dump($a); @@ -44,12 +44,12 @@ echo "\nPushing elements onto an unreferenced array, using &\$value.\n"; $a = array("original.1","original.2","original.3"); $counter=0; foreach ($a as &$v) { - array_push($a, "new.$counter"); + array_push($a, "new.$counter"); - //avoid infinite loop if test is failing + //avoid infinite loop if test is failing if ($counter++>10) { - echo "Loop detected\n"; - break; + echo "Loop detected\n"; + break; } } var_dump($a); @@ -57,16 +57,16 @@ var_dump($a); echo "\nPopping elements off an unreferenced array.\n"; $a = array("original.1","original.2","original.3"); foreach ($a as $v) { - array_pop($a); - var_dump($v); + array_pop($a); + var_dump($v); } var_dump($a); echo "\nPopping elements off an unreferenced array, using &\$value.\n"; $a = array("original.1","original.2","original.3"); foreach ($a as &$v) { - array_pop($a); - var_dump($v); + array_pop($a); + var_dump($v); } var_dump($a); diff --git a/tests/lang/foreachLoop.003.phpt b/tests/lang/foreachLoop.003.phpt index 3f20021a7b..352ac335b7 100644 --- a/tests/lang/foreachLoop.003.phpt +++ b/tests/lang/foreachLoop.003.phpt @@ -5,27 +5,27 @@ Foreach loop tests - error case: not an array. echo "\nNot an array.\n"; $a = TRUE; foreach ($a as $v) { - var_dump($v); + var_dump($v); } $a = null; foreach ($a as $v) { - var_dump($v); + var_dump($v); } $a = 1; foreach ($a as $v) { - var_dump($v); + var_dump($v); } $a = 1.5; foreach ($a as $v) { - var_dump($v); + var_dump($v); } $a = "hello"; foreach ($a as $v) { - var_dump($v); + var_dump($v); } echo "done.\n"; diff --git a/tests/lang/foreachLoop.004.phpt b/tests/lang/foreachLoop.004.phpt index 3cc1960ca1..21283c9c8c 100644 --- a/tests/lang/foreachLoop.004.phpt +++ b/tests/lang/foreachLoop.004.phpt @@ -6,7 +6,7 @@ Foreach loop tests - using an array element as the $value $a=array("a", "b", "c"); $v=array(); foreach($a as $v[0]) { - var_dump($v); + var_dump($v); } var_dump($a); var_dump($v); @@ -15,7 +15,7 @@ echo "\n"; $a=array("a", "b", "c"); $v=array(); foreach($a as $k=>$v[0]) { - var_dump($k, $v); + var_dump($k, $v); } var_dump($a); var_dump($k, $v); diff --git a/tests/lang/foreachLoop.009.phpt b/tests/lang/foreachLoop.009.phpt index 9bf2957e12..a7ab6f49ed 100644 --- a/tests/lang/foreachLoop.009.phpt +++ b/tests/lang/foreachLoop.009.phpt @@ -9,16 +9,16 @@ echo "\nRemove elements from a referenced array during loop\n"; $refedArray=array("original.0", "original.1", "original.2"); $ref=&$refedArray; foreach ($refedArray as $k=>$v1) { - array_pop($refedArray); - echo "key: $k; value: $v1\n"; + array_pop($refedArray); + echo "key: $k; value: $v1\n"; } echo "\nRemove elements from a referenced array during loop, using &\$value\n"; $refedArray=array("original.0", "original.1", "original.2"); $ref=&$refedArray; foreach ($refedArray as $k=>&$v2) { - array_pop($refedArray); - echo "key: $k; value: $v2\n"; + array_pop($refedArray); + echo "key: $k; value: $v2\n"; } echo "\nAdd elements to a referenced array during loop\n"; @@ -26,13 +26,13 @@ $refedArray=array("original.0", "original.1", "original.2"); $ref=&$refedArray; $count=0; foreach ($refedArray as $k=>$v3) { - array_push($refedArray, "new.$k"); - echo "key: $k; value: $v3\n"; + array_push($refedArray, "new.$k"); + echo "key: $k; value: $v3\n"; - if ($count++>5) { - echo "Loop detected, as expected.\n"; - break; - } + if ($count++>5) { + echo "Loop detected, as expected.\n"; + break; + } } echo "\nAdd elements to a referenced array during loop, using &\$value\n"; @@ -40,13 +40,13 @@ $refedArray=array("original.0", "original.1", "original.2"); $ref=&$refedArray; $count=0; foreach ($refedArray as $k=>&$v4) { - array_push($refedArray, "new.$k"); - echo "key: $k; value: $v4\n"; + array_push($refedArray, "new.$k"); + echo "key: $k; value: $v4\n"; - if ($count++>5) { - echo "Loop detected, as expected.\n"; - break; - } + if ($count++>5) { + echo "Loop detected, as expected.\n"; + break; + } } ?> diff --git a/tests/lang/foreachLoop.010.phpt b/tests/lang/foreachLoop.010.phpt index e114e839b9..17b4db85e4 100644 --- a/tests/lang/foreachLoop.010.phpt +++ b/tests/lang/foreachLoop.010.phpt @@ -24,13 +24,13 @@ $container = null; $i=0; foreach ($a as $v) { - array_push($a, 'new'); - var_dump($v); + array_push($a, 'new'); + var_dump($v); - if (++$i>10) { - echo "Infinite loop detected\n"; - break; - } + if (++$i>10) { + echo "Infinite loop detected\n"; + break; + } } ?> diff --git a/tests/lang/foreachLoop.011.phpt b/tests/lang/foreachLoop.011.phpt index b1048fa9a2..ee7066dc35 100644 --- a/tests/lang/foreachLoop.011.phpt +++ b/tests/lang/foreachLoop.011.phpt @@ -6,8 +6,8 @@ echo "\nChange from array to non iterable:\n"; $a = array(1,2,3); $b=&$a; foreach ($a as $v) { - var_dump($v); - $b=1; + var_dump($v); + $b=1; } echo "\nChange from object to non iterable:\n"; @@ -16,8 +16,8 @@ $a->a=1; $a->b=2; $b=&$a; foreach ($a as $v) { - var_dump($v); - $b='x'; + var_dump($v); + $b='x'; } ?> diff --git a/tests/lang/foreachLoop.012.phpt b/tests/lang/foreachLoop.012.phpt index 4d7beeba4f..04908f6c84 100644 --- a/tests/lang/foreachLoop.012.phpt +++ b/tests/lang/foreachLoop.012.phpt @@ -6,29 +6,29 @@ Directly modifying an unreferenced array when foreach'ing over it. define('MAX_LOOPS',5); function withRefValue($elements, $transform) { - echo "\n---( Array with $elements element(s): )---\n"; - //Build array: - for ($i=0; $i<$elements; $i++) { - $a[] = "v.$i"; - } - $counter=0; - - echo "--> State of array before loop:\n"; - var_dump($a); - - echo "--> Do loop:\n"; - foreach ($a as $k=>$v) { - echo " iteration $counter: \$k=$k; \$v=$v\n"; - eval($transform); - $counter++; - if ($counter>MAX_LOOPS) { - echo " ** Stuck in a loop! **\n"; - break; - } - } - - echo "--> State of array after loop:\n"; - var_dump($a); + echo "\n---( Array with $elements element(s): )---\n"; + //Build array: + for ($i=0; $i<$elements; $i++) { + $a[] = "v.$i"; + } + $counter=0; + + echo "--> State of array before loop:\n"; + var_dump($a); + + echo "--> Do loop:\n"; + foreach ($a as $k=>$v) { + echo " iteration $counter: \$k=$k; \$v=$v\n"; + eval($transform); + $counter++; + if ($counter>MAX_LOOPS) { + echo " ** Stuck in a loop! **\n"; + break; + } + } + + echo "--> State of array after loop:\n"; + var_dump($a); } diff --git a/tests/lang/foreachLoop.013.phpt b/tests/lang/foreachLoop.013.phpt index acc197f86f..3a87007f50 100644 --- a/tests/lang/foreachLoop.013.phpt +++ b/tests/lang/foreachLoop.013.phpt @@ -6,29 +6,29 @@ Directly modifying an unreferenced array when foreach'ing over it while using &$ define('MAX_LOOPS',5); function withRefValue($elements, $transform) { - echo "\n---( Array with $elements element(s): )---\n"; - //Build array: - for ($i=0; $i<$elements; $i++) { - $a[] = "v.$i"; - } - $counter=0; - - echo "--> State of array before loop:\n"; - var_dump($a); - - echo "--> Do loop:\n"; - foreach ($a as $k=>&$v) { - echo " iteration $counter: \$k=$k; \$v=$v\n"; - eval($transform); - $counter++; - if ($counter>MAX_LOOPS) { - echo " ** Stuck in a loop! **\n"; - break; - } - } - - echo "--> State of array after loop:\n"; - var_dump($a); + echo "\n---( Array with $elements element(s): )---\n"; + //Build array: + for ($i=0; $i<$elements; $i++) { + $a[] = "v.$i"; + } + $counter=0; + + echo "--> State of array before loop:\n"; + var_dump($a); + + echo "--> Do loop:\n"; + foreach ($a as $k=>&$v) { + echo " iteration $counter: \$k=$k; \$v=$v\n"; + eval($transform); + $counter++; + if ($counter>MAX_LOOPS) { + echo " ** Stuck in a loop! **\n"; + break; + } + } + + echo "--> State of array after loop:\n"; + var_dump($a); } diff --git a/tests/lang/foreachLoop.014.phpt b/tests/lang/foreachLoop.014.phpt index 9db3470e9c..10bf6fba03 100644 --- a/tests/lang/foreachLoop.014.phpt +++ b/tests/lang/foreachLoop.014.phpt @@ -6,31 +6,31 @@ Directly modifying a REFERENCED array when foreach'ing over it. define('MAX_LOOPS',5); function withRefValue($elements, $transform) { - echo "\n---( Array with $elements element(s): )---\n"; - //Build array: - for ($i=0; $i<$elements; $i++) { - $a[] = "v.$i"; - } - $counter=0; - - $ref = &$a; - - echo "--> State of referenced array before loop:\n"; - var_dump($a); - - echo "--> Do loop:\n"; - foreach ($a as $k=>$v) { - echo " iteration $counter: \$k=$k; \$v=$v\n"; - eval($transform); - $counter++; - if ($counter>MAX_LOOPS) { - echo " ** Stuck in a loop! **\n"; - break; - } - } - - echo "--> State of array after loop:\n"; - var_dump($a); + echo "\n---( Array with $elements element(s): )---\n"; + //Build array: + for ($i=0; $i<$elements; $i++) { + $a[] = "v.$i"; + } + $counter=0; + + $ref = &$a; + + echo "--> State of referenced array before loop:\n"; + var_dump($a); + + echo "--> Do loop:\n"; + foreach ($a as $k=>$v) { + echo " iteration $counter: \$k=$k; \$v=$v\n"; + eval($transform); + $counter++; + if ($counter>MAX_LOOPS) { + echo " ** Stuck in a loop! **\n"; + break; + } + } + + echo "--> State of array after loop:\n"; + var_dump($a); } diff --git a/tests/lang/foreachLoop.015.phpt b/tests/lang/foreachLoop.015.phpt index ef5d030cd0..04cd570212 100644 --- a/tests/lang/foreachLoop.015.phpt +++ b/tests/lang/foreachLoop.015.phpt @@ -6,31 +6,31 @@ Directly modifying a REFERENCED array when foreach'ing over it while using &$val define('MAX_LOOPS',5); function withRefValue($elements, $transform) { - echo "\n---( Array with $elements element(s): )---\n"; - //Build array: - for ($i=0; $i<$elements; $i++) { - $a[] = "v.$i"; - } - $counter=0; - - $ref = &$a; - - echo "--> State of referenced array before loop:\n"; - var_dump($a); - - echo "--> Do loop:\n"; - foreach ($a as $k=>&$v) { - echo " iteration $counter: \$k=$k; \$v=$v\n"; - eval($transform); - $counter++; - if ($counter>MAX_LOOPS) { - echo " ** Stuck in a loop! **\n"; - break; - } - } - - echo "--> State of array after loop:\n"; - var_dump($a); + echo "\n---( Array with $elements element(s): )---\n"; + //Build array: + for ($i=0; $i<$elements; $i++) { + $a[] = "v.$i"; + } + $counter=0; + + $ref = &$a; + + echo "--> State of referenced array before loop:\n"; + var_dump($a); + + echo "--> Do loop:\n"; + foreach ($a as $k=>&$v) { + echo " iteration $counter: \$k=$k; \$v=$v\n"; + eval($transform); + $counter++; + if ($counter>MAX_LOOPS) { + echo " ** Stuck in a loop! **\n"; + break; + } + } + + echo "--> State of array after loop:\n"; + var_dump($a); } diff --git a/tests/lang/foreachLoop.016.phpt b/tests/lang/foreachLoop.016.phpt index 0fc57147d9..a4aa5c13be 100644 --- a/tests/lang/foreachLoop.016.phpt +++ b/tests/lang/foreachLoop.016.phpt @@ -6,7 +6,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so echo "\n" . '$a' . "\n"; $b = $a = array('original'); foreach($a as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -14,7 +14,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so echo "\n" . '${\'a\'}' . "\n"; $b = $a = array('original'); foreach(${'a'} as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -24,7 +24,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so $$a = array('original'); $b = $$a; foreach($$a as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -32,7 +32,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so echo "\n" . '$a[0]' . "\n"; $b = $a[0] = array('original'); foreach($a[0] as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -40,7 +40,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so echo "\n" . '$a[0][0]' . "\n"; $b = $a[0][0] = array('original'); foreach($a[0][0] as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -49,7 +49,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so $a = new stdClass; $b = $a->b = array('original'); foreach($a->b as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -59,7 +59,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so $a->b = new stdClass; $b = $a->b->c = array('original'); foreach($a->b as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -68,7 +68,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so $a = new stdClass; $b = $a->b[0] = array('original'); foreach($a->b[0] as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -77,7 +77,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so $a = new stdClass; $b = $a->b[0][0] = array('original'); foreach($a->b[0][0] as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -87,20 +87,20 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so $a->b[0] = new stdClass; $b = $a->b[0]->c = array('original'); foreach($a->b[0]->c as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); class C { - public static $a; + public static $a; } echo "\n" . 'C::$a' . "\n"; C::$a = array('original'); $b = C::$a; foreach(C::$a as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); @@ -109,7 +109,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so C::$a[0] = array('original'); $b = C::$a[0]; foreach(C::$a[0] as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset(C::$a[0], $b); @@ -119,7 +119,7 @@ Ensure foreach splits the iterated entity from its cow reference set, for all so C::$a[0]->b = array('original'); $b = C::$a[0]->b; foreach(C::$a[0]->b as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset(C::$a[0]->b, $b); diff --git a/tests/lang/foreachLoopIterator.001.phpt b/tests/lang/foreachLoopIterator.001.phpt index a4fed4cfa2..88254558ca 100644 --- a/tests/lang/foreachLoopIterator.001.phpt +++ b/tests/lang/foreachLoopIterator.001.phpt @@ -4,38 +4,38 @@ foreach with Iterator. <?php class MealIterator implements Iterator { - private $pos=0; - private $myContent=array("breakfast", "lunch", "dinner"); - - public function valid() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->pos<3; - } - - public function next() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->myContent[$this->pos++]; - } - - public function rewind() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - $this->pos=0; - } - - public function current() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->myContent[$this->pos]; - } - - public function key() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return "meal " . $this->pos; - } + private $pos=0; + private $myContent=array("breakfast", "lunch", "dinner"); + + public function valid() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->pos<3; + } + + public function next() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos++]; + } + + public function rewind() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos=0; + } + + public function current() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos]; + } + + public function key() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return "meal " . $this->pos; + } } @@ -44,7 +44,7 @@ var_dump($f); echo "-----( Simple iteration: )-----\n"; foreach ($f as $k=>$v) { - echo "$k => $v\n"; + echo "$k => $v\n"; } $f->rewind(); @@ -54,13 +54,13 @@ $indent = " "; echo "\n\n\n-----( Nested iteration: )-----\n"; $count=1; foreach ($f as $k=>$v) { - echo "\nTop level " . $count++ . ": \n"; - echo "$k => $v\n"; - $indent = " "; - foreach ($f as $k=>$v) { - echo " $k => $v\n"; - } - $indent = " "; + echo "\nTop level " . $count++ . ": \n"; + echo "$k => $v\n"; + $indent = " "; + foreach ($f as $k=>$v) { + echo " $k => $v\n"; + } + $indent = " "; } diff --git a/tests/lang/foreachLoopIterator.002.phpt b/tests/lang/foreachLoopIterator.002.phpt index fe38145c3b..dc0533be05 100644 --- a/tests/lang/foreachLoopIterator.002.phpt +++ b/tests/lang/foreachLoopIterator.002.phpt @@ -4,17 +4,17 @@ foreach with iterator and &$value reference <?php class MyIterator implements Iterator { - public function valid() { return true; } - public function next() { } - public function rewind() { } - public function current() { } - public function key() { } + public function valid() { return true; } + public function next() { } + public function rewind() { } + public function current() { } + public function key() { } } $f = new MyIterator; echo "-----( Try to iterate with &\$value: )-----\n"; foreach ($f as $k=>&$v) { - echo "$k => $v\n"; + echo "$k => $v\n"; } ?> diff --git a/tests/lang/foreachLoopIteratorAggregate.001.phpt b/tests/lang/foreachLoopIteratorAggregate.001.phpt index e0d55e6955..2920d0aaca 100644 --- a/tests/lang/foreachLoopIteratorAggregate.001.phpt +++ b/tests/lang/foreachLoopIteratorAggregate.001.phpt @@ -3,100 +3,100 @@ foreach with iteratorAggregate --FILE-- <?php class EnglishMealIterator implements Iterator { - private $pos=0; - private $myContent=array("breakfast", "dinner", "tea"); + private $pos=0; + private $myContent=array("breakfast", "dinner", "tea"); - public function valid() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->pos < count($this->myContent); - } + public function valid() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->pos < count($this->myContent); + } - public function next() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - $this->pos++; - } + public function next() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos++; + } - public function rewind() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - $this->pos=0; - } + public function rewind() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos=0; + } - public function current() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->myContent[$this->pos]; - } + public function current() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos]; + } - public function key() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return "meal " . $this->pos; - } + public function key() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return "meal " . $this->pos; + } } class FrenchMealIterator implements Iterator { - private $pos=0; - private $myContent=array("petit dejeuner", "dejeuner", "gouter", "dinner"); + private $pos=0; + private $myContent=array("petit dejeuner", "dejeuner", "gouter", "dinner"); - public function valid() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->pos < count($this->myContent); - } + public function valid() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->pos < count($this->myContent); + } - public function next() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - $this->pos++; - } + public function next() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos++; + } - public function rewind() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - $this->pos=0; - } + public function rewind() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos=0; + } - public function current() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->myContent[$this->pos]; - } + public function current() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos]; + } - public function key() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return "meal " . $this->pos; - } + public function key() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return "meal " . $this->pos; + } } Class EuropeanMeals implements IteratorAggregate { - private $storedEnglishMealIterator; - private $storedFrenchMealIterator; + private $storedEnglishMealIterator; + private $storedFrenchMealIterator; - public function __construct() { - $this->storedEnglishMealIterator = new EnglishMealIterator; - $this->storedFrenchMealIterator = new FrenchMealIterator; - } + public function __construct() { + $this->storedEnglishMealIterator = new EnglishMealIterator; + $this->storedFrenchMealIterator = new FrenchMealIterator; + } - public function getIterator() { - global $indent; - echo "$indent--> " . __METHOD__ . "\n"; + public function getIterator() { + global $indent; + echo "$indent--> " . __METHOD__ . "\n"; - //Alternate between English and French meals - static $i = 0; - if ($i++%2 == 0) { - return $this->storedEnglishMealIterator; - } else { - return $this->storedFrenchMealIterator; - } - } + //Alternate between English and French meals + static $i = 0; + if ($i++%2 == 0) { + return $this->storedEnglishMealIterator; + } else { + return $this->storedFrenchMealIterator; + } + } } @@ -105,11 +105,11 @@ var_dump($f); echo "-----( Simple iteration 1: )-----\n"; foreach ($f as $k=>$v) { - echo "$k => $v\n"; + echo "$k => $v\n"; } echo "-----( Simple iteration 2: )-----\n"; foreach ($f as $k=>$v) { - echo "$k => $v\n"; + echo "$k => $v\n"; } @@ -117,13 +117,13 @@ $indent = " "; echo "\n\n\n-----( Nested iteration: )-----\n"; $count=1; foreach ($f as $k=>$v) { - echo "\nTop level " . $count++ . ": \n"; - echo "$k => $v\n"; - $indent = " "; - foreach ($f as $k=>$v) { - echo " $k => $v\n"; - } - $indent = " "; + echo "\nTop level " . $count++ . ": \n"; + echo "$k => $v\n"; + $indent = " "; + foreach ($f as $k=>$v) { + echo " $k => $v\n"; + } + $indent = " "; } diff --git a/tests/lang/foreachLoopIteratorAggregate.002.phpt b/tests/lang/foreachLoopIteratorAggregate.002.phpt index 7ce50ab35d..382adbe2d5 100644 --- a/tests/lang/foreachLoopIteratorAggregate.002.phpt +++ b/tests/lang/foreachLoopIteratorAggregate.002.phpt @@ -4,38 +4,38 @@ IteratorAggregate::getIterator bad return type <?php class bad1 implements IteratorAggregate { - function getIterator() { - return null; - } + function getIterator() { + return null; + } } class bad2 implements IteratorAggregate { - function getIterator() { - return new stdClass; - } + function getIterator() { + return new stdClass; + } } class bad3 implements IteratorAggregate { - function getIterator() { - return 1; - } + function getIterator() { + return 1; + } } class bad4 implements IteratorAggregate { - function getIterator() { - return array(1,2,3); - } + function getIterator() { + return array(1,2,3); + } } function f($className) { - try { - foreach (new $className as $k=>$v) { - echo "$k => $v\n"; - } - } catch (Exception $e) { - echo $e->getLine() . ": " . $e->getMessage() ."\n"; - } + try { + foreach (new $className as $k=>$v) { + echo "$k => $v\n"; + } + } catch (Exception $e) { + echo $e->getLine() . ": " . $e->getMessage() ."\n"; + } } f("bad1"); diff --git a/tests/lang/foreachLoopIteratorAggregate.003.phpt b/tests/lang/foreachLoopIteratorAggregate.003.phpt index 7e96b104e4..cf9d2f73f4 100644 --- a/tests/lang/foreachLoopIteratorAggregate.003.phpt +++ b/tests/lang/foreachLoopIteratorAggregate.003.phpt @@ -3,72 +3,72 @@ foreach with nested iteratorAggregates --FILE-- <?php class EnglishMealIterator implements Iterator { - private $pos=0; - private $myContent=array("breakfast", "dinner", "tea"); + private $pos=0; + private $myContent=array("breakfast", "dinner", "tea"); - public function valid() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->pos<3; - } + public function valid() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->pos<3; + } - public function next() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->myContent[$this->pos++]; - } + public function next() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos++]; + } - public function rewind() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - $this->pos=0; - } + public function rewind() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos=0; + } - public function current() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return $this->myContent[$this->pos]; - } + public function current() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos]; + } - public function key() { - global $indent; - echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; - return "meal " . $this->pos; - } + public function key() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return "meal " . $this->pos; + } } class A1 implements IteratorAggregate { - function getIterator() { - return new EnglishMealIterator; - } + function getIterator() { + return new EnglishMealIterator; + } } class A2 implements IteratorAggregate { - function getIterator() { - return new A1; - } + function getIterator() { + return new A1; + } } class A3 implements IteratorAggregate { - function getIterator() { - return new A2; - } + function getIterator() { + return new A2; + } } echo "\n-----( A1: )-----\n"; foreach (new A1 as $k=>$v) { - echo "$k => $v\n"; + echo "$k => $v\n"; } echo "\n-----( A2: )-----\n"; foreach (new A2 as $k=>$v) { - echo "$k => $v\n"; + echo "$k => $v\n"; } echo "\n-----( A3: )-----\n"; foreach (new A3 as $k=>$v) { - echo "$k => $v\n"; + echo "$k => $v\n"; } ?> diff --git a/tests/lang/foreachLoopIteratorAggregate.004.phpt b/tests/lang/foreachLoopIteratorAggregate.004.phpt index 9c453bde21..0e46fec7f0 100644 --- a/tests/lang/foreachLoopIteratorAggregate.004.phpt +++ b/tests/lang/foreachLoopIteratorAggregate.004.phpt @@ -4,62 +4,62 @@ Duplicate of zend test tests/classes/iterators_002.phpt without expected output <?php class c_iter implements Iterator { - private $obj; - private $num = 0; + private $obj; + private $num = 0; - function __construct($obj) { - echo __METHOD__ . "\n"; - $this->obj = $obj; - } - function rewind() { - echo __METHOD__ . "\n"; - $this->num = 0; - } - function valid() { - $more = $this->num < $this->obj->max; - echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; - return $more; - } - function current() { - echo __METHOD__ . "\n"; - return $this->num; - } - function next() { - echo __METHOD__ . "\n"; - $this->num++; - } - function key() { - echo __METHOD__ . "\n"; - switch($this->num) { - case 0: return "1st"; - case 1: return "2nd"; - case 2: return "3rd"; - default: return "???"; - } - } - function __destruct() { - } + function __construct($obj) { + echo __METHOD__ . "\n"; + $this->obj = $obj; + } + function rewind() { + echo __METHOD__ . "\n"; + $this->num = 0; + } + function valid() { + $more = $this->num < $this->obj->max; + echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; + return $more; + } + function current() { + echo __METHOD__ . "\n"; + return $this->num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function key() { + echo __METHOD__ . "\n"; + switch($this->num) { + case 0: return "1st"; + case 1: return "2nd"; + case 2: return "3rd"; + default: return "???"; + } + } + function __destruct() { + } } class c implements IteratorAggregate { - public $max = 3; + public $max = 3; - function getIterator() { - echo __METHOD__ . "\n"; - return new c_iter($this); - } - function __destruct() { - } + function getIterator() { + echo __METHOD__ . "\n"; + return new c_iter($this); + } + function __destruct() { + } } $t = new c(); foreach($t as $k => $v) { - foreach($t as $w) { - echo "double:$v:$w\n"; - break; - } + foreach($t as $w) { + echo "double:$v:$w\n"; + break; + } } unset($t); diff --git a/tests/lang/foreachLoopObjects.001.phpt b/tests/lang/foreachLoopObjects.001.phpt index 7e8a40438e..5526d498a3 100644 --- a/tests/lang/foreachLoopObjects.001.phpt +++ b/tests/lang/foreachLoopObjects.001.phpt @@ -4,21 +4,21 @@ Foreach loop on objects - basic loop with just value and key => value. <?php class C { - public $a = "Original a"; - public $b = "Original b"; - public $c = "Original c"; - protected $d = "Original d"; - private $e = "Original e"; + public $a = "Original a"; + public $b = "Original b"; + public $c = "Original c"; + protected $d = "Original d"; + private $e = "Original e"; } echo "\n\nSimple loop.\n"; $obj = new C; foreach ($obj as $v) { - var_dump($v); + var_dump($v); } foreach ($obj as $k => $v) { - var_dump($k, $v); + var_dump($k, $v); } echo "\nCheck key and value after the loop.\n"; var_dump($k, $v); @@ -26,10 +26,10 @@ var_dump($k, $v); echo "\n\nObject instantiated inside loop.\n"; foreach (new C as $v) { - var_dump($v); + var_dump($v); } foreach (new C as $k => $v) { - var_dump($k, $v); + var_dump($k, $v); } echo "\nCheck key and value after the loop.\n"; var_dump($k, $v); diff --git a/tests/lang/foreachLoopObjects.002.phpt b/tests/lang/foreachLoopObjects.002.phpt index 618a8cd55f..46bd6f8a37 100644 --- a/tests/lang/foreachLoopObjects.002.phpt +++ b/tests/lang/foreachLoopObjects.002.phpt @@ -4,82 +4,82 @@ Foreach loop tests - visibility. <?php class C { - public $a = "Original a"; - public $b = "Original b"; - public $c = "Original c"; - protected $d = "Original d"; - private $e = "Original e"; - - function doForEachC() { - echo "in C::doForEachC\n"; - foreach ($this as $k=>&$v) { - var_dump($v); - $v="changed.$k"; - } - } - - static function doForEach($obj) { - echo "in C::doForEach\n"; - foreach ($obj as $k=>&$v) { - var_dump($v); - $v="changed.$k"; - } - } - - function doForEachOnThis() { - echo "in C::doForEachOnThis\n"; - foreach ($this as $k=>&$v) { - var_dump($v); - $v="changed.$k"; - } - } + public $a = "Original a"; + public $b = "Original b"; + public $c = "Original c"; + protected $d = "Original d"; + private $e = "Original e"; + + function doForEachC() { + echo "in C::doForEachC\n"; + foreach ($this as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } + + static function doForEach($obj) { + echo "in C::doForEach\n"; + foreach ($obj as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } + + function doForEachOnThis() { + echo "in C::doForEachOnThis\n"; + foreach ($this as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } } class D extends C { - private $f = "Original f"; - protected $g = "Original g"; - - static function doForEach($obj) { - echo "in D::doForEach\n"; - foreach ($obj as $k=>&$v) { - var_dump($v); - $v="changed.$k"; - } - } - - function doForEachOnThis() { - echo "in D::doForEachOnThis\n"; - foreach ($this as $k=>&$v) { - var_dump($v); - $v="changed.$k"; - } - } + private $f = "Original f"; + protected $g = "Original g"; + + static function doForEach($obj) { + echo "in D::doForEach\n"; + foreach ($obj as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } + + function doForEachOnThis() { + echo "in D::doForEachOnThis\n"; + foreach ($this as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } } class E extends D { - public $a = "Overridden a"; - public $b = "Overridden b"; - public $c = "Overridden c"; - protected $d = "Overridden d"; - private $e = "Overridden e"; - - static function doForEach($obj) { - echo "in E::doForEach\n"; - foreach ($obj as $k=>&$v) { - var_dump($v); - $v="changed.$k"; - } - } - - function doForEachOnThis() { - echo "in E::doForEachOnThis\n"; - foreach ($this as $k=>&$v) { - var_dump($v); - $v="changed.$k"; - } - } + public $a = "Overridden a"; + public $b = "Overridden b"; + public $c = "Overridden c"; + protected $d = "Overridden d"; + private $e = "Overridden e"; + + static function doForEach($obj) { + echo "in E::doForEach\n"; + foreach ($obj as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } + + function doForEachOnThis() { + echo "in E::doForEachOnThis\n"; + foreach ($this as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } } echo "\n\nIterate over various generations from within overridden methods:\n"; @@ -147,22 +147,22 @@ echo "\n\nIterate over various generations from outside the object:\n"; echo "\n--> Using instance of C:\n"; $myC = new C; foreach ($myC as $k=>&$v) { - var_dump($v); - $v="changed.$k"; + var_dump($v); + $v="changed.$k"; } var_dump($myC); echo "\n--> Using instance of D:\n"; $myD = new D; foreach ($myD as $k=>&$v) { - var_dump($v); - $v="changed.$k"; + var_dump($v); + $v="changed.$k"; } var_dump($myD); echo "\n--> Using instance of E:\n"; $myE = new E; foreach ($myE as $k=>&$v) { - var_dump($v); - $v="changed.$k"; + var_dump($v); + $v="changed.$k"; } var_dump($myE); ?> diff --git a/tests/lang/foreachLoopObjects.003.phpt b/tests/lang/foreachLoopObjects.003.phpt index c3abbf2250..e70d6a386d 100644 --- a/tests/lang/foreachLoopObjects.003.phpt +++ b/tests/lang/foreachLoopObjects.003.phpt @@ -4,25 +4,25 @@ Foreach loop tests - modifying the object during the loop. <?php class C { - public $a = "Original a"; - public $b = "Original b"; - public $c = "Original c"; - protected $d = "Original d"; - private $e = "Original e"; + public $a = "Original a"; + public $b = "Original b"; + public $c = "Original c"; + protected $d = "Original d"; + private $e = "Original e"; } echo "\nDirectly changing object values.\n"; $obj = new C; foreach ($obj as $k=>$v) { - $obj->$k="changed.$k"; - var_dump($v); + $obj->$k="changed.$k"; + var_dump($v); } var_dump($obj); echo "\nModifying the foreach \$value.\n"; $obj = new C; foreach ($obj as $k=>$v) { - $v="changed.$k"; + $v="changed.$k"; } var_dump($obj); @@ -30,7 +30,7 @@ var_dump($obj); echo "\nModifying the foreach &\$value.\n"; $obj = new C; foreach ($obj as $k=>&$v) { - $v="changed.$k"; + $v="changed.$k"; } var_dump($obj); @@ -38,13 +38,13 @@ echo "\nAdding properties to an an object.\n"; $obj = new C; $counter=0; foreach ($obj as $v) { - $newPropName = "new$counter"; - $obj->$newPropName = "Added property $counter"; + $newPropName = "new$counter"; + $obj->$newPropName = "Added property $counter"; if ($counter++>10) { - echo "Loop detected\n"; - break; + echo "Loop detected\n"; + break; } - var_dump($v); + var_dump($v); } var_dump($obj); @@ -52,33 +52,33 @@ echo "\nAdding properties to an an object, using &\$value.\n"; $obj = new C; $counter=0; foreach ($obj as &$v) { - $newPropName = "new$counter"; - $obj->$newPropName = "Added property $counter"; + $newPropName = "new$counter"; + $obj->$newPropName = "Added property $counter"; if ($counter++>10) { - echo "Loop detected\n"; - break; + echo "Loop detected\n"; + break; } - var_dump($v); + var_dump($v); } var_dump($obj); echo "\nRemoving properties from an object.\n"; $obj = new C; foreach ($obj as $v) { - unset($obj->a); - unset($obj->b); - unset($obj->c); - var_dump($v); + unset($obj->a); + unset($obj->b); + unset($obj->c); + var_dump($v); } var_dump($obj); echo "\nRemoving properties from an object, using &\$value.\n"; $obj = new C; foreach ($obj as &$v) { - unset($obj->a); - unset($obj->b); - unset($obj->c); - var_dump($v); + unset($obj->a); + unset($obj->b); + unset($obj->c); + var_dump($v); } var_dump($obj); diff --git a/tests/lang/foreachLoopObjects.004.phpt b/tests/lang/foreachLoopObjects.004.phpt index 9eea3e2084..613037f2ca 100644 --- a/tests/lang/foreachLoopObjects.004.phpt +++ b/tests/lang/foreachLoopObjects.004.phpt @@ -4,25 +4,25 @@ Foreach loop tests - Removing the current element from an iterated object. <?php class C { - public $a = "Original a"; - public $b = "Original b"; - public $c = "Original c"; - public $d = "Original d"; - public $e = "Original e"; + public $a = "Original a"; + public $b = "Original b"; + public $c = "Original c"; + public $d = "Original d"; + public $e = "Original e"; } echo "\nRemoving the current element from an iterated object.\n"; $obj = new C; $count=0; foreach ($obj as $v) { - if ($v==$obj->b) { - unset($obj->b); - } - var_dump($v); - if (++$count>10) { - echo "Loop detected.\n"; - break; - } + if ($v==$obj->b) { + unset($obj->b); + } + var_dump($v); + if (++$count>10) { + echo "Loop detected.\n"; + break; + } } var_dump($obj); diff --git a/tests/lang/foreachLoopObjects.005.phpt b/tests/lang/foreachLoopObjects.005.phpt index 8d6a4d5dc3..cc7f64b855 100644 --- a/tests/lang/foreachLoopObjects.005.phpt +++ b/tests/lang/foreachLoopObjects.005.phpt @@ -4,39 +4,39 @@ Foreach loop tests - removing properties before and after the current property d <?php class C { - public $a = "Original a"; - public $b = "Original b"; - public $c = "Original c"; - public $d = "Original d"; - public $e = "Original e"; + public $a = "Original a"; + public $b = "Original b"; + public $c = "Original c"; + public $d = "Original d"; + public $e = "Original e"; } echo "\nRemoving properties before the current element from an iterated object.\n"; $obj = new C; $count=0; foreach ($obj as $v) { - if ($v==$obj->a) { - unset($obj->c); - } - var_dump($v); - if (++$count>10) { - echo "Loop detected.\n"; - break; - } + if ($v==$obj->a) { + unset($obj->c); + } + var_dump($v); + if (++$count>10) { + echo "Loop detected.\n"; + break; + } } var_dump($obj); echo "\nRemoving properties before the current element from an iterated object.\n"; $obj = new C; foreach ($obj as $v) { - if ($v==$obj->b) { - unset($obj->a); - } - var_dump($v); - if (++$count>10) { - echo "Loop detected.\n"; - break; - } + if ($v==$obj->b) { + unset($obj->a); + } + var_dump($v); + if (++$count>10) { + echo "Loop detected.\n"; + break; + } } var_dump($obj); diff --git a/tests/lang/foreachLoopObjects.006.phpt b/tests/lang/foreachLoopObjects.006.phpt index 3e9b73542a..0d8c3f96a9 100644 --- a/tests/lang/foreachLoopObjects.006.phpt +++ b/tests/lang/foreachLoopObjects.006.phpt @@ -4,11 +4,11 @@ Foreach loop tests - substituting the entire iterated entity during the loop. <?php class C { - public $a = "Original a"; - public $b = "Original b"; - public $c = "Original c"; - public $d = "Original d"; - public $e = "Original e"; + public $a = "Original a"; + public $b = "Original b"; + public $c = "Original c"; + public $d = "Original d"; + public $e = "Original e"; } echo "\nSubstituting the iterated object for a different object.\n"; @@ -23,14 +23,14 @@ $obj2->f = "new f"; $ref = &$obj; $count=0; foreach ($obj as $v) { - var_dump($v); - if ($v==$obj->b) { - $ref=$obj2; - } - if (++$count>10) { - echo "Loop detected.\n"; - break; - } + var_dump($v); + if ($v==$obj->b) { + $ref=$obj2; + } + if (++$count>10) { + echo "Loop detected.\n"; + break; + } } var_dump($obj); @@ -40,14 +40,14 @@ $a = array(1,2,3,4,5,6,7,8); $ref = &$obj; $count=0; foreach ($obj as $v) { - var_dump($v); - if ($v==="Original b") { - $ref=$a; - } - if (++$count>10) { - echo "Loop detected.\n"; - break; - } + var_dump($v); + if ($v==="Original b") { + $ref=$a; + } + if (++$count>10) { + echo "Loop detected.\n"; + break; + } } var_dump($obj); @@ -57,14 +57,14 @@ $obj = new C; $ref = &$a; $count=0; foreach ($a as $v) { - var_dump($v); - if ($v===2) { - $ref=$obj; - } - if (++$count>10) { - echo "Loop detected.\n"; - break; - } + var_dump($v); + if ($v===2) { + $ref=$obj; + } + if (++$count>10) { + echo "Loop detected.\n"; + break; + } } var_dump($obj); diff --git a/tests/lang/foreach_with_references_001.phpt b/tests/lang/foreach_with_references_001.phpt index a1f7c33600..0a7df06502 100644 --- a/tests/lang/foreach_with_references_001.phpt +++ b/tests/lang/foreach_with_references_001.phpt @@ -6,13 +6,13 @@ foreach() with references $arr = array(1 => "one", 2 => "two", 3 => "three"); foreach($arr as $key => $val) { - $val = $key; + $val = $key; } print_r($arr); foreach($arr as $key => &$val) { - $val = $key; + $val = $key; } print_r($arr); diff --git a/tests/lang/func_get_arg.002.phpt b/tests/lang/func_get_arg.002.phpt index 5b80ec1773..3375f3e3c9 100644 --- a/tests/lang/func_get_arg.002.phpt +++ b/tests/lang/func_get_arg.002.phpt @@ -5,10 +5,10 @@ func_get_arg with variable number of args function foo($a) { - $b = func_get_arg(1); - var_dump($b); - $b++; - var_dump(func_get_arg(1)); + $b = func_get_arg(1); + var_dump($b); + $b++; + var_dump(func_get_arg(1)); } foo(2, 3); diff --git a/tests/lang/func_get_arg.004.phpt b/tests/lang/func_get_arg.004.phpt index 0a4547ec18..6d0ab20a4e 100644 --- a/tests/lang/func_get_arg.004.phpt +++ b/tests/lang/func_get_arg.004.phpt @@ -5,7 +5,7 @@ func_get_arg on non-existent arg function foo($a) { - var_dump(func_get_arg(2)); + var_dump(func_get_arg(2)); } foo(2, 3); echo "\n"; diff --git a/tests/lang/func_get_arg.005.phpt b/tests/lang/func_get_arg.005.phpt index 5dd5468721..4c4b1792f4 100644 --- a/tests/lang/func_get_arg.005.phpt +++ b/tests/lang/func_get_arg.005.phpt @@ -4,10 +4,10 @@ During the call, the original variable is updated. This should not affect func_g --FILE-- <?php function refVal($x) { - global $a; - $a = 'changed.a'; - var_dump($x); - var_dump(func_get_arg(0)); + global $a; + $a = 'changed.a'; + var_dump($x); + var_dump(func_get_arg(0)); } $a = "original.a"; diff --git a/tests/lang/func_get_args.001.phpt b/tests/lang/func_get_args.001.phpt index a17cfb3d19..9e64921af5 100644 --- a/tests/lang/func_get_args.001.phpt +++ b/tests/lang/func_get_args.001.phpt @@ -5,7 +5,7 @@ func_get_args with no args function foo() { - var_dump(func_get_args()); + var_dump(func_get_args()); } foo(); diff --git a/tests/lang/func_get_args.002.phpt b/tests/lang/func_get_args.002.phpt index f516893418..60bbb9a40f 100644 --- a/tests/lang/func_get_args.002.phpt +++ b/tests/lang/func_get_args.002.phpt @@ -5,7 +5,7 @@ func_get_args with variable number of args function foo($a) { - var_dump(func_get_args()); + var_dump(func_get_args()); } foo(1, 2, 3); diff --git a/tests/lang/func_get_args.004.phpt b/tests/lang/func_get_args.004.phpt index 6e98c763b2..9e72e519f9 100644 --- a/tests/lang/func_get_args.004.phpt +++ b/tests/lang/func_get_args.004.phpt @@ -3,19 +3,19 @@ Pass same variable by ref and by value (PHP7). --FILE-- <?php function valRef($x, &$y) { - var_dump($x, $y); - var_dump(func_get_args()); - $x = 'changed.x'; - $y = 'changed.y'; - var_dump(func_get_args()); + var_dump($x, $y); + var_dump(func_get_args()); + $x = 'changed.x'; + $y = 'changed.y'; + var_dump(func_get_args()); } function refVal(&$x, $y) { - var_dump($x, $y); - var_dump(func_get_args()); - $x = 'changed.x'; - $y = 'changed.y'; - var_dump(func_get_args()); + var_dump($x, $y); + var_dump(func_get_args()); + $x = 'changed.x'; + $y = 'changed.y'; + var_dump(func_get_args()); } diff --git a/tests/lang/func_num_args.001.phpt b/tests/lang/func_num_args.001.phpt index 5d7a91d25e..dd7f13681f 100644 --- a/tests/lang/func_num_args.001.phpt +++ b/tests/lang/func_num_args.001.phpt @@ -5,7 +5,7 @@ func_num_args with no args function foo() { - var_dump(func_num_args()); + var_dump(func_num_args()); } foo(); diff --git a/tests/lang/func_num_args.002.phpt b/tests/lang/func_num_args.002.phpt index 8586fad735..9b00efa535 100644 --- a/tests/lang/func_num_args.002.phpt +++ b/tests/lang/func_num_args.002.phpt @@ -5,7 +5,7 @@ func_num_args with variable number of args function foo($a) { - var_dump(func_num_args()); + var_dump(func_num_args()); } foo(1, 2, 3); diff --git a/tests/lang/func_num_args.004.phpt b/tests/lang/func_num_args.004.phpt index 7924a85a68..dd8b7047fb 100644 --- a/tests/lang/func_num_args.004.phpt +++ b/tests/lang/func_num_args.004.phpt @@ -3,19 +3,19 @@ Pass same variable by ref and by value. --FILE-- <?php function valRef($x, &$y) { - var_dump($x, $y); - var_dump(func_num_args()); - $x = 'changed.x'; - $y = 'changed.y'; - var_dump(func_num_args()); + var_dump($x, $y); + var_dump(func_num_args()); + $x = 'changed.x'; + $y = 'changed.y'; + var_dump(func_num_args()); } function refVal(&$x, $y) { - var_dump($x, $y); - var_dump(func_num_args()); - $x = 'changed.x'; - $y = 'changed.y'; - var_dump(func_num_args()); + var_dump($x, $y); + var_dump(func_num_args()); + $x = 'changed.x'; + $y = 'changed.y'; + var_dump(func_num_args()); } diff --git a/tests/lang/operators/add_basiclong_64bit.phpt b/tests/lang/operators/add_basiclong_64bit.phpt index a4cdcc70dc..6e09f49eb9 100644 --- a/tests/lang/operators/add_basiclong_64bit.phpt +++ b/tests/lang/operators/add_basiclong_64bit.phpt @@ -24,14 +24,14 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal + $otherVal ---\n"; + echo "--- testing: $longVal + $otherVal ---\n"; var_dump($longVal+$otherVal); } } foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal + $longVal ---\n"; + echo "--- testing: $otherVal + $longVal ---\n"; var_dump($otherVal+$longVal); } } diff --git a/tests/lang/operators/add_variationStr.phpt b/tests/lang/operators/add_variationStr.phpt index b626c21841..cea37a0a26 100644 --- a/tests/lang/operators/add_variationStr.phpt +++ b/tests/lang/operators/add_variationStr.phpt @@ -12,7 +12,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' + '$otherVal' ---\n"; + echo "--- testing: '$strVal' + '$otherVal' ---\n"; var_dump($strVal+$otherVal); } } diff --git a/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt b/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt index ba7ea966ea..22982c7bc3 100644 --- a/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt @@ -24,14 +24,14 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal & $otherVal ---\n"; + echo "--- testing: $longVal & $otherVal ---\n"; var_dump($longVal&$otherVal); } } foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal & $longVal ---\n"; + echo "--- testing: $otherVal & $longVal ---\n"; var_dump($otherVal&$longVal); } } diff --git a/tests/lang/operators/bitwiseAnd_variationStr.phpt b/tests/lang/operators/bitwiseAnd_variationStr.phpt index 23db7999fe..ed3d55f714 100644 --- a/tests/lang/operators/bitwiseAnd_variationStr.phpt +++ b/tests/lang/operators/bitwiseAnd_variationStr.phpt @@ -12,7 +12,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' & '$otherVal' ---\n"; + echo "--- testing: '$strVal' & '$otherVal' ---\n"; var_dump(bin2hex($strVal&$otherVal)); } } diff --git a/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt b/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt index 5ae2075e69..50b39181b1 100644 --- a/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt @@ -24,14 +24,14 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal | $otherVal ---\n"; + echo "--- testing: $longVal | $otherVal ---\n"; var_dump($longVal|$otherVal); } } foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal | $longVal ---\n"; + echo "--- testing: $otherVal | $longVal ---\n"; var_dump($otherVal|$longVal); } } diff --git a/tests/lang/operators/bitwiseOr_variationStr.phpt b/tests/lang/operators/bitwiseOr_variationStr.phpt index dfec4b8ae6..f11b8d8df6 100644 --- a/tests/lang/operators/bitwiseOr_variationStr.phpt +++ b/tests/lang/operators/bitwiseOr_variationStr.phpt @@ -12,7 +12,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' | '$otherVal' ---\n"; + echo "--- testing: '$strVal' | '$otherVal' ---\n"; var_dump(bin2hex($strVal|$otherVal)); } } diff --git a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt index 8978cee6b7..250813fca3 100644 --- a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt @@ -24,8 +24,8 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal << $otherVal ---\n"; - try { + echo "--- testing: $longVal << $otherVal ---\n"; + try { var_dump($longVal<<$otherVal); } catch (ArithmeticError $e) { echo "Exception: " . $e->getMessage() . "\n"; @@ -35,8 +35,8 @@ foreach ($longVals as $longVal) { foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal << $longVal ---\n"; - try { + echo "--- testing: $otherVal << $longVal ---\n"; + try { var_dump($otherVal<<$longVal); } catch (ArithmeticError $e) { echo "Exception: " . $e->getMessage() . "\n"; diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt index e9efd388f7..49de21f64b 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt @@ -12,7 +12,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' << '$otherVal' ---\n"; + echo "--- testing: '$strVal' << '$otherVal' ---\n"; try { var_dump($strVal<<$otherVal); } catch (Throwable $e) { diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt index 8a747d12bc..b3ca624abb 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt @@ -16,7 +16,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' << '$otherVal' ---\n"; + echo "--- testing: '$strVal' << '$otherVal' ---\n"; try { var_dump($strVal<<$otherVal); } catch (ArithmeticError $e) { diff --git a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt index 88f9ca59f8..75be6afae2 100644 --- a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt @@ -24,7 +24,7 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal >> $otherVal ---\n"; + echo "--- testing: $longVal >> $otherVal ---\n"; try { var_dump($longVal>>$otherVal); } catch (ArithmeticError $e) { @@ -35,8 +35,8 @@ foreach ($longVals as $longVal) { foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal >> $longVal ---\n"; - try { + echo "--- testing: $otherVal >> $longVal ---\n"; + try { var_dump($otherVal>>$longVal); } catch (ArithmeticError $e) { echo "Exception: " . $e->getMessage() . "\n"; diff --git a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt index 646b9b4a12..525f951a51 100644 --- a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt +++ b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt @@ -12,8 +12,8 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' >> '$otherVal' ---\n"; - try { + echo "--- testing: '$strVal' >> '$otherVal' ---\n"; + try { var_dump($strVal>>$otherVal); } catch (ArithmeticError $e) { echo "Exception: " . $e->getMessage() . "\n"; diff --git a/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt b/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt index f004feaeb3..0b40e9feed 100644 --- a/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt @@ -24,14 +24,14 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal ^ $otherVal ---\n"; + echo "--- testing: $longVal ^ $otherVal ---\n"; var_dump($longVal^$otherVal); } } foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal ^ $longVal ---\n"; + echo "--- testing: $otherVal ^ $longVal ---\n"; var_dump($otherVal^$longVal); } } diff --git a/tests/lang/operators/bitwiseXor_variationStr.phpt b/tests/lang/operators/bitwiseXor_variationStr.phpt index 654db1c9ef..5a74d124ff 100644 --- a/tests/lang/operators/bitwiseXor_variationStr.phpt +++ b/tests/lang/operators/bitwiseXor_variationStr.phpt @@ -12,7 +12,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' ^ '$otherVal' ---\n"; + echo "--- testing: '$strVal' ^ '$otherVal' ---\n"; var_dump(bin2hex($strVal^$otherVal)); } } diff --git a/tests/lang/operators/coalesce.phpt b/tests/lang/operators/coalesce.phpt index b48d20bab1..7035eac84c 100644 --- a/tests/lang/operators/coalesce.phpt +++ b/tests/lang/operators/coalesce.phpt @@ -10,18 +10,18 @@ $obj = new StdClass; $obj->boo = 7; $arr = [ - 2 => 7, - "foo" => "bar", - "foobar" => NULL, - "qux" => $obj, - "bing" => [ - "bang" - ] + 2 => 7, + "foo" => "bar", + "foobar" => NULL, + "qux" => $obj, + "bing" => [ + "bang" + ] ]; function foobar() { - echo "called\n"; - return ['a']; + echo "called\n"; + return ['a']; } var_dump($nonexistent_variable ?? 3); diff --git a/tests/lang/operators/divide_basiclong_64bit.phpt b/tests/lang/operators/divide_basiclong_64bit.phpt index f86fc7b951..d8c0e60ded 100644 --- a/tests/lang/operators/divide_basiclong_64bit.phpt +++ b/tests/lang/operators/divide_basiclong_64bit.phpt @@ -24,14 +24,14 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal / $otherVal ---\n"; + echo "--- testing: $longVal / $otherVal ---\n"; var_dump($longVal/$otherVal); } } foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal / $longVal ---\n"; + echo "--- testing: $otherVal / $longVal ---\n"; var_dump($otherVal/$longVal); } } diff --git a/tests/lang/operators/divide_variationStr.phpt b/tests/lang/operators/divide_variationStr.phpt index 62fc6c8163..3db09e4e95 100644 --- a/tests/lang/operators/divide_variationStr.phpt +++ b/tests/lang/operators/divide_variationStr.phpt @@ -12,7 +12,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' / '$otherVal' ---\n"; + echo "--- testing: '$strVal' / '$otherVal' ---\n"; var_dump($strVal/$otherVal); } } diff --git a/tests/lang/operators/modulus_basiclong_64bit.phpt b/tests/lang/operators/modulus_basiclong_64bit.phpt index 786d449eb7..34792c2b54 100644 --- a/tests/lang/operators/modulus_basiclong_64bit.phpt +++ b/tests/lang/operators/modulus_basiclong_64bit.phpt @@ -24,9 +24,9 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal % $otherVal ---\n"; - try { - var_dump($longVal%$otherVal); + echo "--- testing: $longVal % $otherVal ---\n"; + try { + var_dump($longVal%$otherVal); } catch (DivisionByZeroError $e) { echo "Exception: " . $e->getMessage() . "\n"; } @@ -35,8 +35,8 @@ foreach ($longVals as $longVal) { foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal % $longVal ---\n"; - try { + echo "--- testing: $otherVal % $longVal ---\n"; + try { var_dump($otherVal%$longVal); } catch (DivisionByZeroError $e) { echo "Exception: " . $e->getMessage() . "\n"; diff --git a/tests/lang/operators/modulus_variationStr.phpt b/tests/lang/operators/modulus_variationStr.phpt index e8ec8613fe..8d31c3ec91 100644 --- a/tests/lang/operators/modulus_variationStr.phpt +++ b/tests/lang/operators/modulus_variationStr.phpt @@ -12,7 +12,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' % '$otherVal' ---\n"; + echo "--- testing: '$strVal' % '$otherVal' ---\n"; try { var_dump($strVal%$otherVal); } catch (DivisionByZeroError $e) { diff --git a/tests/lang/operators/multiply_basiclong_64bit.phpt b/tests/lang/operators/multiply_basiclong_64bit.phpt index 6b2d6e2404..2fbe530bdc 100644 --- a/tests/lang/operators/multiply_basiclong_64bit.phpt +++ b/tests/lang/operators/multiply_basiclong_64bit.phpt @@ -24,14 +24,14 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal * $otherVal ---\n"; + echo "--- testing: $longVal * $otherVal ---\n"; var_dump($longVal*$otherVal); } } foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal * $longVal ---\n"; + echo "--- testing: $otherVal * $longVal ---\n"; var_dump($otherVal*$longVal); } } diff --git a/tests/lang/operators/multiply_variationStr.phpt b/tests/lang/operators/multiply_variationStr.phpt index 33991c8b06..8f33aa2f00 100644 --- a/tests/lang/operators/multiply_variationStr.phpt +++ b/tests/lang/operators/multiply_variationStr.phpt @@ -12,7 +12,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' * '$otherVal' ---\n"; + echo "--- testing: '$strVal' * '$otherVal' ---\n"; var_dump($strVal*$otherVal); } } diff --git a/tests/lang/operators/operator_gt_or_equal_basic.phpt b/tests/lang/operators/operator_gt_or_equal_basic.phpt index de0863aea9..98f7aa543a 100644 --- a/tests/lang/operators/operator_gt_or_equal_basic.phpt +++ b/tests/lang/operators/operator_gt_or_equal_basic.phpt @@ -46,12 +46,12 @@ for ($i = 0; $i < count($toCompare); $i +=3) { } if ($invalid_compares != NULL) { - foreach($invalid_compares as $compareVal) { - if ($typeToTest >= $compareVal) { - echo "FAILED: '$typeToTest' >= '$compareVal'\n"; - $failed = true; - } - } + foreach($invalid_compares as $compareVal) { + if ($typeToTest >= $compareVal) { + echo "FAILED: '$typeToTest' >= '$compareVal'\n"; + $failed = true; + } + } } } diff --git a/tests/lang/operators/operator_lt_or_equal_basic.phpt b/tests/lang/operators/operator_lt_or_equal_basic.phpt index 8bca34e5ca..db09d38776 100644 --- a/tests/lang/operators/operator_lt_or_equal_basic.phpt +++ b/tests/lang/operators/operator_lt_or_equal_basic.phpt @@ -45,12 +45,12 @@ for ($i = 0; $i < count($toCompare); $i +=3) { } if ($invalid_compares != NULL) { - foreach($invalid_compares as $compareVal) { - if ($typeToTest <= $compareVal) { - echo "FAILED: '$typeToTest' <= '$compareVal'\n"; - $failed = true; - } - } + foreach($invalid_compares as $compareVal) { + if ($typeToTest <= $compareVal) { + echo "FAILED: '$typeToTest' <= '$compareVal'\n"; + $failed = true; + } + } } } diff --git a/tests/lang/operators/overloaded_property_ref.phpt b/tests/lang/operators/overloaded_property_ref.phpt index 7561fc9916..8a158fc0fd 100644 --- a/tests/lang/operators/overloaded_property_ref.phpt +++ b/tests/lang/operators/overloaded_property_ref.phpt @@ -3,9 +3,9 @@ Operators on overlaoded property reference --FILE-- <?php class C { - function __construct() { $this->bar = str_repeat("1", 2); } - function &__get($x) { return $this->bar; } - function __set($x, $v) { $this->bar = $v; } + function __construct() { $this->bar = str_repeat("1", 2); } + function &__get($x) { return $this->bar; } + function __set($x, $v) { $this->bar = $v; } } $x = new C; var_dump(++$x->foo); diff --git a/tests/lang/operators/subtract_basiclong_64bit.phpt b/tests/lang/operators/subtract_basiclong_64bit.phpt index 32ed0c8f3e..0685371737 100644 --- a/tests/lang/operators/subtract_basiclong_64bit.phpt +++ b/tests/lang/operators/subtract_basiclong_64bit.phpt @@ -24,14 +24,14 @@ error_reporting(E_ERROR); foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal - $otherVal ---\n"; + echo "--- testing: $longVal - $otherVal ---\n"; var_dump($longVal-$otherVal); } } foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal - $longVal ---\n"; + echo "--- testing: $otherVal - $longVal ---\n"; var_dump($otherVal-$longVal); } } diff --git a/tests/lang/operators/subtract_variationStr.phpt b/tests/lang/operators/subtract_variationStr.phpt index 6d81b4fb7a..2c4667c114 100644 --- a/tests/lang/operators/subtract_variationStr.phpt +++ b/tests/lang/operators/subtract_variationStr.phpt @@ -12,7 +12,7 @@ error_reporting(E_ERROR); foreach ($strVals as $strVal) { foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' - '$otherVal' ---\n"; + echo "--- testing: '$strVal' - '$otherVal' ---\n"; var_dump($strVal-$otherVal); } } diff --git a/tests/lang/passByReference_001.phpt b/tests/lang/passByReference_001.phpt index 277f6d4a39..fd05182e68 100644 --- a/tests/lang/passByReference_001.phpt +++ b/tests/lang/passByReference_001.phpt @@ -4,14 +4,14 @@ passing of function parameters by reference <?php function f($arg1, &$arg2) { - var_dump($arg1++); - var_dump($arg2++); + var_dump($arg1++); + var_dump($arg2++); } function g (&$arg1, &$arg2) { - var_dump($arg1); - var_dump($arg2); + var_dump($arg1); + var_dump($arg2); } $a = 7; $b = 15; diff --git a/tests/lang/passByReference_002.phpt b/tests/lang/passByReference_002.phpt index d1968a3528..81868177a8 100644 --- a/tests/lang/passByReference_002.phpt +++ b/tests/lang/passByReference_002.phpt @@ -5,7 +5,7 @@ Attempt to pass a constant by reference function f(&$arg1) { - var_dump($arg1++); + var_dump($arg1++); } f(2); diff --git a/tests/lang/passByReference_003.phpt b/tests/lang/passByReference_003.phpt index de9ac09d8d..cfbc1b02de 100644 --- a/tests/lang/passByReference_003.phpt +++ b/tests/lang/passByReference_003.phpt @@ -3,13 +3,13 @@ Implicit initialisation when passing by reference --FILE-- <?php function passbyVal($val) { - echo "\nInside passbyVal call:\n"; - var_dump($val); + echo "\nInside passbyVal call:\n"; + var_dump($val); } function passbyRef(&$ref) { - echo "\nInside passbyRef call:\n"; - var_dump($ref); + echo "\nInside passbyRef call:\n"; + var_dump($ref); } echo "\nPassing undefined by value\n"; diff --git a/tests/lang/passByReference_004.phpt b/tests/lang/passByReference_004.phpt index a890411b71..e5688a230f 100644 --- a/tests/lang/passByReference_004.phpt +++ b/tests/lang/passByReference_004.phpt @@ -5,12 +5,12 @@ passing the return value from a function by reference function foo(&$ref) { - var_dump($ref); + var_dump($ref); } function bar($value) { - return $value; + return $value; } foo(bar(5)); diff --git a/tests/lang/passByReference_006.phpt b/tests/lang/passByReference_006.phpt index ce5d5ca2af..4c098acff3 100644 --- a/tests/lang/passByReference_006.phpt +++ b/tests/lang/passByReference_006.phpt @@ -11,20 +11,20 @@ function refs(&$ref1, &$ref2) { class C { - function __construct(&$ref1, &$ref2) { - $ref1 = "Ref1 changed"; - $ref2 = "Ref2 changed"; - } - - function refs(&$ref1, &$ref2) { - $ref1 = "Ref1 changed"; - $ref2 = "Ref2 changed"; - } - - static function static_refs(&$ref1, &$ref2) { - $ref1 = "Ref1 changed"; - $ref2 = "Ref2 changed"; - } + function __construct(&$ref1, &$ref2) { + $ref1 = "Ref1 changed"; + $ref2 = "Ref2 changed"; + } + + function refs(&$ref1, &$ref2) { + $ref1 = "Ref1 changed"; + $ref2 = "Ref2 changed"; + } + + static function static_refs(&$ref1, &$ref2) { + $ref1 = "Ref1 changed"; + $ref2 = "Ref2 changed"; + } } diff --git a/tests/lang/passByReference_007.phpt b/tests/lang/passByReference_007.phpt index 51594da0f3..9de00d26fd 100644 --- a/tests/lang/passByReference_007.phpt +++ b/tests/lang/passByReference_007.phpt @@ -3,42 +3,42 @@ Pass function and method calls by reference and by value. --FILE-- <?php class C { - static function sreturnVal() { - global $a; - return $a; - } - - static function &sreturnReference() { - global $a; - return $a; - } - - function returnVal() { - global $a; - return $a; - } - - function &returnReference() { - global $a; - return $a; - } + static function sreturnVal() { + global $a; + return $a; + } + + static function &sreturnReference() { + global $a; + return $a; + } + + function returnVal() { + global $a; + return $a; + } + + function &returnReference() { + global $a; + return $a; + } } function returnVal() { - global $a; - return $a; + global $a; + return $a; } function &returnReference() { - global $a; - return $a; + global $a; + return $a; } function foo(&$ref) { - var_dump($ref); - $ref = "changed"; + var_dump($ref); + $ref = "changed"; } diff --git a/tests/lang/passByReference_008.phpt b/tests/lang/passByReference_008.phpt index 5042b72e4b..ec5f161b40 100644 --- a/tests/lang/passByReference_008.phpt +++ b/tests/lang/passByReference_008.phpt @@ -3,15 +3,15 @@ Pass same variable by ref and by value. --FILE-- <?php function valRef($x, &$y) { - var_dump($x, $y); - $x = 'changed.x'; - $y = 'changed.y'; + var_dump($x, $y); + $x = 'changed.x'; + $y = 'changed.y'; } function refVal(&$x, $y) { - var_dump($x, $y); - $x = 'changed.x'; - $y = 'changed.y'; + var_dump($x, $y); + $x = 'changed.x'; + $y = 'changed.y'; } diff --git a/tests/lang/returnByReference.001.phpt b/tests/lang/returnByReference.001.phpt index 1feccd4a97..5278289f46 100644 --- a/tests/lang/returnByReference.001.phpt +++ b/tests/lang/returnByReference.001.phpt @@ -5,7 +5,7 @@ Returning a reference from a function function &returnByRef(&$arg1) { - return $arg1; + return $arg1; } $a = 7; diff --git a/tests/lang/returnByReference.002.phpt b/tests/lang/returnByReference.002.phpt index 67061048b3..1469e95a49 100644 --- a/tests/lang/returnByReference.002.phpt +++ b/tests/lang/returnByReference.002.phpt @@ -3,13 +3,13 @@ Returning a reference from a function. --FILE-- <?php function &returnRef() { - global $a; - return $a; + global $a; + return $a; } function returnVal() { - global $a; - return $a; + global $a; + return $a; } $a = "original"; diff --git a/tests/lang/returnByReference.003.phpt b/tests/lang/returnByReference.003.phpt index 44b5f7825b..11b91c547c 100644 --- a/tests/lang/returnByReference.003.phpt +++ b/tests/lang/returnByReference.003.phpt @@ -3,15 +3,15 @@ Returning a reference from a function --FILE-- <?php function returnConstantByValue() { - return 100; + return 100; } function &returnConstantByRef() { - return 100; + return 100; } function &returnVariableByRef() { - return $GLOBALS['a']; + return $GLOBALS['a']; } echo "\n---> 1. Trying to assign by reference the return value of a function that returns by value:\n"; diff --git a/tests/lang/returnByReference.004.phpt b/tests/lang/returnByReference.004.phpt index 63d4c709a3..d7e768cb82 100644 --- a/tests/lang/returnByReference.004.phpt +++ b/tests/lang/returnByReference.004.phpt @@ -3,17 +3,17 @@ Returning a reference from a static method --FILE-- <?php Class C { - static function returnConstantByValue() { - return 100; - } + static function returnConstantByValue() { + return 100; + } - static function &returnConstantByRef() { - return 100; - } + static function &returnConstantByRef() { + return 100; + } - static function &returnVariableByRef() { - return $GLOBALS['a']; - } + static function &returnVariableByRef() { + return $GLOBALS['a']; + } } echo "\n---> 1. Trying to assign by reference the return value of a function that returns by value:\n"; diff --git a/tests/lang/returnByReference.005.phpt b/tests/lang/returnByReference.005.phpt index 1d7a390b15..100bfe9ed8 100644 --- a/tests/lang/returnByReference.005.phpt +++ b/tests/lang/returnByReference.005.phpt @@ -3,17 +3,17 @@ Returning a reference from a method --FILE-- <?php Class C { - function returnConstantByValue() { - return 100; - } + function returnConstantByValue() { + return 100; + } - function &returnConstantByRef() { - return 100; - } + function &returnConstantByRef() { + return 100; + } - static function &returnVariableByRef() { - return $GLOBALS['a']; - } + static function &returnVariableByRef() { + return $GLOBALS['a']; + } } $c = new C; diff --git a/tests/lang/returnByReference.006.phpt b/tests/lang/returnByReference.006.phpt index d7a6c580a0..ff1749aa13 100644 --- a/tests/lang/returnByReference.006.phpt +++ b/tests/lang/returnByReference.006.phpt @@ -3,19 +3,19 @@ Returning a reference from a function via another function --FILE-- <?php function returnConstantByValue() { - return 100; + return 100; } function &returnConstantByRef() { - return 100; + return 100; } function &returnVariableByRef() { - return $GLOBALS['a']; + return $GLOBALS['a']; } function &returnFunctionCallByRef($functionToCall) { - return $functionToCall(); + return $functionToCall(); } echo "\n---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; diff --git a/tests/lang/returnByReference.007.phpt b/tests/lang/returnByReference.007.phpt index b38dfa0cb1..f3f1e5c8a8 100644 --- a/tests/lang/returnByReference.007.phpt +++ b/tests/lang/returnByReference.007.phpt @@ -3,21 +3,21 @@ Returning a reference from a static method via another static method --FILE-- <?php class C { - static function returnConstantByValue() { - return 100; - } + static function returnConstantByValue() { + return 100; + } - static function &returnConstantByRef() { - return 100; - } + static function &returnConstantByRef() { + return 100; + } - static function &returnVariableByRef() { - return $GLOBALS['a']; - } + static function &returnVariableByRef() { + return $GLOBALS['a']; + } - static function &returnFunctionCallByRef($functionToCall) { - return C::$functionToCall(); - } + static function &returnFunctionCallByRef($functionToCall) { + return C::$functionToCall(); + } } echo "\n---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; diff --git a/tests/lang/returnByReference.008.phpt b/tests/lang/returnByReference.008.phpt index 360df577c2..27a305a0ef 100644 --- a/tests/lang/returnByReference.008.phpt +++ b/tests/lang/returnByReference.008.phpt @@ -3,21 +3,21 @@ Returning a reference from a non-static method via another non-static method --FILE-- <?php class C { - function returnConstantByValue() { - return 100; - } + function returnConstantByValue() { + return 100; + } - function &returnConstantByRef() { - return 100; - } + function &returnConstantByRef() { + return 100; + } - function &returnVariableByRef() { - return $GLOBALS['a']; - } + function &returnVariableByRef() { + return $GLOBALS['a']; + } - function &returnFunctionCallByRef($functionToCall) { - return $this->$functionToCall(); - } + function &returnFunctionCallByRef($functionToCall) { + return $this->$functionToCall(); + } } $c = new C; diff --git a/tests/lang/returnByReference.009.phpt b/tests/lang/returnByReference.009.phpt index 68662f53eb..194f78bd84 100644 --- a/tests/lang/returnByReference.009.phpt +++ b/tests/lang/returnByReference.009.phpt @@ -6,11 +6,11 @@ Returning a references returned by another function function &returnVarByRef () { $b=1; - return $b; + return $b; } function &testReturnVarByRef() { - return returnVarByRef(); + return returnVarByRef(); } function returnVal () { @@ -18,7 +18,7 @@ return 1; } function &testReturnValByRef() { - return returnVal(); + return returnVal(); } echo "\n---> 1. Return a variable by reference -> No warning:\n"; diff --git a/tests/lang/static_basic_001.phpt b/tests/lang/static_basic_001.phpt index 302d2cf131..6a3ea1aa68 100644 --- a/tests/lang/static_basic_001.phpt +++ b/tests/lang/static_basic_001.phpt @@ -5,12 +5,12 @@ Static keyword - basic tests echo "\nSame variable used as static and non static.\n"; function staticNonStatic() { - echo "---------\n"; - $a=0; - echo "$a\n"; - static $a=10; - echo "$a\n"; - $a++; + echo "---------\n"; + $a=0; + echo "$a\n"; + static $a=10; + echo "$a\n"; + $a++; } staticNonStatic(); staticNonStatic(); @@ -18,20 +18,20 @@ staticNonStatic(); echo "\nLots of initialisations in the same statement.\n"; function manyInits() { - static $counter=0; - echo "------------- Call $counter --------------\n"; - static $a, $b=10, $c=20, $d, $e=30; - echo "Unitialised : $a\n"; - echo "Initialised to 10: $b\n"; - echo "Initialised to 20: $c\n"; - echo "Unitialised : $d\n"; - echo "Initialised to 30: $e\n"; - $a++; - $b++; - $c++; - $d++; - $e++; - $counter++; + static $counter=0; + echo "------------- Call $counter --------------\n"; + static $a, $b=10, $c=20, $d, $e=30; + echo "Unitialised : $a\n"; + echo "Initialised to 10: $b\n"; + echo "Initialised to 20: $c\n"; + echo "Unitialised : $d\n"; + echo "Initialised to 30: $e\n"; + $a++; + $b++; + $c++; + $d++; + $e++; + $counter++; } manyInits(); manyInits(); diff --git a/tests/lang/static_basic_002.phpt b/tests/lang/static_basic_002.phpt index 7e4e0bc3f4..b6e9856e82 100644 --- a/tests/lang/static_basic_002.phpt +++ b/tests/lang/static_basic_002.phpt @@ -13,10 +13,10 @@ static $a = 11; var_dump($a); function foo() { - static $a = 13; - static $a = 14; + static $a = 13; + static $a = 14; - var_dump($a); + var_dump($a); } foo(); diff --git a/tests/lang/static_variation_001.phpt b/tests/lang/static_variation_001.phpt index d8ebfd2ea1..13c3395f94 100644 --- a/tests/lang/static_variation_001.phpt +++ b/tests/lang/static_variation_001.phpt @@ -6,14 +6,14 @@ Statics in nested functions & evals. static $a = array(7,8,9); function f1() { - static $a = array(1,2,3); + static $a = array(1,2,3); - function g1() { - static $a = array(4,5,6); - var_dump($a); - } + function g1() { + static $a = array(4,5,6); + var_dump($a); + } - var_dump($a); + var_dump($a); } @@ -24,15 +24,15 @@ var_dump($a); eval(' static $b = array(10,11,12); '); function f2() { - eval(' static $b = array(1,2,3); '); + eval(' static $b = array(1,2,3); '); - function g2a() { - eval(' static $b = array(4,5,6); '); - var_dump($b); - } + function g2a() { + eval(' static $b = array(4,5,6); '); + var_dump($b); + } - eval('function g2b() { static $b = array(7, 8, 9); var_dump($b); } '); - var_dump($b); + eval('function g2b() { static $b = array(7, 8, 9); var_dump($b); } '); + var_dump($b); } f2(); diff --git a/tests/lang/static_variation_002.phpt b/tests/lang/static_variation_002.phpt index abb359c1d4..d1e2345ba1 100644 --- a/tests/lang/static_variation_002.phpt +++ b/tests/lang/static_variation_002.phpt @@ -4,26 +4,26 @@ Static variables in methods & nested functions & evals. <?php Class C { - function f() { - static $a = array(1,2,3); - eval(' static $k = array(4,5,6); '); + function f() { + static $a = array(1,2,3); + eval(' static $k = array(4,5,6); '); - function cfg() { - static $a = array(7,8,9); - eval(' static $k = array(10,11,12); '); - var_dump($a, $k); - } - var_dump($a, $k); - } + function cfg() { + static $a = array(7,8,9); + eval(' static $k = array(10,11,12); '); + var_dump($a, $k); + } + var_dump($a, $k); + } } $c = new C; $c->f(); cfg(); Class D { - static function f() { - eval('function dfg() { static $b = array(1,2,3); var_dump($b); } '); - } + static function f() { + eval('function dfg() { static $b = array(1,2,3); var_dump($b); } '); + } } D::f(); dfg(); diff --git a/tests/lang/throw_variation_001.phpt b/tests/lang/throw_variation_001.phpt index d942a87930..f71ef41ec7 100644 --- a/tests/lang/throw_variation_001.phpt +++ b/tests/lang/throw_variation_001.phpt @@ -4,9 +4,9 @@ Catching an exception thrown from an included file <?php try { - include "inc_throw.inc"; + include "inc_throw.inc"; } catch (Exception $e) { - echo "caught exception\n"; + echo "caught exception\n"; } ?> diff --git a/tests/lang/type_hints_002.phpt b/tests/lang/type_hints_002.phpt index cd348ebfb2..36fe56ad4b 100644 --- a/tests/lang/type_hints_002.phpt +++ b/tests/lang/type_hints_002.phpt @@ -4,10 +4,10 @@ ZE2 type hinting <?php class P { } class T { - function f(P $p = NULL) { - var_dump($p); - echo "-\n"; - } + function f(P $p = NULL) { + var_dump($p); + echo "-\n"; + } } $o=new T(); diff --git a/tests/lang/type_hints_003.phpt b/tests/lang/type_hints_003.phpt index 00471b9448..1a90940f42 100644 --- a/tests/lang/type_hints_003.phpt +++ b/tests/lang/type_hints_003.phpt @@ -3,8 +3,8 @@ ZE2 type --FILE-- <?php class T { - function f(P $p = 42) { - } + function f(P $p = 42) { + } } ?> --EXPECTF-- diff --git a/tests/output/bug70970.phpt b/tests/output/bug70970.phpt index f87e6f6977..902d872b9a 100644 --- a/tests/output/bug70970.phpt +++ b/tests/output/bug70970.phpt @@ -4,20 +4,20 @@ Bug #70970 (Segfault when combining error handler with output buffering) <?php function exception_error_handler($severity, $message, $file, $line) { - throw new Exception($message, 0); + throw new Exception($message, 0); } set_error_handler('exception_error_handler'); function obHandler($buffer, $phase = null) { - try { - ob_start(); - } catch (Exception $e) { - return (string) $e; - } + try { + ob_start(); + } catch (Exception $e) { + return (string) $e; + } - return $buffer; + return $buffer; } ob_start('obHandler'); diff --git a/tests/output/ob_010.phpt b/tests/output/ob_010.phpt index c5581a860e..b73ba1eecb 100644 --- a/tests/output/ob_010.phpt +++ b/tests/output/ob_010.phpt @@ -4,7 +4,7 @@ output buffering - fatalism <?php function obh($s) { - return print_r($s, 1); + return print_r($s, 1); } ob_start("obh"); echo "foo\n"; diff --git a/tests/output/ob_011.phpt b/tests/output/ob_011.phpt index 35b0388339..cd48cc3880 100644 --- a/tests/output/ob_011.phpt +++ b/tests/output/ob_011.phpt @@ -4,7 +4,7 @@ output buffering - fatalism <?php function obh($s) { - return ob_get_flush(); + return ob_get_flush(); } ob_start("obh"); echo "foo\n"; diff --git a/tests/output/ob_012.phpt b/tests/output/ob_012.phpt index 9e6e885abf..b24138bdbf 100644 --- a/tests/output/ob_012.phpt +++ b/tests/output/ob_012.phpt @@ -3,19 +3,19 @@ output buffering - multiple --FILE-- <?php echo 0; - ob_start(); - ob_start(); - ob_start(); - ob_start(); - echo 1; - ob_end_flush(); - echo 2; - $ob = ob_get_clean(); - echo 3; - ob_flush(); - ob_end_clean(); - echo 4; - ob_end_flush(); + ob_start(); + ob_start(); + ob_start(); + ob_start(); + echo 1; + ob_end_flush(); + echo 2; + $ob = ob_get_clean(); + echo 3; + ob_flush(); + ob_end_clean(); + echo 4; + ob_end_flush(); echo $ob; ?> --EXPECT-- diff --git a/tests/output/ob_017.phpt b/tests/output/ob_017.phpt index c6b59cb765..a214d40f18 100644 --- a/tests/output/ob_017.phpt +++ b/tests/output/ob_017.phpt @@ -6,9 +6,9 @@ opcache.optimization_level=0 <?php $statuses = array(); function oh($str, $flags) { - global $statuses; - $statuses[] = "$flags: $str"; - return $str; + global $statuses; + $statuses[] = "$flags: $str"; + return $str; } ob_start("oh", 3); echo "yes"; diff --git a/tests/output/ob_start_basic_002.phpt b/tests/output/ob_start_basic_002.phpt index d79a1fe980..700dab5d3c 100644 --- a/tests/output/ob_start_basic_002.phpt +++ b/tests/output/ob_start_basic_002.phpt @@ -3,23 +3,23 @@ ob_start(): Check behaviour with various callback return values. --FILE-- <?php function return_empty_string($string) { - return ""; + return ""; } function return_false($string) { - return false; + return false; } function return_null($string) { - return null; + return null; } function return_string($string) { - return "I stole your output."; + return "I stole your output."; } function return_zero($string) { - return 0; + return 0; } // Use each of the above functions as an output buffering callback: diff --git a/tests/output/ob_start_basic_003.phpt b/tests/output/ob_start_basic_003.phpt index 23f0bfb274..4ea17132da 100644 --- a/tests/output/ob_start_basic_003.phpt +++ b/tests/output/ob_start_basic_003.phpt @@ -4,7 +4,7 @@ ob_start(): ensure even fatal error test is affected by output buffering. <?php function f() { - return "I have stolen your output"; + return "I have stolen your output"; } ob_start('f'); diff --git a/tests/output/ob_start_basic_004.phpt b/tests/output/ob_start_basic_004.phpt index ba75c16de9..f072a31f13 100644 --- a/tests/output/ob_start_basic_004.phpt +++ b/tests/output/ob_start_basic_004.phpt @@ -10,10 +10,10 @@ opcache.optimization_level=0 */ // In HEAD, $chunk_size value of 1 should not have any special behaviour (http://marc.info/?l=php-internals&m=123476465621346&w=2). function callback($string) { - global $callback_invocations; - $callback_invocations++; - $len = strlen($string); - return "f[call:$callback_invocations; len:$len]$string\n"; + global $callback_invocations; + $callback_invocations++; + $len = strlen($string); + return "f[call:$callback_invocations; len:$len]$string\n"; } for ($cs=-1; $cs<10; $cs++) { diff --git a/tests/output/ob_start_basic_005.phpt b/tests/output/ob_start_basic_005.phpt index 9cd5a0dded..4c3aa9c7eb 100644 --- a/tests/output/ob_start_basic_005.phpt +++ b/tests/output/ob_start_basic_005.phpt @@ -8,9 +8,9 @@ ob_start(): non-static method as static callbacks. */ Class C { - function h($string) { - return $string; - } + function h($string) { + return $string; + } } function checkAndClean() { diff --git a/tests/output/ob_start_basic_006.phpt b/tests/output/ob_start_basic_006.phpt index b3aef511ac..6df545ea22 100644 --- a/tests/output/ob_start_basic_006.phpt +++ b/tests/output/ob_start_basic_006.phpt @@ -8,32 +8,32 @@ ob_start(): ensure multiple buffer initialization with a single call using array */ function f($string) { - static $i=0; - $i++; - $len = strlen($string); - return "f[call:$i; len:$len] - $string\n"; + static $i=0; + $i++; + $len = strlen($string); + return "f[call:$i; len:$len] - $string\n"; } Class C { - public $id = 'none'; - - function __construct($id) { - $this->id = $id; - } - - static function g($string) { - static $i=0; - $i++; - $len = strlen($string); - return "C::g[call:$i; len:$len] - $string\n"; - } - - function h($string) { - static $i=0; - $i++; - $len = strlen($string); - return "C::h[call:$i; len:$len; id:$this->id] - $string\n"; - } + public $id = 'none'; + + function __construct($id) { + $this->id = $id; + } + + static function g($string) { + static $i=0; + $i++; + $len = strlen($string); + return "C::g[call:$i; len:$len] - $string\n"; + } + + function h($string) { + static $i=0; + $i++; + $len = strlen($string); + return "C::h[call:$i; len:$len; id:$this->id] - $string\n"; + } } function checkAndClean() { diff --git a/tests/output/ob_start_basic_unerasable_001.phpt b/tests/output/ob_start_basic_unerasable_001.phpt index ebb03a4c16..658bee2163 100644 --- a/tests/output/ob_start_basic_unerasable_001.phpt +++ b/tests/output/ob_start_basic_unerasable_001.phpt @@ -3,9 +3,9 @@ ob_start(): Ensure content of unerasable buffer can be accessed by ob_get_conten --FILE-- <?php function callback($string) { - static $callback_invocations; - $callback_invocations++; - return "[callback:$callback_invocations]$string\n"; + static $callback_invocations; + $callback_invocations++; + return "[callback:$callback_invocations]$string\n"; } ob_start('callback', 0, false); diff --git a/tests/output/ob_start_basic_unerasable_002.phpt b/tests/output/ob_start_basic_unerasable_002.phpt index 967f467f75..1afe3efbc5 100644 --- a/tests/output/ob_start_basic_unerasable_002.phpt +++ b/tests/output/ob_start_basic_unerasable_002.phpt @@ -3,9 +3,9 @@ ob_start(): Ensure unerasable buffer cannot be erased by ob_clean(), ob_end_clea --FILE-- <?php function callback($string) { - static $callback_invocations; - $callback_invocations++; - return "[callback:$callback_invocations]$string\n"; + static $callback_invocations; + $callback_invocations++; + return "[callback:$callback_invocations]$string\n"; } ob_start('callback', 0, false); diff --git a/tests/output/ob_start_basic_unerasable_003.phpt b/tests/output/ob_start_basic_unerasable_003.phpt index a881d271b6..b3b76da650 100644 --- a/tests/output/ob_start_basic_unerasable_003.phpt +++ b/tests/output/ob_start_basic_unerasable_003.phpt @@ -3,9 +3,9 @@ ob_start(): Ensure unerasable buffer cannot be accessed or erased by ob_get_clea --FILE-- <?php function callback($string) { - static $callback_invocations; - $callback_invocations++; - return "[callback:$callback_invocations]$string\n"; + static $callback_invocations; + $callback_invocations++; + return "[callback:$callback_invocations]$string\n"; } ob_start('callback', 0, false); diff --git a/tests/output/ob_start_basic_unerasable_004.phpt b/tests/output/ob_start_basic_unerasable_004.phpt index 83702fc08f..442462462c 100644 --- a/tests/output/ob_start_basic_unerasable_004.phpt +++ b/tests/output/ob_start_basic_unerasable_004.phpt @@ -3,9 +3,9 @@ ob_start(): Ensure unerasable buffer cannot be accessed or flushed by ob_get_flu --FILE-- <?php function callback($string) { - static $callback_invocations; - $callback_invocations++; - return "[callback:$callback_invocations]$string\n"; + static $callback_invocations; + $callback_invocations++; + return "[callback:$callback_invocations]$string\n"; } ob_start('callback', 0, false); diff --git a/tests/output/ob_start_basic_unerasable_005.phpt b/tests/output/ob_start_basic_unerasable_005.phpt index 86c752e98b..7f99b72dd1 100644 --- a/tests/output/ob_start_basic_unerasable_005.phpt +++ b/tests/output/ob_start_basic_unerasable_005.phpt @@ -3,9 +3,9 @@ ob_start(): Ensure unerasable buffer cannot be flushed by ob_flush() --FILE-- <?php function callback($string) { - static $callback_invocations; - $callback_invocations++; - return "[callback:$callback_invocations]$string\n"; + static $callback_invocations; + $callback_invocations++; + return "[callback:$callback_invocations]$string\n"; } ob_start('callback', 0, false); diff --git a/tests/output/ob_start_callbacks.phpt b/tests/output/ob_start_callbacks.phpt index 6815bccd63..ea6e409534 100644 --- a/tests/output/ob_start_callbacks.phpt +++ b/tests/output/ob_start_callbacks.phpt @@ -11,9 +11,9 @@ ob_end_flush(); // Object (array) in variable class foo { - static function out($foo) { - return strtoupper($foo); - } + static function out($foo) { + return strtoupper($foo); + } } $a = array('foo', 'out'); ob_start($a); @@ -26,7 +26,7 @@ echo 'object via static array', "\n"; ob_end_flush(); function my_strtoupper($foo, $bar) { - return strtoupper($foo); + return strtoupper($foo); } $a = 'my_strtoupper'; ob_start($a); diff --git a/tests/output/ob_start_error_001.phpt b/tests/output/ob_start_error_001.phpt index c838c18bac..36efb124a7 100644 --- a/tests/output/ob_start_error_001.phpt +++ b/tests/output/ob_start_error_001.phpt @@ -8,7 +8,7 @@ Test wrong number of arguments and wrong arg types for ob_start() */ function justPrint($str) { - return $str; + return $str; } $arg_1 = "justPrint"; diff --git a/tests/output/ob_start_error_002.phpt b/tests/output/ob_start_error_002.phpt index e3f45af3df..447547182b 100644 --- a/tests/output/ob_start_error_002.phpt +++ b/tests/output/ob_start_error_002.phpt @@ -8,9 +8,9 @@ Test wrong number of arguments and wrong arg types for ob_start() */ Class C { - static function f($str) { - return $str; - } + static function f($str) { + return $str; + } } var_dump(ob_start(array("nonExistent","f"))); diff --git a/tests/output/ob_start_error_005.phpt b/tests/output/ob_start_error_005.phpt index d6f9dc4c10..e11fc3ad89 100644 --- a/tests/output/ob_start_error_005.phpt +++ b/tests/output/ob_start_error_005.phpt @@ -9,10 +9,10 @@ ob_start(): ensure buffers can't be added from within callback. */ function f($str) { - ob_start(); - echo "hello"; - ob_end_flush(); - return $str; + ob_start(); + echo "hello"; + ob_end_flush(); + return $str; } diff --git a/tests/quicktester.inc b/tests/quicktester.inc index ba60e74a51..ba243beba0 100644 --- a/tests/quicktester.inc +++ b/tests/quicktester.inc @@ -20,55 +20,55 @@ $tests = explode("\n",$tests); $success = TRUE; foreach ($tests as $n=>$test) { - // ignore empty lines - if (!$test) continue; + // ignore empty lines + if (!$test) continue; - // warn for trailing ; - if (substr(trim($test), -1, 1) === ';') { - echo "WARNING: trailing ';' found in test ".($n+1)."\n"; - exit; - } + // warn for trailing ; + if (substr(trim($test), -1, 1) === ';') { + echo "WARNING: trailing ';' found in test ".($n+1)."\n"; + exit; + } - // try for operators - $operators = array('===', '~=='); - $operator = NULL; - foreach ($operators as $a_operator) { - if (strpos($test, $a_operator)!== FALSE) { - $operator = $a_operator; - list($left,$right) = explode($operator, $test); - break; - } - } - if (!$operator) { - echo "WARNING: unknown operator in '$test' (1)\n"; - exit; - } + // try for operators + $operators = array('===', '~=='); + $operator = NULL; + foreach ($operators as $a_operator) { + if (strpos($test, $a_operator)!== FALSE) { + $operator = $a_operator; + list($left,$right) = explode($operator, $test); + break; + } + } + if (!$operator) { + echo "WARNING: unknown operator in '$test' (1)\n"; + exit; + } - $left = eval("return ($left );"); - $right = eval("return ($right);"); - switch (@$operator) { - case '===': // exact match - $result = $left === $right; - break; - case '~==': // may differ after 12th significant number - if ( !is_float($left ) && !is_int($left ) - || !is_float($right) && !is_int($right)) { - $result = FALSE; - break; - } - $result = abs(($left-$right) / $left) < 1e-12; - break; - default: - echo "WARNING: unknown operator in '$test' (2)\n"; - exit; - } + $left = eval("return ($left );"); + $right = eval("return ($right);"); + switch (@$operator) { + case '===': // exact match + $result = $left === $right; + break; + case '~==': // may differ after 12th significant number + if ( !is_float($left ) && !is_int($left ) + || !is_float($right) && !is_int($right)) { + $result = FALSE; + break; + } + $result = abs(($left-$right) / $left) < 1e-12; + break; + default: + echo "WARNING: unknown operator in '$test' (2)\n"; + exit; + } - $success = $success && $result; - if (!$result) { - echo "\nAssert failed:\n"; - echo "$test\n"; - echo "Left: ";var_dump($left ); - echo "Right: ";var_dump($right); - } + $success = $success && $result; + if (!$result) { + echo "\nAssert failed:\n"; + echo "$test\n"; + echo "Left: ";var_dump($left ); + echo "Right: ";var_dump($right); + } } if ($success) echo "OK"; diff --git a/tests/security/open_basedir.inc b/tests/security/open_basedir.inc index d30f2f8384..b97071bfbd 100644 --- a/tests/security/open_basedir.inc +++ b/tests/security/open_basedir.inc @@ -43,7 +43,7 @@ function recursive_delete_directory($directory) { if (is_dir($path) == TRUE) { recursive_delete_directory($path); } else { - @chmod($path, 0777); + @chmod($path, 0777); unlink($path); } } @@ -51,7 +51,7 @@ function recursive_delete_directory($directory) { } closedir($handle); - @chmod($directory, 0777); + @chmod($directory, 0777); rmdir($directory); return TRUE; diff --git a/tests/strings/001.phpt b/tests/strings/001.phpt index 6d0a9d12b9..0f1f749459 100644 --- a/tests/strings/001.phpt +++ b/tests/strings/001.phpt @@ -11,15 +11,15 @@ $tok2 = strtok("/"); $tok3 = strtok("\\"); $tok4 = strtok("."); if ($tok1 != "testing") { - echo("failed 1\n"); + echo("failed 1\n"); } elseif ($tok2 != "1") { - echo("failed 2\n"); + echo("failed 2\n"); } elseif ($tok3 != "2") { - echo("failed 3\n"); + echo("failed 3\n"); } elseif ($tok4 != "3") { - echo("failed 4\n"); + echo("failed 4\n"); } else { - echo("passed\n"); + echo("passed\n"); } echo "Testing strstr: "; @@ -27,11 +27,11 @@ $test = "This is a test"; $found1 = strstr($test, chr(32)); $found2 = strstr($test, "a "); if ($found1 != " is a test") { - echo("failed 1\n"); + echo("failed 1\n"); } elseif ($found2 != "a test") { - echo("failed 2\n"); + echo("failed 2\n"); } else { - echo("passed\n"); + echo("passed\n"); } echo "Testing strrchr: "; @@ -39,30 +39,30 @@ $test = "fola fola blakken"; $found1 = strrchr($test, "b"); $found2 = strrchr($test, chr(102)); if ($found1 != "blakken") { - echo("failed 1\n"); + echo("failed 1\n"); } elseif ($found2 != "fola blakken") { - echo("failed 2\n"); + echo("failed 2\n"); } else { - echo("passed\n"); + echo("passed\n"); } echo "Testing strtoupper: "; $test = "abCdEfg"; $upper = strtoupper($test); if ($upper == "ABCDEFG") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing strtolower: "; $test = "ABcDeFG"; $lower = strtolower($test); if ($lower == "abcdefg") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing substr: "; @@ -79,9 +79,9 @@ $tests++; if (substr($string, -1, -2) == "") { $ok++; } $tests++; if (substr($string, -3, -2) == "3") { $ok++; } if ($tests == $ok) { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } $raw = ' !"#$%&\'()*+,-./0123456789:;<=>?' @@ -96,17 +96,17 @@ $correct = '%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3 . '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~' . '%00'; if ($encoded == $correct) { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing rawurldecode: "; $decoded = rawurldecode($correct); if ($decoded == $raw) { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing urlencode: "; @@ -116,62 +116,62 @@ $correct = '+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E% . '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E' . '%00'; if ($encoded == $correct) { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing urldecode: "; $decoded = urldecode($correct); if ($decoded == $raw) { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing quotemeta: "; $raw = "a.\\+*?" . chr(91) . "^" . chr(93) . "b\$c"; $quoted = quotemeta($raw); if ($quoted == "a\\.\\\\\\+\\*\\?\\[\\^\\]b\\\$c") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing ufirst: "; $str = "fahrvergnuegen"; $uc = ucfirst($str); if ($uc == "Fahrvergnuegen") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing strtr: "; $str = "test abcdefgh"; $tr = strtr($str, "def", "456"); if ($tr == "t5st abc456gh") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing addslashes: "; $str = "\"\\'"; $as = addslashes($str); if ($as == "\\\"\\\\\\'") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing stripslashes: "; $str = "\$\\'"; $ss = stripslashes($str); if ($ss == "\$'") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } @@ -183,9 +183,9 @@ $ui2 = uniqid($str, true); $len = 29; if (strlen($ui1) == strlen($ui2) && strlen($ui1) == $len && $ui1 != $ui2) { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo "Testing uniqid(false): "; @@ -197,9 +197,9 @@ $ui2 = uniqid($str); $len = strncasecmp(PHP_OS, 'CYGWIN', 6) ? 19 : 29; if (strlen($ui1) == strlen($ui2) && strlen($ui1) == $len && $ui1 != $ui2) { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } ?> diff --git a/tests/strings/bug26703.phpt b/tests/strings/bug26703.phpt index bea8fb1214..4e48845fdf 100644 --- a/tests/strings/bug26703.phpt +++ b/tests/strings/bug26703.phpt @@ -8,7 +8,7 @@ highlight.default=#0000BB highlight.html=#000000 --FILE-- <?php - highlight_string('<?php echo "foo[] $a \n"; ?>'); + highlight_string('<?php echo "foo[] $a \n"; ?>'); ?> --EXPECT-- <code><span style="color: #000000"> |