diff options
Diffstat (limited to 'tests')
594 files changed, 6006 insertions, 7471 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 038d4beff9..37e5ecd809 100644 --- a/tests/basic/012.phpt +++ b/tests/basic/012.phpt @@ -1,7 +1,5 @@ --TEST-- Testing $argc and $argv handling (cli) ---SKIPIF-- -<?php if(php_sapi_name()!='cli') echo 'skip'; ?> --INI-- register_argc_argv=1 variables_order=GPS @@ -13,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/025.phpt b/tests/basic/025.phpt index 37561a2a2e..5bc7bbdb8e 100644 --- a/tests/basic/025.phpt +++ b/tests/basic/025.phpt @@ -15,7 +15,7 @@ Warning: Unknown: POST Content-Length of 2050 bytes exceeds the limit of 1024 by Warning: Cannot modify header information - headers already sent in Unknown on line 0 -Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +Warning: Undefined variable $HTTP_RAW_POST_DATA in %s on line %d array(0) { } NULL diff --git a/tests/basic/027.phpt b/tests/basic/027.phpt deleted file mode 100644 index 0528e835a1..0000000000 --- a/tests/basic/027.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Handling of max_input_nesting_level being reached ---INI-- -always_populate_raw_post_data=0 -display_errors=0 -max_input_nesting_level=10 -max_input_vars=1000 -track_errors=1 -log_errors=0 ---POST-- -a=1&b=ZYX&c[][][][][][][][][][][][][][][][][][][][][][]=123&d=123&e[][]][]=3 ---FILE-- -<?php -var_dump($_POST, $php_errormsg); -?> ---EXPECT-- -array(4) { - ["a"]=> - string(1) "1" - ["b"]=> - string(3) "ZYX" - ["d"]=> - string(3) "123" - ["e"]=> - array(1) { - [0]=> - array(1) { - [0]=> - string(1) "3" - } - } -} -string(115) "Unknown: Input variable nesting level exceeded 10. To increase the limit change max_input_nesting_level in php.ini." 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/bug31875.phpt b/tests/basic/bug31875.phpt index 65f68b9af3..c8ad25ec9f 100644 --- a/tests/basic/bug31875.phpt +++ b/tests/basic/bug31875.phpt @@ -8,6 +8,8 @@ disable_functions=dl <?php $disabled_function = 'dl'; +/* exclude_disabled parameters is harded to true */ + $functions = get_defined_functions(); var_dump(in_array($disabled_function, $functions['internal'])); @@ -17,7 +19,9 @@ var_dump(in_array($disabled_function, $functions['internal'])); $functions = get_defined_functions(true); var_dump(in_array($disabled_function, $functions['internal'])); ?> ---EXPECT-- -bool(true) -bool(true) +--EXPECTF-- +bool(false) + +Deprecated: get_defined_functions(): Setting $exclude_disabled to false has no effect in %s on line %d +bool(false) bool(false) diff --git a/tests/basic/bug54514.phpt b/tests/basic/bug54514.phpt index 0c5595e3f7..fad84d5c64 100644 --- a/tests/basic/bug54514.phpt +++ b/tests/basic/bug54514.phpt @@ -3,10 +3,11 @@ 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/bug61000.phpt b/tests/basic/bug61000.phpt index 01e27bfd9b..7600fa2cc8 100644 --- a/tests/basic/bug61000.phpt +++ b/tests/basic/bug61000.phpt @@ -10,6 +10,7 @@ a[a][]=foo&a[a][b][c]=bar <?php print_r($_GET); print_r($_POST); +?> --EXPECT-- Array ( diff --git a/tests/basic/bug67198.phpt b/tests/basic/bug67198.phpt index 3f5e2a348c..e5ffe3bf6c 100644 --- a/tests/basic/bug67198.phpt +++ b/tests/basic/bug67198.phpt @@ -41,6 +41,7 @@ php_cli_server_start( var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context)); var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context)); +?> --EXPECT-- string(4) "PASS" string(4) "PASS" diff --git a/tests/basic/bug67988.phpt b/tests/basic/bug67988.phpt index e1d8e5d7d4..2690a45620 100644 --- a/tests/basic/bug67988.phpt +++ b/tests/basic/bug67988.phpt @@ -16,6 +16,7 @@ var_dump(htmlentities("\xA3", ENT_HTML5, 'cp1252')); var_dump(bin2hex(html_entity_decode("£", ENT_HTML5))); var_dump(bin2hex(html_entity_decode("£", ENT_HTML5, 'cp1252'))); +?> --EXPECT-- string(6) "cp1252" string(0) "" diff --git a/tests/basic/bug71273.phpt b/tests/basic/bug71273.phpt index 3db4454605..7634d432d0 100644 --- a/tests/basic/bug71273.phpt +++ b/tests/basic/bug71273.phpt @@ -1,21 +1,13 @@ --TEST-- Bug #71273 A wrong ext directory setup in php.ini leads to crash ---SKIPIF-- -<?php - if ("cli" != php_sapi_name()) { - die("skip CLI only"); - } -?> --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)); ?> -==DONE== --EXPECT-- int(1) -==DONE== diff --git a/tests/basic/bug78236.phpt b/tests/basic/bug78236.phpt new file mode 100644 index 0000000000..9b56b1388c --- /dev/null +++ b/tests/basic/bug78236.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #78236 (convert error on receiving variables when duplicate [) +--POST-- +id[name=1&id[[name=a&id[na me.=3 +--FILE-- +<?php +var_dump($_POST); +?> +--EXPECT-- +array(3) { + ["id_name"]=> + string(1) "1" + ["id__name"]=> + string(1) "a" + ["id_na_me_"]=> + string(1) "3" +} diff --git a/tests/basic/consistent_float_string_casts.phpt b/tests/basic/consistent_float_string_casts.phpt new file mode 100644 index 0000000000..adbc1b23ae --- /dev/null +++ b/tests/basic/consistent_float_string_casts.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test that float to string and string to float casts are consistent +--SKIPIF-- +<?php +if (!setlocale( + LC_ALL, + "german", "de", "de_DE", "de_DE.ISO8859-1", "de_DE.ISO_8859-1", "de_DE.UTF-8", + "french", "fr", "fr_FR", "fr_FR.ISO8859-1", "fr_FR.ISO_8859-1", "fr_FR.UTF-8", +)) { + die("skip locale needed for this test is not supported on this platform"); +} +?> +--FILE-- +<?php + +setlocale( + LC_ALL, + "german", "de", "de_DE", "de_DE.ISO8859-1", "de_DE.ISO_8859-1", "de_DE.UTF-8", + "french", "fr", "fr_FR", "fr_FR.ISO8859-1", "fr_FR.ISO_8859-1", "fr_FR.UTF-8", +); + +$float = 1/3; +$string = (string) $float; +$float = (float) $string; + +printf("%.2f", $float); + +?> +--EXPECT-- +0,33 diff --git a/tests/basic/enable_post_data_reading_01.phpt b/tests/basic/enable_post_data_reading_01.phpt index 19ee5d583f..9ce4fc288a 100644 --- a/tests/basic/enable_post_data_reading_01.phpt +++ b/tests/basic/enable_post_data_reading_01.phpt @@ -12,13 +12,14 @@ var_dump($_POST); var_dump($HTTP_RAW_POST_DATA); var_dump(file_get_contents("php://input")); var_dump(file_get_contents("php://input")); +?> --EXPECTF-- array(0) { } array(0) { } -Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +Warning: Undefined variable $HTTP_RAW_POST_DATA in %s on line %d NULL string(9) "a=1&b=ZYX" string(9) "a=1&b=ZYX" diff --git a/tests/basic/enable_post_data_reading_02.phpt b/tests/basic/enable_post_data_reading_02.phpt index 4e1643ebd0..c8bd0c2517 100644 --- a/tests/basic/enable_post_data_reading_02.phpt +++ b/tests/basic/enable_post_data_reading_02.phpt @@ -16,6 +16,7 @@ var_dump($_FILES); var_dump($_POST); var_dump(file_get_contents("php://input")); var_dump(file_get_contents("php://input")); +?> --EXPECTF-- array(0) { } diff --git a/tests/basic/enable_post_data_reading_03.phpt b/tests/basic/enable_post_data_reading_03.phpt index 6a62282ea2..c0842382ea 100644 --- a/tests/basic/enable_post_data_reading_03.phpt +++ b/tests/basic/enable_post_data_reading_03.phpt @@ -13,13 +13,14 @@ var_dump($_POST); var_dump($HTTP_RAW_POST_DATA); var_dump(file_get_contents("php://input")); var_dump(file_get_contents("php://input")); +?> --EXPECTF-- array(0) { } array(0) { } -Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +Warning: Undefined variable $HTTP_RAW_POST_DATA in %s on line %d NULL string(9) "a=1&b=ZYX" string(9) "a=1&b=ZYX" diff --git a/tests/basic/enable_post_data_reading_04.phpt b/tests/basic/enable_post_data_reading_04.phpt index a7c7e496d8..d309169cb0 100644 --- a/tests/basic/enable_post_data_reading_04.phpt +++ b/tests/basic/enable_post_data_reading_04.phpt @@ -13,13 +13,14 @@ var_dump($_POST); var_dump($HTTP_RAW_POST_DATA); var_dump(file_get_contents("php://input")); var_dump(file_get_contents("php://input")); +?> --EXPECTF-- array(0) { } array(0) { } -Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +Warning: Undefined variable $HTTP_RAW_POST_DATA in %s on line %d NULL string(9) "a=1&b=ZYX" string(9) "a=1&b=ZYX" 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/precision.phpt b/tests/basic/precision.phpt index 42f99dc9fb..1ee4c9a0fc 100644 --- a/tests/basic/precision.phpt +++ b/tests/basic/precision.phpt @@ -77,6 +77,7 @@ echo "OUTPUTS".PHP_EOL; echo join(' ', $v).PHP_EOL; var_dump(serialize($v)); var_export($v);echo PHP_EOL; +?> --EXPECT-- INI -1 diff --git a/tests/basic/req44164.phpt b/tests/basic/req44164.phpt index 7a142f5fb9..6786c16b75 100644 --- a/tests/basic/req44164.phpt +++ b/tests/basic/req44164.phpt @@ -13,5 +13,6 @@ HTTP_ACCEPT_ENCODING=gzip <?php header("Content-length: 200"); echo str_repeat("a", 200); +?> --EXPECT-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 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/basic/timeout_variation_10.phpt b/tests/basic/timeout_variation_10.phpt index b067238db5..7680c96adf 100644 --- a/tests/basic/timeout_variation_10.phpt +++ b/tests/basic/timeout_variation_10.phpt @@ -5,8 +5,6 @@ Timeout within shutdown function, variation if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (PHP_OS_FAMILY !== "Windows") die("skip Windows only test"); ?> ---XFAIL-- -Missing timeout check in call_user_function --FILE-- <?php @@ -19,4 +17,5 @@ register_shutdown_function("sleep", 1); shutdown happens after here --EXPECTF-- shutdown happens after here + Fatal error: Maximum execution time of 1 second exceeded in %s on line %d diff --git a/tests/basic/timeout_variation_9.phpt b/tests/basic/timeout_variation_9.phpt index e59ae242dc..d645ef2bbf 100644 --- a/tests/basic/timeout_variation_9.phpt +++ b/tests/basic/timeout_variation_9.phpt @@ -5,8 +5,6 @@ Timeout within shutdown function if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (PHP_OS_FAMILY !== "Windows") die("skip Windows only test"); ?> ---XFAIL-- -Missing timeout check in call_user_function --FILE-- <?php 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..20416edb5d 100644 --- a/tests/classes/__call_005.phpt +++ b/tests/classes/__call_005.phpt @@ -3,26 +3,26 @@ 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(); $b->test(); ?> --EXPECTF-- -Warning: The magic method __call() must have public visibility and cannot be static in %s__call_005.php on line 3 +Warning: The magic method A::__call() must have public visibility in %s__call_005.php on line 3 In A::__call(test1, array(1,a)) object(B)#1 (0) { } diff --git a/tests/classes/__call_006.phpt b/tests/classes/__call_006.phpt index e6efdefe9e..6ffc75358f 100644 --- a/tests/classes/__call_006.phpt +++ b/tests/classes/__call_006.phpt @@ -3,54 +3,53 @@ 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"; } ?> -==DONE== --EXPECTF-- ---> Invoke __call via simple method call. object(A)#%d (0) { @@ -74,4 +73,3 @@ Exception caught OK; continuing. object(B)#%d (0) { } Exception caught OK; continuing. -==DONE== diff --git a/tests/classes/__call_007.phpt b/tests/classes/__call_007.phpt deleted file mode 100644 index a1dd4594e9..0000000000 --- a/tests/classes/__call_007.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -Ensure exceptions are handled properly when thrown in a statically declared __call. ---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); - } -} - -class B extends A { - function test() { - B::unknownCalledWithSROFromChild(1,2,3); - } -} - -$a = new A(); - -echo "---> Invoke __call via simple method call.\n"; -try { - $a->unknown(); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} - -echo "\n\n---> Invoke __call via scope resolution operator within instance.\n"; -try { - $a->test(); -} catch (Exception $e) { - 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(); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} - -echo "\n\n---> Invoke __call via callback.\n"; -try { - call_user_func(array($b, 'unknownCallback'), 1,2,3); -} catch (Exception $e) { - echo "Exception caught OK; continuing.\n"; -} -?> -==DONE== ---EXPECTF-- -Warning: The magic method __call() must have public visibility and cannot be static in %s on line 3 ----> Invoke __call via simple method call. -object(A)#1 (0) { -} -Exception caught OK; continuing. - - ----> Invoke __call via scope resolution operator within instance. -object(A)#1 (0) { -} -Exception caught OK; continuing. - - ----> Invoke __call via scope resolution operator within child instance. -object(B)#2 (0) { -} -Exception caught OK; continuing. - - ----> Invoke __call via callback. -object(B)#2 (0) { -} -Exception caught OK; continuing. -==DONE== 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 004edc973a..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(); @@ -30,8 +30,6 @@ var_dump($bar->baz); var_dump($foo->bar->baz); ?> -===DONE=== --EXPECT-- string(5) "Check" string(5) "Check" -===DONE=== diff --git a/tests/classes/__set__get_005.phpt b/tests/classes/__set__get_005.phpt index 68cfb39df3..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(); @@ -48,7 +48,6 @@ var_dump($foo->bar); var_dump($foo->bar->baz); ?> -===DONE=== --EXPECTF-- AutoGen::__get Test::__set @@ -63,4 +62,3 @@ object(Test)#%d (1) { AutoGen::__get Test::__get string(5) "Check" -===DONE=== 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 a23205f9a5..db040e1342 100644 --- a/tests/classes/abstract_derived.phpt +++ b/tests/classes/abstract_derived.phpt @@ -7,11 +7,10 @@ class base { } class derived extends base { - abstract function show(); + abstract function show(); } ?> ===DONE=== -<?php exit(0); ?> --EXPECTF-- Fatal error: Class derived contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (derived::show) in %sabstract_derived.php on line %d 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 6ce810c836..cd8c5c7e36 100644 --- a/tests/classes/abstract_user_call.phpt +++ b/tests/classes/abstract_user_call.phpt @@ -5,27 +5,28 @@ 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; $o->func(); -call_user_func(array($o, 'test_base::func')); +try { + call_user_func(array($o, 'test_base::func')); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> -===DONE=== ---EXPECTF-- +--EXPECT-- test::func() - -Warning: call_user_func() expects parameter 1 to be a valid callback, cannot call abstract method test_base::func() in %s on line %d -===DONE=== +call_user_func(): Argument #1 ($function) must be a valid callback, cannot call abstract method test_base::func() diff --git a/tests/classes/array_access_001.phpt b/tests/classes/array_access_001.phpt index 784a886126..8e70b87f67 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; @@ -82,7 +82,6 @@ unset($obj['8th']); var_dump($obj->a); ?> -===DONE=== --EXPECTF-- array(4) { [0]=> @@ -135,11 +134,11 @@ ObjectOne::offsetGet(4th) int(4) ObjectOne::offsetGet(5th) -Notice: Undefined index: 5th in %sarray_access_001.php on line %d +Warning: Undefined array key "5th" in %s on line %d NULL ObjectOne::offsetGet(6) -Notice: Undefined offset: 6 in %sarray_access_001.php on line %d +Warning: Undefined array key 6 in %s on line %d NULL ===offsetSet=== WRITE 1 @@ -195,4 +194,3 @@ array(4) { [6]=> string(9) "changed 6" } -===DONE=== diff --git a/tests/classes/array_access_002.phpt b/tests/classes/array_access_002.phpt index 5e101914c0..7217eaf8ba 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; @@ -82,7 +82,6 @@ unset($obj['8th']); var_dump($obj->a); ?> -===DONE=== --EXPECTF-- array(4) { [0]=> @@ -135,11 +134,11 @@ ObjectOne::offsetGet(4th) int(4) ObjectOne::offsetGet(5th) -Notice: Undefined index: 5th in %sarray_access_002.php on line %d +Warning: Undefined array key "5th" in %s on line %d NULL ObjectOne::offsetGet(6) -Notice: Undefined offset: 6 in %sarray_access_002.php on line %d +Warning: Undefined array key 6 in %s on line %d NULL ===offsetSet=== WRITE 1 @@ -195,4 +194,3 @@ array(4) { [6]=> string(9) "changed 6" } -===DONE=== diff --git a/tests/classes/array_access_003.phpt b/tests/classes/array_access_003.phpt index 8924d1575f..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; @@ -45,7 +45,6 @@ $obj[2]++; var_dump($obj[2]); ?> -===DONE=== --EXPECTF-- ObjectOne::offsetGet(1) string(6) "fooBar" @@ -56,4 +55,3 @@ ObjectOne::offsetGet(2) Notice: Indirect modification of overloaded element of ObjectOne has no effect in %sarray_access_003.php on line 39 ObjectOne::offsetGet(2) int(1) -===DONE=== diff --git a/tests/classes/array_access_004.phpt b/tests/classes/array_access_004.phpt index 22566937f2..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; @@ -43,7 +43,6 @@ $obj[2]++; var_dump($obj[2]); ?> -===DONE=== --EXPECTF-- ObjectOne::offsetGet(1) string(6) "fooBar" @@ -54,4 +53,3 @@ ObjectOne::offsetGet(2) Notice: Indirect modification of overloaded element of ObjectOne has no effect in %sarray_access_004.php on line 39 ObjectOne::offsetGet(2) int(1) -===DONE=== diff --git a/tests/classes/array_access_005.phpt b/tests/classes/array_access_005.phpt index 92ddeccaf2..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; @@ -52,7 +52,6 @@ $people[0]['name'] = 'JoeFooBar'; var_dump($people[0]['name']); ?> -===DONE=== --EXPECTF-- string(3) "Joe" string(6) "JoeFoo" @@ -74,4 +73,3 @@ string(6) "JoeFoo" Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_005.php on line 48 string(6) "JoeFoo" -===DONE=== 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 801c8e846c..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; @@ -42,7 +42,6 @@ $a[2] = 3; $a[] = 4; $a->dump(); ?> -===DONE=== --EXPECT-- array(4) { [0]=> @@ -54,4 +53,3 @@ array(4) { [3]=> int(4) } -===DONE=== diff --git a/tests/classes/array_access_008.phpt b/tests/classes/array_access_008.phpt index 0bb793b2b3..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; @@ -48,7 +48,6 @@ $people[0]['name'] .= 'Baz'; var_dump($people[0]['name']); ?> -===DONE=== --EXPECTF-- string(3) "Foo" string(6) "FooBar" @@ -64,4 +63,3 @@ string(3) "Foo" Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 44 string(3) "Foo" -===DONE=== diff --git a/tests/classes/array_access_009.phpt b/tests/classes/array_access_009.phpt index 7da9084d24..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; @@ -122,7 +122,6 @@ $people[0]['name'] = 'BlaBla'; var_dump($people[0]['name']); ?> -===DONE=== --EXPECTF-- string(3) "Foo" string(6) "FooBar" @@ -187,4 +186,3 @@ ArrayProxy::offsetSet(0, name, BlaBla) ArrayProxy::__construct(0) ArrayProxy::offsetGet(0, name) string(6) "BlaBla" -===DONE=== diff --git a/tests/classes/array_access_010.phpt b/tests/classes/array_access_010.phpt index 3df64fcc7e..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; @@ -95,8 +95,6 @@ $people[0]['name'] = 'BlaBla'; var_dump($people[0]['name']); ?> -===DONE=== -<?php exit(0); ?> --EXPECTF-- string(3) "Foo" string(6) "FooBar" @@ -165,4 +163,3 @@ ArrayReferenceProxy::offsetSet(Array, name, BlaBla) ArrayReferenceProxy::__construct(Array) ArrayReferenceProxy::offsetGet(Array, name) string(6) "BlaBla" -===DONE=== diff --git a/tests/classes/array_access_011.phpt b/tests/classes/array_access_011.phpt index 36269c0b41..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; @@ -104,8 +104,6 @@ $people[0]['name'] = 'BlaBla'; var_dump($people[0]['name']); ?> -===DONE=== -<?php exit(0); ?> --EXPECTF-- string(3) "Foo" string(6) "FooBar" @@ -184,4 +182,3 @@ ArrayAccessReferenceProxy::offsetSet(0, name, BlaBla) ArrayAccessReferenceProxy::__construct(0) ArrayAccessReferenceProxy::offsetGet(0, name) string(6) "BlaBla" -===DONE=== diff --git a/tests/classes/array_access_012.phpt b/tests/classes/array_access_012.phpt index 3cd3dceb8a..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(); @@ -28,7 +28,6 @@ $data['element'] = &$test; ?> ===DONE=== -<?php exit(0); ?> --EXPECTF-- Notice: Indirect modification of overloaded element of ArrayAccessImpl has no effect in %sarray_access_012.php on line 24 diff --git a/tests/classes/array_access_013.phpt b/tests/classes/array_access_013.phpt index 206d9d5403..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,17 +42,15 @@ catch(Exception $e) try { - unset($t[0]); + unset($t[0]); } catch(Exception $e) { echo "Caught in " . $e->getMessage() . "()\n"; } ?> -===DONE=== --EXPECT-- Caught in Test::offsetExists() Caught in Test::offsetGet() Caught in Test::offsetSet() Caught in Test::offsetUnset() -===DONE=== 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 350e1e0f12..7fe6757d68 100644 --- a/tests/classes/autoload_001.phpt +++ b/tests/classes/autoload_001.phpt @@ -2,21 +2,19 @@ ZE2 Autoload and class_exists --SKIPIF-- <?php - if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); + if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); ?> --FILE-- <?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')); ?> -===DONE=== --EXPECT-- autoload(autoload_root) bool(true) -===DONE=== diff --git a/tests/classes/autoload_002.phpt b/tests/classes/autoload_002.phpt index 1b049c3414..32321b3bfe 100644 --- a/tests/classes/autoload_002.phpt +++ b/tests/classes/autoload_002.phpt @@ -2,24 +2,22 @@ ZE2 Autoload and get_class_methods --SKIPIF-- <?php - if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); + if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); ?> --FILE-- <?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')); ?> -===DONE=== --EXPECT-- autoload(autoload_root) array(1) { [0]=> string(12) "testFunction" } -===DONE=== diff --git a/tests/classes/autoload_003.phpt b/tests/classes/autoload_003.phpt index 52fd264d46..a81d56fe6c 100644 --- a/tests/classes/autoload_003.phpt +++ b/tests/classes/autoload_003.phpt @@ -2,22 +2,20 @@ ZE2 Autoload and derived classes --SKIPIF-- <?php - if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); + if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); ?> --FILE-- <?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')); ?> -===DONE=== --EXPECT-- autoload(autoload_root) autoload(autoload_derived) bool(true) -===DONE=== diff --git a/tests/classes/autoload_004.phpt b/tests/classes/autoload_004.phpt index 6f24f157d2..a5dd5e393c 100644 --- a/tests/classes/autoload_004.phpt +++ b/tests/classes/autoload_004.phpt @@ -2,25 +2,23 @@ ZE2 Autoload and recursion --SKIPIF-- <?php - if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); + if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); ?> --FILE-- <?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')); ?> -===DONE=== --EXPECT-- bool(false) bool(false) autoload(autoload_root) autoload(autoload_derived) bool(true) -===DONE=== diff --git a/tests/classes/autoload_005.phpt b/tests/classes/autoload_005.phpt index 67dd23daf7..16f55b9363 100644 --- a/tests/classes/autoload_005.phpt +++ b/tests/classes/autoload_005.phpt @@ -2,15 +2,15 @@ ZE2 Autoload from destructor --SKIPIF-- <?php - if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); + if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); ?> --FILE-- <?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)); @@ -29,7 +29,6 @@ $o = new Test; unset($o); ?> -===DONE=== --EXPECTF-- bool(false) bool(false) @@ -40,4 +39,3 @@ autoload(autoload_root) autoload(autoload_derived) object(autoload_derived)#%d (0) { } -===DONE=== diff --git a/tests/classes/autoload_006.phpt b/tests/classes/autoload_006.phpt index 746cbee3f6..fd3c85580f 100644 --- a/tests/classes/autoload_006.phpt +++ b/tests/classes/autoload_006.phpt @@ -2,14 +2,14 @@ ZE2 Autoload from destructor --SKIPIF-- <?php - if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); + if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); ?> --FILE-- <?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)); @@ -24,7 +24,6 @@ var_dump(interface_exists('autoload_interface', false)); var_dump(class_exists('autoload_implements', false)); ?> -===DONE=== --EXPECTF-- bool(false) bool(false) @@ -35,4 +34,3 @@ object(autoload_implements)#%d (0) { bool(true) bool(true) bool(true) -===DONE=== diff --git a/tests/classes/autoload_009.phpt b/tests/classes/autoload_009.phpt index 63f1ea9801..6903d9d8ba 100644 --- a/tests/classes/autoload_009.phpt +++ b/tests/classes/autoload_009.phpt @@ -13,7 +13,7 @@ function f(UndefClass $x) f(new stdClass); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of UndefClass, instance of stdClass given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: f(): Argument #1 ($x) must be of type UndefClass, stdClass given, called in %s on line %d and defined in %s:%d Stack trace: #0 %s(%d): f(Object(stdClass)) #1 {main} diff --git a/tests/classes/autoload_010.phpt b/tests/classes/autoload_010.phpt index b8aa660730..8b00c9c835 100644 --- a/tests/classes/autoload_010.phpt +++ b/tests/classes/autoload_010.phpt @@ -14,7 +14,7 @@ class C implements UndefI --EXPECTF-- In autoload: string(6) "UndefI" -Fatal error: Uncaught Error: Interface 'UndefI' not found in %s:%d +Fatal error: Uncaught Error: Interface "UndefI" not found in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/autoload_011.phpt b/tests/classes/autoload_011.phpt index d255a0d23b..727c13c827 100644 --- a/tests/classes/autoload_011.phpt +++ b/tests/classes/autoload_011.phpt @@ -14,7 +14,7 @@ class C extends UndefBase --EXPECTF-- In autoload: string(9) "UndefBase" -Fatal error: Uncaught Error: Class 'UndefBase' not found in %s:%d +Fatal error: Uncaught Error: Class "UndefBase" not found in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/autoload_012.phpt b/tests/classes/autoload_012.phpt index 4fc41c85f5..c8dc35b6f1 100644 --- a/tests/classes/autoload_012.phpt +++ b/tests/classes/autoload_012.phpt @@ -3,12 +3,15 @@ Ensure callback methods in unknown classes trigger autoload. --FILE-- <?php spl_autoload_register(function ($name) { - echo "In autoload: "; - var_dump($name); + echo "In autoload: "; + var_dump($name); }); -call_user_func("UndefC::test"); +try { + call_user_func("UndefC::test"); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- +--EXPECT-- In autoload: string(6) "UndefC" - -Warning: call_user_func() expects parameter 1 to be a valid callback, class 'UndefC' not found in %s on line %d +call_user_func(): Argument #1 ($function) must be a valid callback, class "UndefC" not found diff --git a/tests/classes/autoload_013.phpt b/tests/classes/autoload_013.phpt index c85c18ec15..1b9302747e 100644 --- a/tests/classes/autoload_013.phpt +++ b/tests/classes/autoload_013.phpt @@ -16,4 +16,4 @@ catch (ReflectionException $e) { ?> --EXPECT-- In autoload: string(6) "UndefC" -Class UndefC does not exist +Class "UndefC" does not exist diff --git a/tests/classes/autoload_014.phpt b/tests/classes/autoload_014.phpt index 827224aaa5..13f16f8264 100644 --- a/tests/classes/autoload_014.phpt +++ b/tests/classes/autoload_014.phpt @@ -16,4 +16,4 @@ catch (ReflectionException $e) { ?> --EXPECT-- In autoload: string(6) "UndefC" -Class UndefC does not exist +Class "UndefC" does not exist diff --git a/tests/classes/autoload_015.phpt b/tests/classes/autoload_015.phpt index 9f023d5be5..9aa862a783 100644 --- a/tests/classes/autoload_015.phpt +++ b/tests/classes/autoload_015.phpt @@ -16,4 +16,4 @@ catch (ReflectionException $e) { ?> --EXPECT-- In autoload: string(6) "UndefC" -Class UndefC does not exist +Class "UndefC" does not exist diff --git a/tests/classes/autoload_016.phpt b/tests/classes/autoload_016.phpt index ceb8ce6bbc..13454d018c 100644 --- a/tests/classes/autoload_016.phpt +++ b/tests/classes/autoload_016.phpt @@ -17,4 +17,4 @@ $rc->getProperty("UndefC::p"); ?> --EXPECT-- In autoload: string(6) "undefc" -Class undefc does not exist +Class "undefc" does not exist diff --git a/tests/classes/autoload_017.phpt b/tests/classes/autoload_017.phpt index a1485f3aeb..ef327ed376 100644 --- a/tests/classes/autoload_017.phpt +++ b/tests/classes/autoload_017.phpt @@ -17,4 +17,4 @@ try { ?> --EXPECT-- In autoload: string(6) "UndefI" -Interface UndefI does not exist +Interface "UndefI" does not exist diff --git a/tests/classes/autoload_021.phpt b/tests/classes/autoload_021.phpt index f3dd8ff26d..859a911669 100644 --- a/tests/classes/autoload_021.phpt +++ b/tests/classes/autoload_021.phpt @@ -3,14 +3,14 @@ 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; echo "BUG\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Class '../BUG' not found in %sautoload_021.php:6 +Fatal error: Uncaught Error: Class "../BUG" not found in %s:%d Stack trace: #0 {main} thrown in %sautoload_021.php on line 6 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..ea7ae1ed9a 100644 --- a/tests/classes/bug26737.phpt +++ b/tests/classes/bug26737.phpt @@ -4,19 +4,19 @@ 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); var_dump(str_replace("\0", '\0', $data)); ?> --EXPECTF-- -Notice: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d -string(130) "O:3:"foo":4:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";s:7:"no_such";N;}" +Warning: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d +string(114) "O:3:"foo":3:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";}" diff --git a/tests/classes/bug27468.phpt b/tests/classes/bug27468.phpt index 58a7b6cb16..d590683c82 100644 --- a/tests/classes/bug27468.phpt +++ b/tests/classes/bug27468.phpt @@ -3,15 +3,15 @@ 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'; ?> --EXPECTF-- -Notice: Undefined property: foo::$x in %sbug27468.php on line 4 +Warning: Undefined property: foo::$x in %s on line %d -Warning: Invalid argument supplied for foreach() in %sbug27468.php on line 4 +Warning: foreach() argument must be of type array|object, null given in %sbug27468.php on line 4 OK diff --git a/tests/classes/bug27504.phpt b/tests/classes/bug27504.phpt index ba44806bfe..b6df46920a 100644 --- a/tests/classes/bug27504.phpt +++ b/tests/classes/bug27504.phpt @@ -2,27 +2,30 @@ Bug #27504 (call_user_func_array allows calling of private/protected methods) --FILE-- <?php - class foo { - function __construct () { - $this->bar('1'); - } - private function bar ( $param ) { - echo 'Called function foo:bar('.$param.')'."\n"; - } - } +class foo { + function __construct () { + $this->bar('1'); + } + private function bar ( $param ) { + echo 'Called function foo:bar('.$param.')'."\n"; + } +} - $foo = new foo(); +$foo = new foo(); - call_user_func_array( array( $foo , 'bar' ) , array( '2' ) ); +try { + call_user_func_array( array( $foo , 'bar' ) , array( '2' ) ); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} +try { + $foo->bar('3'); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} - $foo->bar('3'); ?> ---EXPECTF-- +--EXPECT-- Called function foo:bar(1) - -Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method foo::bar() in %s on line %d - -Fatal error: Uncaught Error: Call to private method foo::bar() from context '' in %s:%d -Stack trace: -#0 {main} - thrown in %s on line %d +call_user_func_array(): Argument #1 ($function) must be a valid callback, cannot access private method foo::bar() +Call to private method foo::bar() from global scope diff --git a/tests/classes/bug75765.phpt b/tests/classes/bug75765.phpt index 650ca65e96..dc283ae5fe 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; } ?> @@ -16,7 +16,7 @@ try { bool(false) bool(false) -Fatal error: Uncaught Error: Class 'B' not found in %s:%d +Fatal error: Uncaught Error: Class "B" not found in %s:%d Stack trace: #0 {main} thrown in %s on line %d 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_005.phpt b/tests/classes/clone_005.phpt index f759221480..b8e3870a8d 100644 --- a/tests/classes/clone_005.phpt +++ b/tests/classes/clone_005.phpt @@ -6,7 +6,7 @@ abstract class base { public $a = 'base'; // disallow cloning once forever - final private function __clone() {} + final protected function __clone() {} } class test extends base { 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_001.phpt b/tests/classes/constants_basic_001.phpt index 6a281e7d32..18ac2416f5 100644 --- a/tests/classes/constants_basic_001.phpt +++ b/tests/classes/constants_basic_001.phpt @@ -9,8 +9,6 @@ Class constant declarations class C { - const c0 = UNDEFINED; - const c1 = 1, c2 = 1.5; const c3 = + 1, c4 = + 1.5; const c5 = -1, c6 = -1.5; @@ -32,7 +30,6 @@ Class constant declarations } echo "\nAttempt to access various kinds of class constants:\n"; - var_dump(C::c0); var_dump(C::c1); var_dump(C::c2); var_dump(C::c3); @@ -58,19 +55,16 @@ Class constant declarations echo "\nYou should not see this."; ?> --EXPECTF-- -Notice: Undefined variable: undef in %s on line 5 +Warning: Undefined variable $undef in %s on line %d Attempt to access various kinds of class constants: - -Warning: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' (this will throw an Error in a future version of PHP) in %s on line %d -string(9) "UNDEFINED" int(1) float(1.5) int(1) float(1.5) int(-1) float(-1.5) -int(15) +int(13) string(%d) "%s" string(1) "C" string(0) "" @@ -85,7 +79,7 @@ string(6) "hello2" Expecting fatal error: -Fatal error: Uncaught Error: Undefined class constant 'c19' in %s:53 +Fatal error: Uncaught Error: Undefined constant C::c19 in %s:%d Stack trace: #0 {main} - thrown in %s on line 53 + thrown in %s on line %d diff --git a/tests/classes/constants_basic_002.phpt b/tests/classes/constants_basic_002.phpt index def661ec45..88c66aaee8 100644 --- a/tests/classes/constants_basic_002.phpt +++ b/tests/classes/constants_basic_002.phpt @@ -23,7 +23,7 @@ string(5) "hello" Fail to read class constant from instance. -Notice: Undefined property: aclass::$myConst in %s on line 12 +Warning: Undefined property: aclass::$myConst in %s on line %d NULL Class constant not visible in object var_dump. 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_error_003.phpt b/tests/classes/constants_error_003.phpt index fa7984f06e..afc199555b 100644 --- a/tests/classes/constants_error_003.phpt +++ b/tests/classes/constants_error_003.phpt @@ -16,4 +16,7 @@ Basic class support - attempting to pass a class constant by reference. var_dump(aclass::myConst); ?> --EXPECTF-- -Fatal error: Only variables can be passed by reference in %s on line 12 +Fatal error: Uncaught Error: f(): Argument #1 ($a) cannot be passed by reference in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/tests/classes/constants_error_004.phpt b/tests/classes/constants_error_004.phpt index b7f668909b..3d675652ba 100644 --- a/tests/classes/constants_error_004.phpt +++ b/tests/classes/constants_error_004.phpt @@ -10,7 +10,7 @@ Class constant whose initial value references a non-existent class $a = new C(); ?> --EXPECTF-- -Fatal error: Uncaught Error: Class 'D' not found in %s:%d +Fatal error: Uncaught Error: Class "D" not found in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/constants_scope_001.phpt b/tests/classes/constants_scope_001.phpt index 7adf3f8681..54fc8c4a00 100644 --- a/tests/classes/constants_scope_001.phpt +++ b/tests/classes/constants_scope_001.phpt @@ -4,21 +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 "FATAL = " . FATAL . "\n"; - 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; } } @@ -27,9 +26,7 @@ ErrorCodes::print_fatal_error_codes(); ErrorCodesDerived::print_fatal_error_codes(); ?> ---EXPECTF-- -Warning: Use of undefined constant FATAL - assumed 'FATAL' (this will throw an Error in a future version of PHP) in %sconstants_scope_001.php on line %d -FATAL = FATAL +--EXPECT-- self::FATAL = Fatal error self::FATAL = Worst error parent::FATAL = Fatal error 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 4e0ecb1aa2..38fa8d614e 100644 --- a/tests/classes/constants_visibility_002.phpt +++ b/tests/classes/constants_visibility_002.phpt @@ -3,22 +3,25 @@ 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(); (new A())->constDump(); -constant('A::protectedConst'); +try { + constant('A::protectedConst'); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- +--EXPECT-- string(14) "protectedConst" string(14) "protectedConst" - -Warning: constant(): Couldn't find constant A::protectedConst in %s on line %d +Cannot access protected constant A::protectedConst diff --git a/tests/classes/constants_visibility_003.phpt b/tests/classes/constants_visibility_003.phpt index 7c961695ed..7650ca80c8 100644 --- a/tests/classes/constants_visibility_003.phpt +++ b/tests/classes/constants_visibility_003.phpt @@ -3,22 +3,25 @@ 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(); (new A())->constDump(); -constant('A::privateConst'); +try { + constant('A::privateConst'); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- +--EXPECT-- string(12) "privateConst" string(12) "privateConst" - -Warning: constant(): Couldn't find constant A::privateConst in %s on line %d +Cannot access private constant A::privateConst diff --git a/tests/classes/constants_visibility_004.phpt b/tests/classes/constants_visibility_004.phpt index 93acacf3c9..3872bc2829 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(); @@ -21,7 +21,7 @@ B::checkConstants(); int(1) int(2) -Fatal error: Uncaught Error: Undefined class constant 'Z' in %s:11 +Fatal error: Uncaught Error: Undefined constant B::Z in %s:%d Stack trace: #0 %s(15): B::checkConstants() #1 {main} 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_008.phpt b/tests/classes/constants_visibility_008.phpt index fe1b0237f1..6a489a9326 100644 --- a/tests/classes/constants_visibility_008.phpt +++ b/tests/classes/constants_visibility_008.phpt @@ -8,5 +8,6 @@ class Foo private const BAR = 1; } echo (int)defined('Foo::BAR'); +?> --EXPECT-- 0 diff --git a/tests/classes/constants_visibility_error_001.phpt b/tests/classes/constants_visibility_error_001.phpt index 397dd24882..368d828a17 100644 --- a/tests/classes/constants_visibility_error_001.phpt +++ b/tests/classes/constants_visibility_error_001.phpt @@ -3,14 +3,14 @@ Class private constant visibility error --FILE-- <?php class A { - private const privateConst = 'privateConst'; + private const privateConst = 'privateConst'; } var_dump(A::privateConst); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot access private const A::privateConst in %s:6 +Fatal error: Uncaught Error: Cannot access private constant A::privateConst in %s:6 Stack trace: #0 {main} thrown in %s on line 6 diff --git a/tests/classes/constants_visibility_error_002.phpt b/tests/classes/constants_visibility_error_002.phpt index 2980b52c37..c417b947e5 100644 --- a/tests/classes/constants_visibility_error_002.phpt +++ b/tests/classes/constants_visibility_error_002.phpt @@ -3,14 +3,14 @@ Class protected constant visibility error --FILE-- <?php class A { - protected const protectedConst = 'protectedConst'; + protected const protectedConst = 'protectedConst'; } var_dump(A::protectedConst); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot access protected const A::protectedConst in %s:6 +Fatal error: Uncaught Error: Cannot access protected constant A::protectedConst in %s:6 Stack trace: #0 {main} thrown in %s on line 6 diff --git a/tests/classes/constants_visibility_error_003.phpt b/tests/classes/constants_visibility_error_003.phpt index 6f62069c2e..44b1e1c5f9 100644 --- a/tests/classes/constants_visibility_error_003.phpt +++ b/tests/classes/constants_visibility_error_003.phpt @@ -4,11 +4,12 @@ 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..72da6446ca 100644 --- a/tests/classes/constants_visibility_error_004.phpt +++ b/tests/classes/constants_visibility_error_004.phpt @@ -4,11 +4,12 @@ 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_failure.phpt b/tests/classes/ctor_failure.phpt index f86b0cc5f8..9497482892 100644 --- a/tests/classes/ctor_failure.phpt +++ b/tests/classes/ctor_failure.phpt @@ -26,8 +26,6 @@ catch (Exception $e) } ?> -===DONE=== --EXPECT-- Test::__construct(Hello) Caught Exception(Hello) -===DONE=== 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_name_clash.phpt b/tests/classes/ctor_name_clash.phpt deleted file mode 100644 index e6518775ff..0000000000 --- a/tests/classes/ctor_name_clash.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -ZE2 The child class can re-use the parent class name for a function member ---FILE-- -<?php -class base { - function base() { - echo __CLASS__."::".__FUNCTION__."\n"; - } -} - -class derived extends base { - function base() { - echo __CLASS__."::".__FUNCTION__."\n"; - } -} - -$obj = new derived(); -$obj->base(); -?> ---EXPECTF-- -Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; base has a deprecated constructor in %s on line %d -base::base -derived::base 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 0da6e642af..0f51a21a09 100644 --- a/tests/classes/destructor_and_exceptions.phpt +++ b/tests/classes/destructor_and_exceptions.phpt @@ -5,56 +5,54 @@ 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"; } ?> -===DONE=== --EXPECT-- FailClass::__destruct Caught: FailClass FatalException::__construct FailClass::__destruct Caught Exception: FailClass -===DONE=== 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..6fee6e3be7 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 { @@ -19,7 +19,7 @@ unset($obj); ?> ===DONE=== --EXPECTF-- -Fatal error: Uncaught Error: Call to private Derived::__destruct() from context '' in %sdestructor_visibility_001.php:%d +Fatal error: Uncaught Error: Call to private Derived::__destruct() from global scope in %s:%d Stack trace: #0 {main} thrown in %sdestructor_visibility_001.php on line %d diff --git a/tests/classes/destructor_visibility_002.phpt b/tests/classes/destructor_visibility_002.phpt index 96cf275a7c..0d4cedcf79 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 { @@ -16,7 +16,7 @@ $obj = new Derived; ?> ===DONE=== ---EXPECTF-- +--EXPECT-- ===DONE=== -Warning: Call to private Derived::__destruct() from context '' during shutdown ignored in Unknown on line %d +Warning: Call to private Derived::__destruct() from global scope during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/destructor_visibility_003.phpt b/tests/classes/destructor_visibility_003.phpt index c0235cd1e3..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; @@ -20,7 +20,5 @@ $obj = new Derived; unset($obj); // Derived::__destruct is being called not Base::__destruct ?> -===DONE=== --EXPECT-- Derived::__destruct -===DONE=== 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..82c6c5c28a 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() { @@ -95,4 +95,4 @@ int(1) int(1) Done -Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0 +Warning: Call to protected test::__destruct() from global scope during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/factory_and_singleton_003.phpt b/tests/classes/factory_and_singleton_003.phpt index cf08fdb717..1e111046bf 100644 --- a/tests/classes/factory_and_singleton_003.phpt +++ b/tests/classes/factory_and_singleton_003.phpt @@ -13,7 +13,7 @@ $obj = new test; echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Call to protected test::__construct() from invalid context in %s:%d +Fatal error: Uncaught Error: Call to protected test::__construct() from global scope in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/factory_and_singleton_004.phpt b/tests/classes/factory_and_singleton_004.phpt index 41e278bdb9..f813f8e604 100644 --- a/tests/classes/factory_and_singleton_004.phpt +++ b/tests/classes/factory_and_singleton_004.phpt @@ -13,7 +13,7 @@ $obj = new test; echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Call to private test::__construct() from invalid context in %s:%d +Fatal error: Uncaught Error: Call to private test::__construct() from global scope in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/factory_and_singleton_005.phpt b/tests/classes/factory_and_singleton_005.phpt index 78d7e05f0b..41914bf0e0 100644 --- a/tests/classes/factory_and_singleton_005.phpt +++ b/tests/classes/factory_and_singleton_005.phpt @@ -14,7 +14,7 @@ $obj = NULL; echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Call to protected test::__destruct() from context '' in %sfactory_and_singleton_005.php:%d +Fatal error: Uncaught Error: Call to protected test::__destruct() from global scope in %s:%d Stack trace: #0 {main} thrown in %sfactory_and_singleton_005.php on line %d diff --git a/tests/classes/factory_and_singleton_006.phpt b/tests/classes/factory_and_singleton_006.phpt index b11c9f05d4..596a0792cd 100644 --- a/tests/classes/factory_and_singleton_006.phpt +++ b/tests/classes/factory_and_singleton_006.phpt @@ -14,7 +14,7 @@ $obj = NULL; echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Call to private test::__destruct() from context '' in %sfactory_and_singleton_006.php:%d +Fatal error: Uncaught Error: Call to private test::__destruct() from global scope in %s:%d Stack trace: #0 {main} thrown in %sfactory_and_singleton_006.php on line %d diff --git a/tests/classes/factory_and_singleton_007.phpt b/tests/classes/factory_and_singleton_007.phpt index 4c15c38383..2c35090eed 100644 --- a/tests/classes/factory_and_singleton_007.phpt +++ b/tests/classes/factory_and_singleton_007.phpt @@ -15,7 +15,7 @@ $obj = NULL; echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Call to protected test::__clone() from context '' in %s:%d +Fatal error: Uncaught Error: Call to protected test::__clone() from global scope in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/factory_and_singleton_008.phpt b/tests/classes/factory_and_singleton_008.phpt index 1a87833169..2b2c0721c7 100644 --- a/tests/classes/factory_and_singleton_008.phpt +++ b/tests/classes/factory_and_singleton_008.phpt @@ -15,7 +15,7 @@ $obj = NULL; echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Call to private test::__clone() from context '' in %s:%d +Fatal error: Uncaught Error: Call to private test::__clone() from global scope in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/factory_and_singleton_009.phpt b/tests/classes/factory_and_singleton_009.phpt index c1cfcbdcdf..6f2014f48c 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"; } } @@ -16,4 +16,4 @@ $obj = new test; --EXPECT-- ===DONE=== -Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0 +Warning: Call to protected test::__destruct() from global scope during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/factory_and_singleton_010.phpt b/tests/classes/factory_and_singleton_010.phpt index 9466fe55e4..82fa720b16 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"; } } @@ -16,4 +16,4 @@ $obj = new test; --EXPECT-- ===DONE=== -Warning: Call to private test::__destruct() from context '' during shutdown ignored in Unknown on line 0 +Warning: Call to private test::__destruct() from global scope during shutdown ignored in Unknown on line 0 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 acf20918fd..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,15 +16,11 @@ class Works extends Base class Extended extends Base { - public function Extended() - { - } + public function __construct() + { + } } -ReflectionClass::export('Extended'); - ?> --EXPECTF-- -Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Extended has a deprecated constructor in %s on line %d - -Fatal error: Cannot override final Base::__construct() with Extended::Extended() in %sfinal_ctor1.php on line %d +Fatal error: Cannot override final method Base::__construct() in %s on line %d diff --git a/tests/classes/final_ctor2.phpt b/tests/classes/final_ctor2.phpt deleted file mode 100644 index 37fcac29a9..0000000000 --- a/tests/classes/final_ctor2.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -ZE2 cannot override final old style ctor ---FILE-- -<?php - -class Base -{ - public final function Base() - { - } -} - -class Works extends Base -{ -} - -class Extended extends Base -{ - public function __construct() - { - } -} - -ReflectionClass::export('Extended'); - -?> ---EXPECTF-- -Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Base has a deprecated constructor in %s on line %d - -Fatal error: Cannot override final Base::Base() with Extended::__construct() in %sfinal_ctor2.php on line %d diff --git a/tests/classes/final_ctor3.phpt b/tests/classes/final_ctor3.phpt deleted file mode 100644 index b0156ef294..0000000000 --- a/tests/classes/final_ctor3.phpt +++ /dev/null @@ -1,15 +0,0 @@ ---TEST-- -Ensure implicit final inherited old-style constructor cannot be overridden. ---FILE-- -<?php - class A { - final function A() { } - } - class B extends A { - function A() { } - } -?> ---EXPECTF-- -Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d - -Fatal error: Cannot override final method A::A() in %s on line 6 diff --git a/tests/classes/final_private_ctor.phpt b/tests/classes/final_private_ctor.phpt new file mode 100644 index 0000000000..37dbe56c31 --- /dev/null +++ b/tests/classes/final_private_ctor.phpt @@ -0,0 +1,21 @@ +--TEST-- +Final private constructors cannot be overridden +--FILE-- +<?php + +class Base +{ + private final function __construct() + { + } +} +class Extended extends Base +{ + public function __construct() + { + } +} + +?> +--EXPECTF-- +Fatal error: Cannot override final method Base::__construct() in %s on line %d 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/implicit_instantiation_001.phpt b/tests/classes/implicit_instantiation_001.phpt deleted file mode 100644 index 495a8a1e35..0000000000 --- a/tests/classes/implicit_instantiation_001.phpt +++ /dev/null @@ -1,156 +0,0 @@ ---TEST-- -Implicit object instantiation when accessing properties of non-object. ---FILE-- -<?php -class C { - // These values get implicitly converted to objects - public $boolFalse = false; - public $emptyString = ''; - public $null = null; - - // These values do not get implicitly converted to objects - public $boolTrue = true; - public $nonEmptyString = 'hello'; - public $intZero = 0; -} - -$c = new C; -foreach($c as $name => $value) { - echo "\n\n---( \$c->$name )---"; - echo "\n --> Attempting implicit conversion to object using increment...\n"; - $c->$name->prop++; - $c->$name = $value; // reset value in case implicit conversion was successful - - echo "\n --> Attempting implicit conversion to object using assignment...\n"; - $c->$name->prop = "Implicit instantiation!"; - $c->$name = $value; // reset value in case implicit conversion was successful - - echo "\n --> Attempting implicit conversion to object using combined assignment...\n"; - $c->$name->prop .= " Implicit instantiation!"; -} - -echo "\n\n\n --> Resulting object:"; -var_dump($c); - -?> ---EXPECTF-- ----( $c->boolFalse )--- - --> Attempting implicit conversion to object using increment... - -Warning: Creating default object from empty value in %s on line 18 - -Notice: Undefined property: stdClass::$prop in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Warning: Creating default object from empty value in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Warning: Creating default object from empty value in %s on line 26 - -Notice: Undefined property: stdClass::$prop in %s on line 26 - - ----( $c->emptyString )--- - --> Attempting implicit conversion to object using increment... - -Warning: Creating default object from empty value in %s on line 18 - -Notice: Undefined property: stdClass::$prop in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Warning: Creating default object from empty value in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Warning: Creating default object from empty value in %s on line 26 - -Notice: Undefined property: stdClass::$prop in %s on line 26 - - ----( $c->null )--- - --> Attempting implicit conversion to object using increment... - -Warning: Creating default object from empty value in %s on line 18 - -Notice: Undefined property: stdClass::$prop in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Warning: Creating default object from empty value in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Warning: Creating default object from empty value in %s on line 26 - -Notice: Undefined property: stdClass::$prop in %s on line 26 - - ----( $c->boolTrue )--- - --> Attempting implicit conversion to object using increment... - -Warning: Attempt to %s property 'prop' of non-object in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Warning: Attempt to assign property 'prop' of non-object in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Warning: Attempt to assign property 'prop' of non-object in %s on line 26 - - ----( $c->nonEmptyString )--- - --> Attempting implicit conversion to object using increment... - -Warning: Attempt to %s property 'prop' of non-object in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Warning: Attempt to assign property 'prop' of non-object in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Warning: Attempt to assign property 'prop' of non-object in %s on line 26 - - ----( $c->intZero )--- - --> Attempting implicit conversion to object using increment... - -Warning: Attempt to %s property 'prop' of non-object in %s on line 18 - - --> Attempting implicit conversion to object using assignment... - -Warning: Attempt to assign property 'prop' of non-object in %s on line 22 - - --> Attempting implicit conversion to object using combined assignment... - -Warning: Attempt to assign property 'prop' of non-object in %s on line 26 - - - - --> Resulting object:object(C)#%d (6) { - ["boolFalse"]=> - object(stdClass)#%d (1) { - ["prop"]=> - string(24) " Implicit instantiation!" - } - ["emptyString"]=> - object(stdClass)#%d (1) { - ["prop"]=> - string(24) " Implicit instantiation!" - } - ["null"]=> - object(stdClass)#%d (1) { - ["prop"]=> - string(24) " Implicit instantiation!" - } - ["boolTrue"]=> - bool(true) - ["nonEmptyString"]=> - string(5) "hello" - ["intZero"]=> - int(0) -} 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..08ab57552e 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"; } @@ -43,6 +43,7 @@ $bar1->b = 3; $bar1->c = 12; $bar1->display(); echo $bar1->mul()."\n"; +?> --EXPECT-- This is class foo a = 2 diff --git a/tests/classes/inheritance_002.phpt b/tests/classes/inheritance_002.phpt deleted file mode 100644 index f88c0996bd..0000000000 --- a/tests/classes/inheritance_002.phpt +++ /dev/null @@ -1,74 +0,0 @@ ---TEST-- -ZE2 Constructor precedence ---FILE-- -<?php -class Base_php4 { - function Base_php4() { - var_dump('Base constructor'); - } -} - -class Child_php4 extends Base_php4 { - function Child_php4() { - var_dump('Child constructor'); - parent::Base_php4(); - } -} - -class Base_php5 { - function __construct() { - var_dump('Base constructor'); - } - } - -class Child_php5 extends Base_php5 { - function __construct() { - var_dump('Child constructor'); - parent::__construct(); - } - } - -class Child_mx1 extends Base_php4 { - function __construct() { - var_dump('Child constructor'); - parent::Base_php4(); - } -} - -class Child_mx2 extends Base_php5 { - function Child_mx2() { - var_dump('Child constructor'); - parent::__construct(); - } -} - -echo "### PHP 4 style\n"; -$c4= new Child_php4(); - -echo "### PHP 5 style\n"; -$c5= new Child_php5(); - -echo "### Mixed style 1\n"; -$cm= new Child_mx1(); - -echo "### Mixed style 2\n"; -$cm= new Child_mx2(); -?> ---EXPECTF-- -Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Base_php4 has a deprecated constructor in %s on line %d - -Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Child_php4 has a deprecated constructor in %s on line %d - -Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Child_mx2 has a deprecated constructor in %s on line %d -### PHP 4 style -string(17) "Child constructor" -string(16) "Base constructor" -### PHP 5 style -string(17) "Child constructor" -string(16) "Base constructor" -### Mixed style 1 -string(17) "Child constructor" -string(16) "Base constructor" -### Mixed style 2 -string(17) "Child constructor" -string(16) "Base constructor" diff --git a/tests/classes/inheritance_003.phpt b/tests/classes/inheritance_003.phpt index bcbead1be7..224c8299aa 100644 --- a/tests/classes/inheritance_003.phpt +++ b/tests/classes/inheritance_003.phpt @@ -5,16 +5,14 @@ ZE2 method inheritance without interfaces class A { - function f($x) {} + function f($x) {} } class B extends A { - function f() {} + function f() {} } ?> -===DONE=== --EXPECTF-- -Warning: Declaration of B::f() should be compatible with A::f($x) in %sinheritance_003.php on line %d -===DONE=== +Fatal error: Declaration of B::f() must be compatible with A::f($x) in %sinheritance_003.php on line %d diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt index 7eb57b2770..5ea656febb 100644 --- a/tests/classes/inheritance_004.phpt +++ b/tests/classes/inheritance_004.phpt @@ -5,16 +5,14 @@ ZE2 method inheritance without interfaces class A { - function f() {} +function f() {} } class B extends A { - function f($x) {} + function f($x) {} } ?> -===DONE=== --EXPECTF-- -Warning: Declaration of B::f($x) should be compatible with A::f() in %sinheritance_004.php on line %d -===DONE=== +Fatal error: Declaration of B::f($x) must be compatible with A::f() in %sinheritance_004.php on line %d diff --git a/tests/classes/inheritance_005.phpt b/tests/classes/inheritance_005.phpt deleted file mode 100644 index 8c5167f4bf..0000000000 --- a/tests/classes/inheritance_005.phpt +++ /dev/null @@ -1,58 +0,0 @@ ---TEST-- -Check for inherited old-style constructor. ---FILE-- -<?php - class A - { - function A() - { - echo "In " . __METHOD__ . "\n"; - } - } - - class B extends A - { - } - - class C extends B - { - } - - - echo "About to construct new B: \n"; - $b = new B; - - echo "Is B::B() callable?\n"; - var_dump(is_callable(array($b, "B"))); - - echo "Is B::A() callable?\n"; - var_dump(is_callable(array($b, "A"))); - - echo "About to construct new C: \n"; - $c = new C; - - echo "Is C::A() callable?\n"; - var_dump(is_callable(array($c, "A"))); - - echo "Is C::B() callable?\n"; - var_dump(is_callable(array($c, "B"))); - - echo "Is C::C() callable?\n"; - var_dump(is_callable(array($c, "C"))); -?> ---EXPECTF-- -Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d -About to construct new B: -In A::A -Is B::B() callable? -bool(false) -Is B::A() callable? -bool(true) -About to construct new C: -In A::A -Is C::A() callable? -bool(true) -Is C::B() callable? -bool(false) -Is C::C() callable? -bool(false) 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/inheritance_007.phpt b/tests/classes/inheritance_007.phpt index c87fbde344..9115dc00e8 100644 --- a/tests/classes/inheritance_007.phpt +++ b/tests/classes/inheritance_007.phpt @@ -1,40 +1,51 @@ --TEST-- -Ensure inherited old-style constructor doesn't block other methods +Ensure private methods with the same name are not checked for inheritance rules - final --FILE-- <?php class A { - public function B () { echo "In " . __METHOD__ . "\n"; } - public function A () { echo "In " . __METHOD__ . "\n"; } + function callYourPrivates() { + $this->normalPrivate(); + $this->finalPrivate(); + } + function notOverridden_callYourPrivates() { + $this->normalPrivate(); + $this->finalPrivate(); + } + private function normalPrivate() { + echo __METHOD__ . PHP_EOL; + } + final private function finalPrivate() { + echo __METHOD__ . PHP_EOL; + } } -class B extends A { } - -$rc = new ReflectionClass('B'); -var_dump($rc->getMethods()); - - +class B extends A { + function callYourPrivates() { + $this->normalPrivate(); + $this->finalPrivate(); + } + private function normalPrivate() { + echo __METHOD__ . PHP_EOL; + } + final private function finalPrivate() { + echo __METHOD__ . PHP_EOL; + } +} +$a = new A(); +$a->callYourPrivates(); +$a->notOverridden_callYourPrivates(); $b = new B(); -$b->a(); -$b->b(); - +$b->callYourPrivates(); +$b->notOverridden_callYourPrivates(); ?> --EXPECTF-- -Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d -array(2) { - [0]=> - object(ReflectionMethod)#%d (2) { - ["name"]=> - string(1) "B" - ["class"]=> - string(1) "A" - } - [1]=> - object(ReflectionMethod)#%d (2) { - ["name"]=> - string(1) "A" - ["class"]=> - string(1) "A" - } -} -In A::A -In A::A -In A::B +Warning: Private methods cannot be final as they are never overridden by other classes %s + +Warning: Private methods cannot be final as they are never overridden by other classes %s +A::normalPrivate +A::finalPrivate +A::normalPrivate +A::finalPrivate +B::normalPrivate +B::finalPrivate +A::normalPrivate +A::finalPrivate diff --git a/tests/classes/inheritance_008.phpt b/tests/classes/inheritance_008.phpt new file mode 100644 index 0000000000..2bc2783e2c --- /dev/null +++ b/tests/classes/inheritance_008.phpt @@ -0,0 +1,16 @@ +--TEST-- +Ensure private methods with the same name are not checked for inheritance rules - static +--FILE-- +<?php +class A { + static private function foo() { } + private function bar() {} +} +class B extends A { + private function foo() {} + static private function bar() {} +} +echo 'OK'; +?> +--EXPECT-- +OK diff --git a/tests/classes/inheritance_009.phpt b/tests/classes/inheritance_009.phpt new file mode 100644 index 0000000000..042eec7435 --- /dev/null +++ b/tests/classes/inheritance_009.phpt @@ -0,0 +1,14 @@ +--TEST-- +Ensure private methods with the same name are not checked for inheritance rules - abstract +--FILE-- +<?php +class A { + private function test() {} +} +abstract class B extends A { + abstract function test(); +} +echo 'OK'; +?> +--EXPECT-- +OK 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..dabec2cc6d 100644 --- a/tests/classes/interface_constant_inheritance_006.phpt +++ b/tests/classes/interface_constant_inheritance_006.phpt @@ -3,7 +3,8 @@ 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..daf0777250 100644 --- a/tests/classes/interface_constant_inheritance_007.phpt +++ b/tests/classes/interface_constant_inheritance_007.phpt @@ -3,7 +3,8 @@ 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 8fbfcba7ff..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(); @@ -152,7 +152,6 @@ echo $t->test('if_d'); echo $t->test('if_e'); ?> -===DONE=== --EXPECT-- class_a is_a(class_a, if_a) yes @@ -196,4 +195,3 @@ is_a(class_g, if_b) yes is_a(class_g, if_c) yes is_a(class_g, if_d) yes is_a(class_g, if_e) no -===DONE=== 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 7baa077f2b..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,17 +58,16 @@ 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"; } ?> -===DONE=== --EXPECT-- 0: foo 1: bar @@ -81,4 +80,3 @@ foreach ($array as $property => $value) { 0: foo 1: bar 2: baz -===DONE=== diff --git a/tests/classes/iterators_007.phpt b/tests/classes/iterators_007.phpt index 87b7e5318b..db1c868e0d 100644 --- a/tests/classes/iterators_007.phpt +++ b/tests/classes/iterators_007.phpt @@ -4,35 +4,34 @@ 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++; } ?> -===DONE=== --EXPECT-- Caught in Test::rewind() Caught in Test::current() @@ -40,4 +39,3 @@ Caught in Test::key() Current Caught in Test::next() Caught in Test::valid() -===DONE=== diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt index 897a2c2b93..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(); @@ -26,6 +26,4 @@ $b->foo(1); ?> --EXPECTF-- -Warning: Declaration of C::foo() should be compatible with A::foo($arg1 = 1) in %s on line %d -int(1) -int(3) +Fatal error: Declaration of C::foo() must be compatible with A::foo($arg1 = 1) in %s on line %d diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt index 254392718b..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(); @@ -18,5 +18,4 @@ $b->foo(); ?> --EXPECTF-- -Warning: Declaration of B::foo() should be compatible with A::foo($arg = 1) in %s on line %d -foo +Fatal error: Declaration of B::foo() must be compatible with A::foo($arg = 1) in %s on line %d 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..99ce5e38ff 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(); @@ -21,7 +21,7 @@ echo "Done\n"; // shouldn't be displayed --EXPECTF-- Call show() -Fatal error: Uncaught Error: Call to private method pass::show() from context '' in %s:%d +Fatal error: Uncaught Error: Call to private method pass::show() from global scope in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/private_002.phpt b/tests/classes/private_002.phpt index 892580f36d..ab36114be1 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(); @@ -30,7 +30,7 @@ echo "Done\n"; // shouldn't be displayed Call pass::show() Call fail::show() -Fatal error: Uncaught Error: Call to private method pass::show() from context 'fail' in %s:%d +Fatal error: Uncaught Error: Call to private method pass::show() from scope fail in %s:%d Stack trace: #0 %s(%d): fail::show() #1 {main} diff --git a/tests/classes/private_003.phpt b/tests/classes/private_003.phpt index 0843c5ef63..723e777687 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(); @@ -31,7 +31,7 @@ echo "Done\n"; // shouldn't be displayed --EXPECTF-- Call show() -Fatal error: Uncaught Error: Call to private method pass::show() from context 'fail' in %s:%d +Fatal error: Uncaught Error: Call to private method pass::show() from scope fail in %s:%d Stack trace: #0 %s(%d): fail::not_ok() #1 {main} diff --git a/tests/classes/private_003b.phpt b/tests/classes/private_003b.phpt index fe2f464ee8..6b231c5575 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(); @@ -32,7 +32,7 @@ echo "Done\n"; // shouldn't be displayed --EXPECTF-- Call show() -Fatal error: Uncaught Error: Call to private method pass::show() from context 'fail' in %s:%d +Fatal error: Uncaught Error: Call to private method pass::show() from scope fail in %s:%d Stack trace: #0 %s(%d): fail->not_ok() #1 {main} diff --git a/tests/classes/private_004.phpt b/tests/classes/private_004.phpt index 13a4e90535..98f6b2a2f8 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(); @@ -27,7 +27,7 @@ echo "Done\n"; // shouldn't be displayed --EXPECTF-- Call show() -Fatal error: Uncaught Error: Call to private method pass::show() from context 'fail' in %s:%d +Fatal error: Uncaught Error: Call to private method pass::show() from scope fail in %s:%d Stack trace: #0 %s(%d): fail::do_show() #1 {main} diff --git a/tests/classes/private_004b.phpt b/tests/classes/private_004b.phpt index db139f65b7..27d5ee6b14 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(); @@ -30,7 +30,7 @@ echo "Done\n"; // shouldn't be displayed --EXPECTF-- Call show() -Fatal error: Uncaught Error: Call to private method pass::show() from context 'fail' in %s:%d +Fatal error: Uncaught Error: Call to private method pass::show() from scope fail in %s:%d Stack trace: #0 %s(%d): fail->do_show() #1 {main} diff --git a/tests/classes/private_005.phpt b/tests/classes/private_005.phpt index 0c6d978f79..5b8410c3d5 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(); @@ -27,7 +27,7 @@ echo "Done\n"; // shouldn't be displayed --EXPECTF-- Call show() -Fatal error: Uncaught Error: Call to private method pass::show() from context 'fail' in %s:%d +Fatal error: Uncaught Error: Call to private method pass::show() from scope fail in %s:%d Stack trace: #0 %s(%d): fail::do_show() #1 {main} 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..da3d99447b 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(); @@ -35,7 +35,7 @@ test derived base -Fatal error: Uncaught Error: Call to private method base::show() from context 'derived' in %s:%d +Fatal error: Uncaught Error: Call to private method base::show() from scope derived in %s:%d Stack trace: #0 %s(%d): derived->test() #1 {main} diff --git a/tests/classes/property_recreate_private.phpt b/tests/classes/property_recreate_private.phpt index 6d25d71912..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"; @@ -49,7 +49,7 @@ $c->unsetPrivate(); $c->p = 'this will fail'; var_dump($c); ?> -==Done== +===DONE=== --EXPECTF-- Unset and recreate a superclass's private property: object(D)#%d (1) { 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..dd20378117 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(); @@ -21,7 +21,7 @@ echo "Done\n"; // shouldn't be displayed --EXPECTF-- Call fail() -Fatal error: Uncaught Error: Call to protected method pass::fail() from context '' in %s:%d +Fatal error: Uncaught Error: Call to protected method pass::fail() from global scope in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/protected_001b.phpt b/tests/classes/protected_001b.phpt index 6f00ffc1b3..a77fc2dedf 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(); @@ -22,7 +22,7 @@ echo "Done\n"; // shouldn't be displayed --EXPECTF-- Call fail() -Fatal error: Uncaught Error: Call to protected method pass::fail() from context '' in %s:%d +Fatal error: Uncaught Error: Call to protected method pass::fail() from global scope in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/protected_002.phpt b/tests/classes/protected_002.phpt index da87200b6e..13f01cedbb 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(); @@ -30,7 +30,7 @@ echo "Done\n"; // shouldn't be displayed Call pass::show() Call fail::show() -Fatal error: Uncaught Error: Call to protected method pass::show() from context 'fail' in %s:%d +Fatal error: Uncaught Error: Call to protected method pass::show() from scope fail in %s:%d Stack trace: #0 %s(%d): fail::show() #1 {main} diff --git a/tests/classes/serialize_001.phpt b/tests/classes/serialize_001.phpt index c228e714e9..e0f7973cd7 100644 --- a/tests/classes/serialize_001.phpt +++ b/tests/classes/serialize_001.phpt @@ -5,48 +5,46 @@ 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"; + } } ?> -===DONE=== -<?php exit(0); ?> --EXPECTF-- ========== string(6) "String" @@ -76,4 +74,3 @@ bool(false) Test::__construct() Test::serialize() Exception: Test::serialize() must return a string or NULL -===DONE=== 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_properties_003.phpt b/tests/classes/static_properties_003.phpt index 89c26d3dd3..30a6e2a510 100644 --- a/tests/classes/static_properties_003.phpt +++ b/tests/classes/static_properties_003.phpt @@ -25,7 +25,6 @@ var_dump(isset($c->y)); //$c->y = 1; // Fatal error, tested in static_properties_003_error3.phpt //$c->y =& $ref; // Fatal error, tested in static_properties_003_error4.phpt ?> -==Done== --EXPECTF-- --> Access visible static prop like instance prop: bool(false) @@ -34,7 +33,7 @@ Notice: Accessing static property C::$x as non static in %s on line 11 Notice: Accessing static property C::$x as non static in %s on line 12 -Notice: Undefined property: C::$x in %s on line 12 +Warning: Undefined property: C::$x in %s on line %d Notice: Accessing static property C::$x as non static in %s on line 13 @@ -46,4 +45,3 @@ string(5) "C::$x" --> Access non-visible static prop like instance prop: bool(false) -==Done== diff --git a/tests/classes/static_properties_003_error1.phpt b/tests/classes/static_properties_003_error1.phpt index 08a89568e4..fdb91b3e0c 100644 --- a/tests/classes/static_properties_003_error1.phpt +++ b/tests/classes/static_properties_003_error1.phpt @@ -10,7 +10,7 @@ $c = new C; echo "\n--> Access non-visible static prop like instance prop:\n"; unset($c->y); ?> -==Done== +===DONE=== --EXPECTF-- --> Access non-visible static prop like instance prop: diff --git a/tests/classes/static_properties_003_error2.phpt b/tests/classes/static_properties_003_error2.phpt index 45ccff11b6..80e9c0d0c9 100644 --- a/tests/classes/static_properties_003_error2.phpt +++ b/tests/classes/static_properties_003_error2.phpt @@ -10,7 +10,7 @@ $c = new C; echo "\n--> Access non-visible static prop like instance prop:\n"; echo $c->y; ?> -==Done== +===DONE=== --EXPECTF-- --> Access non-visible static prop like instance prop: diff --git a/tests/classes/static_properties_003_error3.phpt b/tests/classes/static_properties_003_error3.phpt index e8588a1160..b35307d814 100644 --- a/tests/classes/static_properties_003_error3.phpt +++ b/tests/classes/static_properties_003_error3.phpt @@ -10,7 +10,7 @@ $c = new C; echo "\n--> Access non-visible static prop like instance prop:\n"; $c->y = 1; ?> -==Done== +===DONE=== --EXPECTF-- --> Access non-visible static prop like instance prop: diff --git a/tests/classes/static_properties_003_error4.phpt b/tests/classes/static_properties_003_error4.phpt index a96ffb2977..ab7c316239 100644 --- a/tests/classes/static_properties_003_error4.phpt +++ b/tests/classes/static_properties_003_error4.phpt @@ -14,10 +14,8 @@ try { echo $e, "\n"; } ?> -==Done== --EXPECTF-- --> Access non-visible static prop like instance prop: Error: Cannot access protected property C::$y in %s:%d Stack trace: #0 {main} -==Done== diff --git a/tests/classes/static_properties_004.phpt b/tests/classes/static_properties_004.phpt index 42860c3301..956b49885d 100644 --- a/tests/classes/static_properties_004.phpt +++ b/tests/classes/static_properties_004.phpt @@ -18,7 +18,6 @@ $ref = 'changed.one'; D::$p =& $ref; var_dump(C::$p, D::$p, E::$p); ?> -==Done== --EXPECT-- Inherited static properties refer to the same value across classes: string(8) "original" @@ -34,4 +33,3 @@ References cannot be used to split the properties: string(11) "changed.one" string(11) "changed.one" string(11) "changed.one" -==Done== diff --git a/tests/classes/static_properties_undeclared_assign.phpt b/tests/classes/static_properties_undeclared_assign.phpt index e2e4835165..3494fbd917 100644 --- a/tests/classes/static_properties_undeclared_assign.phpt +++ b/tests/classes/static_properties_undeclared_assign.phpt @@ -6,7 +6,7 @@ Class C {} C::$p = 1; ?> --EXPECTF-- -Fatal error: Uncaught Error: Access to undeclared static property: C::$p in %s:3 +Fatal error: Uncaught Error: Access to undeclared static property C::$p in %s:%d Stack trace: #0 {main} thrown in %s on line 3 diff --git a/tests/classes/static_properties_undeclared_assignInc.phpt b/tests/classes/static_properties_undeclared_assignInc.phpt index 17577863b1..e8f9f39780 100644 --- a/tests/classes/static_properties_undeclared_assignInc.phpt +++ b/tests/classes/static_properties_undeclared_assignInc.phpt @@ -6,7 +6,7 @@ Class C {} C::$p += 1; ?> --EXPECTF-- -Fatal error: Uncaught Error: Access to undeclared static property: C::$p in %s:3 +Fatal error: Uncaught Error: Access to undeclared static property C::$p in %s:%d Stack trace: #0 {main} thrown in %s on line 3 diff --git a/tests/classes/static_properties_undeclared_assignRef.phpt b/tests/classes/static_properties_undeclared_assignRef.phpt index 680aeaf2e8..97135ceb80 100644 --- a/tests/classes/static_properties_undeclared_assignRef.phpt +++ b/tests/classes/static_properties_undeclared_assignRef.phpt @@ -7,7 +7,7 @@ $a = 'foo'; C::$p =& $a; ?> --EXPECTF-- -Fatal error: Uncaught Error: Access to undeclared static property: C::$p in %s:4 +Fatal error: Uncaught Error: Access to undeclared static property C::$p in %s:%d Stack trace: #0 {main} thrown in %s on line 4 diff --git a/tests/classes/static_properties_undeclared_inc.phpt b/tests/classes/static_properties_undeclared_inc.phpt index 86b0949627..ac02ee2e5d 100644 --- a/tests/classes/static_properties_undeclared_inc.phpt +++ b/tests/classes/static_properties_undeclared_inc.phpt @@ -6,7 +6,7 @@ Class C {} C::$p++; ?> --EXPECTF-- -Fatal error: Uncaught Error: Access to undeclared static property: C::$p in %s:3 +Fatal error: Uncaught Error: Access to undeclared static property C::$p in %s:%d Stack trace: #0 {main} thrown in %s on line 3 diff --git a/tests/classes/static_properties_undeclared_read.phpt b/tests/classes/static_properties_undeclared_read.phpt index 7028386c69..1ab2112f11 100644 --- a/tests/classes/static_properties_undeclared_read.phpt +++ b/tests/classes/static_properties_undeclared_read.phpt @@ -6,7 +6,7 @@ Class C {} echo C::$p; ?> --EXPECTF-- -Fatal error: Uncaught Error: Access to undeclared static property: C::$p in %s:3 +Fatal error: Uncaught Error: Access to undeclared static property C::$p in %s:%d Stack trace: #0 {main} thrown in %s on line 3 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 418aa1fc25..abf41f97cd 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,8 +20,8 @@ class test3 { function __toString() { - echo __METHOD__ . "()\n"; - return 42; + echo __METHOD__ . "()\n"; + return []; } } echo "====test1====\n"; @@ -56,7 +56,11 @@ echo $o , $o; echo "====test7====\n"; $ar = array(); $ar[$o->__toString()] = "ERROR"; -echo $ar[$o]; +try { + echo $ar[$o]; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} echo "====test8====\n"; var_dump(trim($o)); @@ -76,7 +80,7 @@ try { ?> ====DONE==== ---EXPECTF-- +--EXPECT-- ====test1==== test1 Object ( @@ -114,8 +118,7 @@ test2::__toString() Converted ====test7==== test2::__toString() - -Warning: Illegal offset type in %s on line %d +Illegal offset type ====test8==== test2::__toString() string(9) "Converted" @@ -125,8 +128,8 @@ string(9) "Converted" test2::__toString() Converted ====test10==== -object(test3)#1 (0) { +object(test3)#2 (0) { } test3::__toString() -Method test3::__toString() must return a string value +test3::__toString(): Return value must be of type string, array returned ====DONE==== 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 4134c702b6..48ac2770dd 100644 --- a/tests/classes/tostring_004.phpt +++ b/tests/classes/tostring_004.phpt @@ -2,7 +2,7 @@ Object to string conversion: error cases and behaviour variations. --FILE-- <?php -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { +function test_error_handler($err_no, $err_msg, $filename, $linenum) { echo "Error: $err_no - $err_msg\n"; } set_error_handler('test_error_handler'); @@ -28,9 +28,9 @@ try { echo "\n\nObject with bad __toString():\n"; class badToString { - function __toString() { - return 0; - } + function __toString() { + return []; + } } $obj = new badToString; @@ -53,7 +53,7 @@ try { --EXPECT-- Object with no __toString(): Try 1: -Object of class stdClass could not be converted to string +printf(): Argument #1 ($format) must be of type string, stdClass given Try 2: @@ -62,8 +62,8 @@ Object of class stdClass could not be converted to string Object with bad __toString(): Try 1: -Method badToString::__toString() must return a string value +badToString::__toString(): Return value must be of type string, array returned Try 2: -Method badToString::__toString() must return a string value +badToString::__toString(): Return value must be of type string, array returned diff --git a/tests/classes/type_hinting_001.phpt b/tests/classes/type_hinting_001.phpt index 35356581f4..f1c1973cf3 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 { @@ -32,7 +32,7 @@ $a->b($b); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Argument 1 passed to FooBar::a() must implement interface Foo, instance of Blort given, called in %s on line 27 and defined in %s:12 +Fatal error: Uncaught TypeError: FooBar::a(): Argument #1 ($foo) must be of type Foo, Blort given, called in %s on line 27 and defined in %s:12 Stack trace: #0 %s(%d): FooBar->a(Object(Blort)) #1 {main} diff --git a/tests/classes/type_hinting_002.phpt b/tests/classes/type_hinting_002.phpt index b65bc85c93..765de66bab 100644 --- a/tests/classes/type_hinting_002.phpt +++ b/tests/classes/type_hinting_002.phpt @@ -4,14 +4,14 @@ ZE2 class type hinting non existing class <?php class Foo { - function a(NonExisting $foo) {} + function a(NonExisting $foo) {} } $o = new Foo; $o->a($o); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Argument 1 passed to Foo::a() must be an instance of NonExisting, instance of Foo given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: Foo::a(): Argument #1 ($foo) must be of type NonExisting, Foo given, called in %s on line %d and defined in %s:%d Stack trace: #0 %s(%d): Foo->a(Object(Foo)) #1 {main} diff --git a/tests/classes/type_hinting_003.phpt b/tests/classes/type_hinting_003.phpt index fb788e3d9c..fab088daae 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)); @@ -57,7 +57,7 @@ array(1) { int(25) } -Fatal error: Uncaught TypeError: Argument 1 passed to Test::f1() must be of the type array, int given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: Test::f1(): Argument #1 ($ar) must be of type array, int given, called in %s on line %d and defined in %s:%d Stack trace: #0 %s(%d): Test::f1(1) #1 {main} diff --git a/tests/classes/type_hinting_004.phpt b/tests/classes/type_hinting_004.phpt index 27f15a3e16..2ba8870b0a 100644 --- a/tests/classes/type_hinting_004.phpt +++ b/tests/classes/type_hinting_004.phpt @@ -144,10 +144,10 @@ Ensure type hints are enforced for functions invoked as callbacks. ?> --EXPECTF-- ---> Type hints with callback function: -0: Argument 1 passed to f1() must be an instance of A, int given%s(%d) +0: f1(): Argument #1 ($a) must be of type A, int given%s(%d) in f1; -0: Argument 1 passed to f2() must be an instance of A or null, int given%s(%d) +0: f2(): Argument #1 ($a) must be of type ?A, int given%s(%d) in f2; in f2; @@ -155,10 +155,10 @@ in f2; ---> Type hints with callback static method: -0: Argument 1 passed to C::f1() must be an instance of A, int given%s(%d) +0: C::f1(): Argument #1 ($a) must be of type A, int given%s(%d) in C::f1 (static); -0: Argument 1 passed to C::f2() must be an instance of A or null, int given%s(%d) +0: C::f2(): Argument #1 ($a) must be of type ?A, int given%s(%d) in C::f2 (static); in C::f2 (static); @@ -166,10 +166,10 @@ in C::f2 (static); ---> Type hints with callback instance method: -0: Argument 1 passed to D::f1() must be an instance of A, int given%s(%d) +0: D::f1(): Argument #1 ($a) must be of type A, int given%s(%d) in C::f1 (instance); -0: Argument 1 passed to D::f2() must be an instance of A or null, int given%s(%d) +0: D::f2(): Argument #1 ($a) must be of type ?A, int given%s(%d) in C::f2 (instance); in C::f2 (instance); diff --git a/tests/classes/type_hinting_005a.phpt b/tests/classes/type_hinting_005a.phpt index 54af0e8c96..065ba70e8a 100644 --- a/tests/classes/type_hinting_005a.phpt +++ b/tests/classes/type_hinting_005a.phpt @@ -4,15 +4,11 @@ Check type hint compatibility in overrides with array hints. <?php Class C { function f(array $a) {} } -echo "Compatible hint.\n"; +// Compatible hint. Class D1 extends C { function f(array $a) {} } -echo "Class hint, should be array.\n"; +// Class hint, should be array. Class D2 extends C { function f(SomeClass $a) {} } ?> -==DONE== --EXPECTF-- -Warning: Declaration of D2::f(SomeClass $a) should be compatible with C::f(array $a) in %s on line 8 -Compatible hint. -Class hint, should be array. -==DONE== +Fatal error: Declaration of D2::f(SomeClass $a) must be compatible with C::f(array $a) in %s on line 8 diff --git a/tests/classes/type_hinting_005c.phpt b/tests/classes/type_hinting_005c.phpt index 00048c3ef9..6cc3e3e369 100644 --- a/tests/classes/type_hinting_005c.phpt +++ b/tests/classes/type_hinting_005c.phpt @@ -4,11 +4,8 @@ Check type hint compatibility in overrides with array hints. <?php Class C { function f(SomeClass $a) {} } -echo "Array hint, should be class.\n"; +// Array hint, should be class. Class D extends C { function f(array $a) {} } ?> -==DONE== --EXPECTF-- -Warning: Declaration of D::f(array $a) should be compatible with C::f(SomeClass $a) in %s on line 5 -Array hint, should be class. -==DONE== +Fatal error: Declaration of D::f(array $a) must be compatible with C::f(SomeClass $a) in %s on line 5 diff --git a/tests/classes/type_hinting_005d.phpt b/tests/classes/type_hinting_005d.phpt index a1ce30950c..51c2a5a995 100644 --- a/tests/classes/type_hinting_005d.phpt +++ b/tests/classes/type_hinting_005d.phpt @@ -4,11 +4,8 @@ Check type hint compatibility in overrides with array hints. <?php Class C { function f($a) {} } -echo "Array hint, should be nothing.\n"; +// Array hint, should be nothing. Class D extends C { function f(array $a) {} } ?> -==DONE== --EXPECTF-- -Warning: Declaration of D::f(array $a) should be compatible with C::f($a) in %s on line 5 -Array hint, should be nothing. -==DONE== +Fatal error: Declaration of D::f(array $a) must be compatible with C::f($a) in %s on line 5 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/002.phpt b/tests/func/002.phpt index 4319715e08..563d39183e 100644 --- a/tests/func/002.phpt +++ b/tests/func/002.phpt @@ -15,6 +15,7 @@ blah(); if (isset($hey) || isset($yo)) { echo "Local variables became global :(\n"; } +?> --EXPECT-- hey=0, 0 hey=1, -1 diff --git a/tests/func/003.phpt b/tests/func/003.phpt index 8234af2e17..da024a6282 100644 --- a/tests/func/003.phpt +++ b/tests/func/003.phpt @@ -89,13 +89,14 @@ 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); +?> --EXPECT-- hey blah 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..cf1e571377 100644 --- a/tests/func/005a.phpt +++ b/tests/func/005a.phpt @@ -7,18 +7,15 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); --FILE-- <?php -ini_set('display_errors', 0); - echo "Start\n"; function boo() { - echo "Shutdown\n"; + echo "Shutdown\n"; } register_shutdown_function("boo"); -/* not necessary, just to show the error sooner */ set_time_limit(1); /* infinite loop to simulate long processing */ @@ -27,6 +24,8 @@ for (;;) {} echo "End\n"; ?> ---EXPECT-- +--EXPECTF-- Start + +Fatal error: Maximum execution time of 1 second exceeded in %s on line %d Shutdown 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/018.phpt b/tests/lang/018.phpt index 7560219291..647bee8796 100644 --- a/tests/lang/018.phpt +++ b/tests/lang/018.phpt @@ -11,6 +11,7 @@ for ($i=0; $i<10; $i++) { eval($message); echo $i."\n"; } +?> --EXPECT-- hey 0 diff --git a/tests/lang/019.phpt b/tests/lang/019.phpt index 313da0cbd8..79945a2131 100644 --- a/tests/lang/019.phpt +++ b/tests/lang/019.phpt @@ -13,6 +13,7 @@ while ($i<10) { } eval('-'); +?> --EXPECTF-- hey, this is a regular echo'd eval() hey, this is a function inside an eval()! 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..548605e696 100644 --- a/tests/lang/023-1.inc +++ b/tests/lang/023-1.inc @@ -3,7 +3,7 @@ <?php /* the point of this file is to intensively test various aspects of * the parser. right now, each test focuses in one aspect only - * (e.g. variable aliasing, arithemtic operator, various control + * (e.g. variable aliasing, arithmetic operator, various control * structures), while trying to combine code from other parts of the * parser as well. */ @@ -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/031.phpt b/tests/lang/031.phpt deleted file mode 100644 index 134df03684..0000000000 --- a/tests/lang/031.phpt +++ /dev/null @@ -1,72 +0,0 @@ ---TEST-- -Bug #16227 (Internal hash position bug on assignment) ---FILE-- -<?php -// reported by php.net@alienbill.com -$arrayOuter = array("key1","key2"); -$arrayInner = array("0","1"); - -print "Correct - with inner loop reset.\n"; - -while(list(,$o) = each($arrayOuter)){ - reset($arrayInner); - while(list(,$i) = each($arrayInner)){ - print "inloop $i for $o\n"; - } -} -reset($arrayOuter); -reset($arrayInner); - -print "What happens without inner loop reset.\n"; - -while(list(,$o) = each($arrayOuter)){ - while(list(,$i) = each($arrayInner)){ - print "inloop $i for $o\n"; - } -} -reset($arrayOuter); -reset($arrayInner); - -print "What happens without inner loop reset but copy.\n"; - -while(list(,$o) = each($arrayOuter)){ - $placeholder = $arrayInner; - while(list(,$i) = each($arrayInner)){ - print "inloop $i for $o\n"; - } -} -reset($arrayOuter); -reset($arrayInner); - -print "What happens with inner loop reset over copy.\n"; - -while(list(,$o) = each($arrayOuter)){ - $placeholder = $arrayInner; - while(list(,$i) = each($placeholder)){ - print "inloop $i for $o\n"; - } -} -reset($arrayOuter); -reset($arrayInner); -?> ---EXPECTF-- -Correct - with inner loop reset. - -Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d -inloop 0 for key1 -inloop 1 for key1 -inloop 0 for key2 -inloop 1 for key2 -What happens without inner loop reset. -inloop 0 for key1 -inloop 1 for key1 -What happens without inner loop reset but copy. -inloop 0 for key1 -inloop 1 for key1 -inloop 0 for key2 -inloop 1 for key2 -What happens with inner loop reset over copy. -inloop 0 for key1 -inloop 1 for key1 -inloop 0 for key2 -inloop 1 for key2 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 21e3768e1b..e6254d687b 100644 --- a/tests/lang/033.phpt +++ b/tests/lang/033.phpt @@ -7,41 +7,38 @@ $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; ?> - -===DONE=== --EXPECT-- If: 11 While: 12346789 For: 0123401234 Switch: 1 -===DONE=== diff --git a/tests/lang/034.phpt b/tests/lang/034.phpt index 38ecc0b451..439c87e13b 100644 --- a/tests/lang/034.phpt +++ b/tests/lang/034.phpt @@ -5,7 +5,7 @@ precision=14 --SKIPIF-- <?php # try to activate a german locale if (setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8859-1") === FALSE) { - print "skip Can't find german locale"; + print "skip Can't find german locale"; } ?> --FILE-- @@ -16,4 +16,4 @@ setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8 echo (float)"3.14", "\n"; ?> --EXPECT-- -3,14 +3.14 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 8e06bdd354..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,19 +23,16 @@ 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']); } ?> -===DONE=== -<?php exit(0); ?> --EXPECT-- string(15) "Error2Exception" string(5) "fopen" -===DONE=== diff --git a/tests/lang/039.phpt b/tests/lang/039.phpt index b353e0fa4b..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,19 +27,17 @@ 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"; } ?> -===DONE=== --EXPECT-- Catchable -===DONE=== diff --git a/tests/lang/040.phpt b/tests/lang/040.phpt index 6d8ece9679..fa2d9b8b70 100644 --- a/tests/lang/040.phpt +++ b/tests/lang/040.phpt @@ -8,8 +8,6 @@ foreach($a as $b[0]) { echo $b[0]."\n"; } ?> -===DONE=== --EXPECT-- 0 1 -===DONE=== diff --git a/tests/lang/041.phpt b/tests/lang/041.phpt index 1540243cbe..ea973f1056 100644 --- a/tests/lang/041.phpt +++ b/tests/lang/041.phpt @@ -17,7 +17,7 @@ echo $wrongClassname::$b."\n"; --EXPECTF-- foo -Fatal error: Uncaught Error: Class 'B' not found in %s041.php:%d +Fatal error: Uncaught Error: Class "B" not found in %s:%d Stack trace: #0 {main} thrown in %s041.php on line %d diff --git a/tests/lang/042.phpt b/tests/lang/042.phpt index e9e95c8cc1..a06767eb18 100644 --- a/tests/lang/042.phpt +++ b/tests/lang/042.phpt @@ -16,7 +16,7 @@ echo $wrongClassname::B."\n"; --EXPECTF-- foo -Fatal error: Uncaught Error: Class 'B' not found in %s042.php:%d +Fatal error: Uncaught Error: Class "B" not found in %s:%d Stack trace: #0 {main} thrown in %s042.php on line %d diff --git a/tests/lang/043.phpt b/tests/lang/043.phpt index 80c427c8a9..0e7fedd45c 100644 --- a/tests/lang/043.phpt +++ b/tests/lang/043.phpt @@ -16,7 +16,7 @@ echo $wrongClassname::foo()."\n"; --EXPECTF-- foo -Fatal error: Uncaught Error: Class 'B' not found in %s043.php:%d +Fatal error: Uncaught Error: Class "B" not found in %s:%d Stack trace: #0 {main} thrown in %s043.php on line %d diff --git a/tests/lang/044.phpt b/tests/lang/044.phpt index eef85c206f..29d8a33e4e 100644 --- a/tests/lang/044.phpt +++ b/tests/lang/044.phpt @@ -18,7 +18,7 @@ echo $wrongClassname::$methodname()."\n"; --EXPECTF-- foo -Fatal error: Uncaught Error: Class 'B' not found in %s044.php:%d +Fatal error: Uncaught Error: Class "B" not found in %s:%d Stack trace: #0 {main} thrown in %s044.php on line %d diff --git a/tests/lang/bison1.phpt b/tests/lang/bison1.phpt index 3571576fb8..9af2af7b8b 100644 --- a/tests/lang/bison1.phpt +++ b/tests/lang/bison1.phpt @@ -2,8 +2,8 @@ Bison weirdness --FILE-- <?php -error_reporting(E_ALL & ~E_NOTICE); echo "blah-$foo\n"; ?> ---EXPECT-- +--EXPECTF-- +Warning: Undefined variable $foo in %s on line %d blah- diff --git a/tests/lang/bug17115.phpt b/tests/lang/bug17115.phpt deleted file mode 100644 index 9500352799..0000000000 --- a/tests/lang/bug17115.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #17115 (lambda functions produce segfault with static vars) ---FILE-- -<?php -$func = create_function('',' - static $foo = 0; - return $foo++; -'); -var_dump($func()); -var_dump($func()); -var_dump($func()); -?> ---EXPECTF-- -Deprecated: Function create_function() is deprecated in %s on line %d -int(0) -int(1) -int(2) 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..10d2740319 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]['0idx'] = "$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]['0idx']."\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/bug21820.phpt b/tests/lang/bug21820.phpt index cbf466eea7..ec213db00d 100644 --- a/tests/lang/bug21820.phpt +++ b/tests/lang/bug21820.phpt @@ -10,4 +10,4 @@ echo "$arr['foo']"; ?> --EXPECTF-- -Parse error: %s error, %s(T_STRING)%s(T_VARIABLE)%s(T_NUM_STRING)%sin %sbug21820.php on line %d +Parse error: %s error, %sidentifier%svariable%snumber%sin %sbug21820.php on line %d 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 dbf7756daa..e79972d29e 100644 --- a/tests/lang/bug22510.phpt +++ b/tests/lang/bug22510.phpt @@ -1,79 +1,77 @@ --TEST-- Bug #22510 (segfault among complex references) ---INI-- -error_reporting=E_ALL | E_DEPRECATED --FILE-- <?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 4614efc169..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'); @@ -39,9 +39,11 @@ var_dump($result); string(5) "* *-*" string(7) "* *-* *" string(7) "*4*-* *" +[Only the first byte will be assigned to the string offset] string(7) "*4*s* *" string(8) "*4*s* *0" string(8) "*-*-* *0" +[Only the first byte will be assigned to the string offset] string(8) "*-*s*s*0" string(8) "4-4s4s*0" string(9) "4-4s4s505" diff --git a/tests/lang/bug22690.phpt b/tests/lang/bug22690.phpt deleted file mode 100644 index 85ddcd3487..0000000000 --- a/tests/lang/bug22690.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Bug #22690 (ob_start() is broken with create_function() callbacks) ---FILE-- -<?php - $foo = create_function('$s', 'return strtoupper($s);'); - ob_start($foo); - echo $foo("bar\n"); -?> -bar ---EXPECTF-- -Deprecated: Function create_function() is deprecated in %s on line %d -BAR -BAR diff --git a/tests/lang/bug23384.phpt b/tests/lang/bug23384.phpt index 2dc3f2308b..220cf9f654 100644 --- a/tests/lang/bug23384.phpt +++ b/tests/lang/bug23384.phpt @@ -5,7 +5,7 @@ Bug #23384 (use of class constants in statics) define('TEN', 10); class Foo { const HUN = 100; - function test($x = Foo::HUN) { + static function test($x = Foo::HUN) { static $arr2 = array(TEN => 'ten'); static $arr = array(Foo::HUN => 'ten'); @@ -18,8 +18,7 @@ class Foo { Foo::test(); echo Foo::HUN."\n"; ?> ---EXPECTF-- -Deprecated: Non-static method Foo::test() should not be called statically in %sbug23384.php on line %d +--EXPECT-- Array ( [100] => ten diff --git a/tests/lang/bug23584.phpt b/tests/lang/bug23584.phpt index 417cfb0856..abc3532a63 100644 --- a/tests/lang/bug23584.phpt +++ b/tests/lang/bug23584.phpt @@ -9,5 +9,5 @@ error_reporting(E_ALL); echo $foo; ?> ---EXPECTREGEX-- -Notice: Undefined variable:.*foo in .* on line 6 +--EXPECTF-- +Warning: Undefined variable $foo in %s on line 6 diff --git a/tests/lang/bug23922.phpt b/tests/lang/bug23922.phpt deleted file mode 100644 index 22c4aaa7d4..0000000000 --- a/tests/lang/bug23922.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #23922 (scope doesn't properly propagate into internal functions) ---FILE-- -<?php - class foo - { - public $foo = 1; - - function as_string() - { assert('$this->foo == 1'); } - - function as_expr() - { assert($this->foo == 1); } - } - - $foo = new foo(); - $foo->as_expr(); - $foo->as_string(); -?> ---EXPECTF-- -Deprecated: assert(): Calling assert() with a string argument is deprecated in %s on line %d diff --git a/tests/lang/bug24054.phpt b/tests/lang/bug24054.phpt index 4ee5d631e6..aa098fc524 100644 --- a/tests/lang/bug24054.phpt +++ b/tests/lang/bug24054.phpt @@ -6,18 +6,19 @@ 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 TESTS; include(__DIR__ . '/../quicktester.inc'); +?> --EXPECT-- 1,1,0,0 OK 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 6ce56dbad7..b7a35115ae 100644 --- a/tests/lang/bug24499.phpt +++ b/tests/lang/bug24499.phpt @@ -7,12 +7,13 @@ class Id { public function tester($obj) { - $obj->id = "bar"; + $obj->id = "bar"; } } $id = new Id(); -@$obj->foo = "bar"; +$obj = new stdClass; +$obj->foo = "bar"; $id->tester($obj); print_r($obj); ?> diff --git a/tests/lang/bug24640.phpt b/tests/lang/bug24640.phpt index ac3d78d06c..a8cb438fca 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); @@ -34,26 +34,24 @@ test(1.7e+1000); test(1.7e-1000); ?> -===DONE=== -<?php exit(0); ?> --EXPECTF-- 1.7000000000000001E+300 -float(1.7E+300) +float(1.7000000000000001E+300) 1.7E+300 1.7E+300 ------ 1.7000000000000001E-300 -float(1.7E-300) +float(1.7000000000000001E-300) 1.7E-300 1.7E-300 ------ 1.7000000000000002E+79 -float(1.7E+79) +float(1.7000000000000002E+79) 1.7E+79 1.7E+79 ------ 1.6999999999999999E-79 -float(1.7E-79) +float(1.6999999999999999E-79) 1.7E-79 1.7E-79 ------ @@ -73,7 +71,7 @@ float(1.7E+81) 1.7E+81 ------ 1.6999999999999999E-81 -float(1.7E-81) +float(1.6999999999999999E-81) 1.7E-81 1.7E-81 ------ @@ -83,7 +81,7 @@ I%s I%s ------ 1.6999810742105611E-319 -float(1.69998107421E-319) +float(1.6999810742105611E-319) 1.69998107421E-319 1.69998107421E-319 ------ @@ -93,7 +91,7 @@ I%s I%s ------ 1.7000798873397294E-320 -float(1.70007988734E-320) +float(1.7000798873397294E-320) 1.70007988734E-320 1.70007988734E-320 ------ @@ -103,7 +101,7 @@ I%s I%s ------ 1.6995858216938881E-321 -float(1.69958582169E-321) +float(1.6995858216938881E-321) 1.69958582169E-321 1.69958582169E-321 ------ @@ -127,4 +125,3 @@ float(0) 0 0 ------ -===DONE=== diff --git a/tests/lang/bug24658.phpt b/tests/lang/bug24658.phpt index a53457d5d9..6b2804cfd4 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); @@ -53,7 +53,7 @@ int(2) object(foo)#%d (0) { } -Fatal error: Uncaught TypeError: Argument 1 passed to typehint() must be an instance of foo, int given in %s:%d +Fatal error: Uncaught TypeError: typehint(): Argument #1 ($a) must be of type foo, int given in %s:%d Stack trace: #0 [internal function]: typehint(1, 1) #1 %s(%d): array_walk(Array, 'typehint') 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/bug24926.phpt b/tests/lang/bug24926.phpt deleted file mode 100644 index f73d265f38..0000000000 --- a/tests/lang/bug24926.phpt +++ /dev/null @@ -1,29 +0,0 @@ ---TEST-- -Bug #24926 (lambda function (create_function()) cannot be stored in a class property) ---FILE-- -<?php - -error_reporting (E_ALL); - -class foo { - - public $functions = array(); - - function __construct() - { - $function = create_function('', 'return "FOO\n";'); - print($function()); - - $this->functions['test'] = $function; - print($this->functions['test']()); // werkt al niet meer - - } -} - -$a = new foo (); - -?> ---EXPECTF-- -Deprecated: Function create_function() is deprecated in %s on line %d -FOO -FOO 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 b54f467ea8..53b951fd45 100644 --- a/tests/lang/bug25547.phpt +++ b/tests/lang/bug25547.phpt @@ -3,15 +3,15 @@ Bug #25547 (error_handler and array index with function call) --FILE-- <?php -function handler($errno, $errstr, $errfile, $errline, $context) +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(); @@ -22,7 +22,7 @@ print_r($output); echo "Done"; ?> --EXPECT-- -handler(Undefined index: foo) +handler(Undefined array key "foo") Array ( [foo] => 1 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..a6b526ab78 100644 --- a/tests/lang/bug25922.phpt +++ b/tests/lang/bug25922.phpt @@ -6,19 +6,19 @@ 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(); ?> --EXPECT-- -Undefined variable: data +Undefined variable $data Trying to access array offset on value of type null Undefined index here: '' 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 4bcadb78fd..c9f08a0403 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(); @@ -65,12 +65,12 @@ echo "===DONE==="; ?> --EXPECTF-- 123 -Notice: Undefined property: test::$foobar in %s on line %d +Warning: Undefined property: test::$foobar in %s on line %d -Warning: Invalid argument supplied for foreach() in %s on line %d +Warning: foreach() argument must be of type array|object, null given in %s on line %d -Warning: Invalid argument supplied for foreach() in %s on line %d +Warning: foreach() argument must be of type array|object, string given in %s on line %d -Warning: Invalid argument supplied for foreach() in %s on line %d +Warning: foreach() argument must be of type array|object, string given in %s on line %d 123 ===DONE=== 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..487c57d24e 100644 --- a/tests/lang/bug28800.phpt +++ b/tests/lang/bug28800.phpt @@ -2,26 +2,20 @@ 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) { + try { + echo ($v+0)."\n"; + } catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; + } + } ?> ---EXPECTF-- -Warning: A non-numeric value encountered in %s on line %d -0 +--EXPECT-- +Unsupported operand types: string + int +Unsupported operand types: string + int +Unsupported operand types: string + int +Unsupported operand types: string + int +Unsupported operand types: string + int +Unsupported operand types: string + int -Warning: A non-numeric value encountered in %s on line %d -0 - -Warning: A non-numeric value encountered in %s on line %d -0 - -Warning: A non-numeric value encountered in %s on line %d -0 - -Warning: A non-numeric value encountered in %s on line %d -0 - -Warning: A non-numeric value encountered in %s on line %d -0 diff --git a/tests/lang/bug29566.phpt b/tests/lang/bug29566.phpt index 16aec8fc73..9548e47875 100644 --- a/tests/lang/bug29566.phpt +++ b/tests/lang/bug29566.phpt @@ -7,12 +7,10 @@ $var="This is a string"; $dummy=""; unset($dummy); -foreach($var['nosuchkey'] as $v) { +foreach($var['0nosuchkey'] as $v) { } ?> -===DONE=== --EXPECTF-- -Warning: Illegal string offset 'nosuchkey' in %sbug29566.php on line %d +Warning: Illegal string offset "0nosuchkey" in %s on line %d -Warning: Invalid argument supplied for foreach() in %sbug29566.php on line %d -===DONE=== +Warning: foreach() argument must be of type array|object, string given in %sbug29566.php on line %d diff --git a/tests/lang/bug29893.phpt b/tests/lang/bug29893.phpt index 25679893d2..d9af914191 100644 --- a/tests/lang/bug29893.phpt +++ b/tests/lang/bug29893.phpt @@ -3,9 +3,11 @@ Bug #29893 (segfault when using array as index) --FILE-- <?php $base = 50; -$base[$base] -= 0; +try { + $base[$base] -= 0; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} ?> -===DONE=== ---EXPECTF-- -Warning: Cannot use a scalar value as an array in %sbug29893.php on line %d -===DONE=== +--EXPECT-- +Cannot use a scalar value as an array diff --git a/tests/lang/bug29944.phpt b/tests/lang/bug29944.phpt index 80a76f132e..211c950c6e 100644 --- a/tests/lang/bug29944.phpt +++ b/tests/lang/bug29944.phpt @@ -5,16 +5,13 @@ 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); } ?> - -===DONE=== --EXPECT-- 1 -===DONE=== diff --git a/tests/lang/bug30638.phpt b/tests/lang/bug30638.phpt index 24e6609498..3eb2c35241 100644 --- a/tests/lang/bug30638.phpt +++ b/tests/lang/bug30638.phpt @@ -3,7 +3,7 @@ Bug #30638 (localeconv returns wrong LC_NUMERIC settings) (ok to fail on MacOS X --SKIPIF-- <?php # try to activate a german locale if (setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8859-1") === FALSE) { - print "skip setlocale() failed"; + print "skip setlocale() failed"; } elseif (strtolower(php_uname('s')) == 'darwin') { print "skip ok to fail on MacOS X"; } 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/bug35176.phpt b/tests/lang/bug35176.phpt index 2928f7ec45..c573c9c9de 100644 --- a/tests/lang/bug35176.phpt +++ b/tests/lang/bug35176.phpt @@ -10,6 +10,9 @@ require_once('nonexisiting.php'); ?> --EXPECTF-- <br /> -<b>Warning</b>: require_once(nonexisiting.php) [<a href='/function.require-once.html'>function.require-once.html</a>]: failed to open stream: No such file or directory in <b>%sbug35176.php</b> on line <b>2</b><br /> +<b>Warning</b>: require_once(nonexisiting.php) [<a href='/function.require-once.html'>function.require-once.html</a>]: Failed to open stream: No such file or directory in <b>%sbug35176.php</b> on line <b>2</b><br /> <br /> -<b>Fatal error</b>: require_once() [<a href='/function.require.html'>function.require.html</a>]: Failed opening required 'nonexisiting.php' (%s) in <b>%sbug35176.php</b> on line <b>2</b><br /> +<b>Fatal error</b>: Uncaught Error: Failed opening required 'nonexisiting.php' (include_path='%s') in %s:%d +Stack trace: +#0 {main} + thrown in <b>%sbug35176.php</b> on line <b>2</b><br /> diff --git a/tests/lang/bug35382.phpt b/tests/lang/bug35382.phpt index c2295c3440..4d2a630680 100644 --- a/tests/lang/bug35382.phpt +++ b/tests/lang/bug35382.phpt @@ -5,5 +5,6 @@ Bug #35382 (Comment in end of file produces fatal error) eval("echo 'Hello'; // comment"); echo " World"; //last line comment +?> --EXPECT-- Hello World diff --git a/tests/lang/bug43958.phpt b/tests/lang/bug43958.phpt index c1fca9d633..7f0c1b7487 100644 --- a/tests/lang/bug43958.phpt +++ b/tests/lang/bug43958.phpt @@ -4,13 +4,14 @@ 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'); +?> --EXPECTF-- -Warning: include(file-which-does-not-exist-on-purpose.php): failed to open stream: No such file or directory in %sbug43958.php on line 5 +Warning: include(file-which-does-not-exist-on-purpose.php): Failed to open stream: No such file or directory in %sbug43958.php on line 5 Warning: include(): Failed opening 'file-which-does-not-exist-on-purpose.php' for inclusion (include_path='%s') in %sbug43958.php on line 5 diff --git a/tests/lang/bug44827.phpt b/tests/lang/bug44827.phpt index d871cfd2a8..9220439c88 100644 --- a/tests/lang/bug44827.phpt +++ b/tests/lang/bug44827.phpt @@ -6,11 +6,20 @@ sebs@php.net Testfest Munich 2009 --FILE-- <?php -define('::', true); -var_dump(constant('::')); +try { + define('::', true); +} catch (ValueError $e) { + echo $e->getMessage(), "\n"; +} + +try { + constant('::'); +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} + ?> --EXPECTF-- -Warning: Class constants cannot be defined or redefined in %s on line %d +define(): Argument #1 ($constant_name) cannot be a class constant -Warning: constant(): Couldn't find constant :: in %s on line %d -NULL +Fatal error: Class "" not found in %s on line %d diff --git a/tests/lang/bug71897.phpt b/tests/lang/bug71897.phpt index 5864b1dece..9cbf17a64c 100644 --- a/tests/lang/bug71897.phpt +++ b/tests/lang/bug71897.phpt @@ -10,6 +10,4 @@ eval(" ?> --EXPECTF-- -Warning: Unexpected character in input: '%s' (ASCII=127) state=0 in %s(%d) : eval()'d code on line %d - -Parse error: syntax error, unexpected 'b' (T_STRING) in %s(%d) : eval()'d code on line %d +Parse error: syntax error, unexpected character 0x7F in %s on line %d diff --git a/tests/lang/bug73329.phpt b/tests/lang/bug73329.phpt index 938f8bac24..a4f7a53fa7 100644 --- a/tests/lang/bug73329.phpt +++ b/tests/lang/bug73329.phpt @@ -2,17 +2,15 @@ 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" + ); ?> -==DONE== --EXPECT-- float(0) float(0) float(0) float(0) -==DONE== diff --git a/tests/lang/bug7515.phpt b/tests/lang/bug7515.phpt index 5c7756c6a1..6c8632c0fa 100644 --- a/tests/lang/bug7515.phpt +++ b/tests/lang/bug7515.phpt @@ -1,14 +1,13 @@ --TEST-- Bug #7515 (weird & invisible referencing of objects) ---INI-- -error_reporting=2039 --FILE-- <?php class obj { - function method() {} + function method() {} } -$o->root=new obj(); +$o = new stdClass; +$o->root = new obj(); ob_start(); var_dump($o); @@ -30,6 +29,5 @@ y=$y "; } ?> ---EXPECTF-- -Warning: Creating default object from empty value in %s on line %d +--EXPECT-- success diff --git a/tests/lang/catchable_error_001.phpt b/tests/lang/catchable_error_001.phpt index b11a7c8d96..a7481b6ea6 100644 --- a/tests/lang/catchable_error_001.phpt +++ b/tests/lang/catchable_error_001.phpt @@ -2,24 +2,24 @@ 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 +Fatal error: Uncaught TypeError: blah(): Argument #1 ($a) must be of type Foo, stdClass given, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php:5 Stack trace: #0 %s(%d): blah(Object(stdClass)) #1 {main} diff --git a/tests/lang/catchable_error_002.phpt b/tests/lang/catchable_error_002.phpt index 10312533c1..50f06051e3 100644 --- a/tests/lang/catchable_error_002.phpt +++ b/tests/lang/catchable_error_002.phpt @@ -2,28 +2,28 @@ 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 +blah(): Argument #1 ($a) must be of type Foo, stdClass given, called in %scatchable_error_002.php on line %d ALIVE! diff --git a/tests/lang/compare_objects_basic1.phpt b/tests/lang/compare_objects_basic1.phpt index 90eb9a0581..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 @@ -42,7 +42,6 @@ var_dump($obj4 == $obj3); var_dump($obj5 == $obj3); ?> -===DONE=== --EXPECT-- Simple test for standard compare object handler @@ -56,4 +55,3 @@ bool(false) bool(false) bool(false) bool(false) -===DONE=== diff --git a/tests/lang/compare_objects_basic2.phpt b/tests/lang/compare_objects_basic2.phpt index ccd3a001fc..9f5820c3ee 100644 --- a/tests/lang/compare_objects_basic2.phpt +++ b/tests/lang/compare_objects_basic2.phpt @@ -16,8 +16,6 @@ $obj2 = new DateTime(("2009-02-12 12:47:41 GMT")); var_dump($obj1 == $obj2); ?> -===DONE=== --EXPECT-- Simple test comparing two objects with different compare callback handler bool(false) -===DONE=== diff --git a/tests/lang/each_binary_safety.phpt b/tests/lang/each_binary_safety.phpt deleted file mode 100644 index ce175495aa..0000000000 --- a/tests/lang/each_binary_safety.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Binary safety of each() for both keys and values ---FILE-- -<?php -error_reporting(E_ALL); -$arr = array ("foo\0bar" => "foo\0bar"); -while (list($key, $val) = each($arr)) { - echo strlen($key), ': '; - echo urlencode($key), ' => ', urlencode($val), "\n"; -} -?> ---EXPECTF-- -Deprecated: The each() function is deprecated. This message will be suppressed on further calls in %s on line %d -7: foo%00bar => foo%00bar 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_002.phpt b/tests/lang/engine_assignExecutionOrder_002.phpt index dbb0c0aba4..956e3f9066 100644 --- a/tests/lang/engine_assignExecutionOrder_002.phpt +++ b/tests/lang/engine_assignExecutionOrder_002.phpt @@ -10,7 +10,11 @@ echo "A=$a B=$b\n"; // Warning: Cannot use a scalar value as an array in %s on line %d -$c[$c=1] = 1; +try { + $c[$c=1] = 1; +} catch (Error $e) { + echo $e->getMessage(), "\n"; +} // i++ evaluated first, so $d[0] is 10 $d = array(0,10); @@ -90,8 +94,7 @@ print_r($ee); ?> --EXPECTF-- A=hello B=bye - -Warning: Cannot use a scalar value as an array in %s on line %d +Cannot use a scalar value as an array array(2) { [0]=> int(10) @@ -116,12 +119,12 @@ L=100 M=200 N=300 O= and P= 10 20 40 50 60 70 80 -Notice: Undefined offset: 0 in %s on line %d +Warning: Undefined array key 0 in %s on line %d -Notice: Undefined offset: 1 in %s on line %d +Warning: Undefined array key 1 in %s on line %d Y=,Z= -Notice: Undefined offset: 1 in %s on line %d +Warning: Undefined array key 1 in %s on line %d AA=10 CC=10 DD=30 Array diff --git a/tests/lang/engine_assignExecutionOrder_008.phpt b/tests/lang/engine_assignExecutionOrder_008.phpt index 310e0d9964..4b2aeb3451 100644 --- a/tests/lang/engine_assignExecutionOrder_008.phpt +++ b/tests/lang/engine_assignExecutionOrder_008.phpt @@ -29,23 +29,29 @@ echo $a[$i[0][0]=f()][++$i[0][0]]; unset($i); echo "\n" . '$i->p=f(): '; +$i = new stdClass; echo $a[$i->p=f()][++$i->p]; unset($i); echo "\n" . '$i->p->q=f(): '; +$i = new stdClass; +$i->p = new stdClass; echo $a[$i->p->q=f()][++$i->p->q]; unset($i); echo "\n" . '$i->p[0]=f(): '; +$i = new stdClass; echo $a[$i->p[0]=f()][++$i->p[0]]; unset($i); echo "\n" . '$i->p[0]->p=f(): '; +$i = new stdClass; +$i->p[0] = new stdClass; echo $a[$i->p[0]->p=f()][++$i->p[0]->p]; unset($i); Class C { - static $p; + static $p; } echo "\n" . 'C::$p=f(): '; @@ -59,28 +65,16 @@ echo "\n" . 'C::$p->q=f(): '; C::$p = new stdclass; echo $a[C::$p->q=f()][++C::$p->q]; ?> ---EXPECTF-- +--EXPECT-- $i=f(): good $$x=f(): good ${'i'}=f(): good $i[0]=f(): good $i[0][0]=f(): good -$i->p=f(): -Warning: Creating default object from empty value in %s on line %d -good -$i->p->q=f(): -Warning: Creating default object from empty value in %s on line %d - -Warning: Creating default object from empty value in %s on line %d -good -$i->p[0]=f(): -Warning: Creating default object from empty value in %s on line %d -good -$i->p[0]->p=f(): -Warning: Creating default object from empty value in %s on line %d - -Warning: Creating default object from empty value in %s on line %d -good +$i->p=f(): good +$i->p->q=f(): good +$i->p[0]=f(): good +$i->p[0]->p=f(): good C::$p=f(): good C::$p[0]=f(): good C::$p->q=f(): good 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..c4ca3019f3 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"; @@ -33,13 +33,13 @@ echo "done.\n"; --EXPECTF-- Not an array. -Warning: Invalid argument supplied for foreach() in %s on line 4 +Warning: foreach() argument must be of type array|object, bool given in %s on line 4 -Warning: Invalid argument supplied for foreach() in %s on line 9 +Warning: foreach() argument must be of type array|object, null given in %s on line 9 -Warning: Invalid argument supplied for foreach() in %s on line 14 +Warning: foreach() argument must be of type array|object, int given in %s on line 14 -Warning: Invalid argument supplied for foreach() in %s on line 19 +Warning: foreach() argument must be of type array|object, float given in %s on line 19 -Warning: Invalid argument supplied for foreach() in %s on line 24 +Warning: foreach() argument must be of type array|object, string given in %s on line 24 done. 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 fa1267fa8d..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,60 +40,67 @@ 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); echo "\n" . '$a->b' . "\n"; + $a = new stdClass; $b = $a->b = array('original'); foreach($a->b as $k=>&$v) { - $v = 'changed'; + $v = 'changed'; } var_dump($b); unset($a, $b); echo "\n" . '$a->b->c' . "\n"; + $a = new stdClass; + $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); echo "\n" . '$a->b[0]' . "\n"; + $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); echo "\n" . '$a->b[0][0]' . "\n"; + $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); echo "\n" . '$a->b[0]->c' . "\n"; + $a = new stdClass; + $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); @@ -102,21 +109,22 @@ 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); echo "\n" . 'C::$a[0]->b' . "\n"; + C::$a[0] = new stdClass; 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); ?> ---EXPECTF-- +--EXPECT-- $a array(1) { [0]=> @@ -148,44 +156,30 @@ array(1) { } $a->b - -Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" } $a->b->c - -Warning: Creating default object from empty value in %s on line %d - -Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" } $a->b[0] - -Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" } $a->b[0][0] - -Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" } $a->b[0]->c - -Warning: Creating default object from empty value in %s on line %d - -Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" @@ -204,8 +198,6 @@ array(1) { } C::$a[0]->b - -Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" diff --git a/tests/lang/foreachLoopIterator.001.phpt b/tests/lang/foreachLoopIterator.001.phpt index 61fffc617a..ec84980524 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,18 +54,17 @@ $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 = " "; } ?> -===DONE=== --EXPECTF-- object(MealIterator)#%d (2) { ["pos":"MealIterator":private]=> @@ -129,6 +128,5 @@ meal 0 => breakfast --> MealIterator::valid (3) --> MealIterator::next (3) -Notice: Undefined offset: 3 in %s on line %d +Warning: Undefined array key 3 in %s on line %d --> MealIterator::valid (4) -===DONE=== 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 47baeab42c..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,18 +117,17 @@ $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 = " "; } ?> -===DONE=== --EXPECTF-- object(EuropeanMeals)#%d (2) { ["storedEnglishMealIterator":"EuropeanMeals":private]=> @@ -267,4 +266,3 @@ meal 1 => dinner --> EnglishMealIterator::valid (3) --> EnglishMealIterator::next (3) --> EnglishMealIterator::valid (4) -===DONE=== diff --git a/tests/lang/foreachLoopIteratorAggregate.002.phpt b/tests/lang/foreachLoopIteratorAggregate.002.phpt index d4b8d2f2da..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"); @@ -44,10 +44,8 @@ f("bad3"); f("bad4"); ?> -===DONE=== --EXPECT-- 30: Objects returned by bad1::getIterator() must be traversable or implement interface Iterator 30: Objects returned by bad2::getIterator() must be traversable or implement interface Iterator 30: Objects returned by bad3::getIterator() must be traversable or implement interface Iterator 30: Objects returned by bad4::getIterator() must be traversable or implement interface Iterator -===DONE=== diff --git a/tests/lang/foreachLoopIteratorAggregate.003.phpt b/tests/lang/foreachLoopIteratorAggregate.003.phpt index adc8fe5351..cf9d2f73f4 100644 --- a/tests/lang/foreachLoopIteratorAggregate.003.phpt +++ b/tests/lang/foreachLoopIteratorAggregate.003.phpt @@ -3,76 +3,75 @@ 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"; } ?> -===DONE=== --EXPECT-- -----( A1: )----- --> EnglishMealIterator::rewind (0) @@ -130,4 +129,3 @@ meal 1 => dinner meal 2 => tea --> EnglishMealIterator::next (2) --> EnglishMealIterator::valid (3) -===DONE=== diff --git a/tests/lang/foreachLoopIteratorAggregate.004.phpt b/tests/lang/foreachLoopIteratorAggregate.004.phpt index 30c422b2c8..0e46fec7f0 100644 --- a/tests/lang/foreachLoopIteratorAggregate.004.phpt +++ b/tests/lang/foreachLoopIteratorAggregate.004.phpt @@ -4,68 +4,67 @@ 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); ?> -===DONE=== --EXPECT-- c::getIterator c_iter::__construct @@ -101,4 +100,3 @@ c_iter::current double:2:0 c_iter::next c_iter::valid = false -===DONE=== 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 e1e96c86f0..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,26 +147,25 @@ 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); ?> -===DONE=== --EXPECTF-- Iterate over various generations from within overridden methods: @@ -584,4 +583,3 @@ object(E)#%d (8) { ["e":"C":private]=> string(10) "Original e" } -===DONE=== diff --git a/tests/lang/foreachLoopObjects.003.phpt b/tests/lang/foreachLoopObjects.003.phpt index 0d0e073eb6..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,38 +52,37 @@ 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); ?> -===DONE=== --EXPECTF-- Directly changing object values. string(10) "Original a" @@ -247,4 +246,3 @@ object(C)#%d (2) { ["e":"C":private]=> string(10) "Original e" } -===DONE=== diff --git a/tests/lang/foreachLoopObjects.004.phpt b/tests/lang/foreachLoopObjects.004.phpt index 01e4e9fd9a..613037f2ca 100644 --- a/tests/lang/foreachLoopObjects.004.phpt +++ b/tests/lang/foreachLoopObjects.004.phpt @@ -4,43 +4,42 @@ 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); ?> -===DONE=== --EXPECTF-- Removing the current element from an iterated object. string(10) "Original a" string(10) "Original b" -Notice: Undefined property: C::$b in %s on line %d +Warning: Undefined property: C::$b in %s on line %d string(10) "Original c" -Notice: Undefined property: C::$b in %s on line %d +Warning: Undefined property: C::$b in %s on line %d string(10) "Original d" -Notice: Undefined property: C::$b in %s on line %d +Warning: Undefined property: C::$b in %s on line %d string(10) "Original e" object(C)#%d (4) { ["a"]=> @@ -52,4 +51,3 @@ object(C)#%d (4) { ["e"]=> string(10) "Original e" } -===DONE=== 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_object_001.phpt b/tests/lang/foreach_with_object_001.phpt index 598b844fb7..98a8f19339 100644 --- a/tests/lang/foreach_with_object_001.phpt +++ b/tests/lang/foreach_with_object_001.phpt @@ -15,11 +15,9 @@ foreach ($obj->c()->a as $value) { } ?> -===DONE=== --EXPECT-- 1 2 3 4 5 -===DONE=== diff --git a/tests/lang/foreach_with_references_001.phpt b/tests/lang/foreach_with_references_001.phpt index a1f7c33600..a9a4ee8aa5 100644 --- a/tests/lang/foreach_with_references_001.phpt +++ b/tests/lang/foreach_with_references_001.phpt @@ -6,16 +6,17 @@ 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); +?> --EXPECT-- Array ( 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.003.phpt b/tests/lang/func_get_arg.003.phpt index 4ef9967674..7021f31450 100644 --- a/tests/lang/func_get_arg.003.phpt +++ b/tests/lang/func_get_arg.003.phpt @@ -3,9 +3,12 @@ func_get_arg outside of a function declaration --FILE-- <?php -var_dump (func_get_arg(0)); +try { + var_dump(func_get_arg(0)); +} catch (\Error $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> ---EXPECTF-- -Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d -bool(false) +--EXPECT-- +func_get_arg() cannot be called from the global scope diff --git a/tests/lang/func_get_arg.004.phpt b/tests/lang/func_get_arg.004.phpt index 0a4547ec18..91e0025ee4 100644 --- a/tests/lang/func_get_arg.004.phpt +++ b/tests/lang/func_get_arg.004.phpt @@ -5,12 +5,14 @@ func_get_arg on non-existent arg function foo($a) { - var_dump(func_get_arg(2)); + try { + var_dump(func_get_arg(2)); + } catch (\Error $e) { + echo $e->getMessage() . \PHP_EOL; + } } foo(2, 3); -echo "\n"; ?> ---EXPECTF-- -Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d -bool(false) +--EXPECT-- +func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function 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_arg_variation.phpt b/tests/lang/func_get_arg_variation.phpt index 741b6604c0..1c4f243fbf 100644 --- a/tests/lang/func_get_arg_variation.phpt +++ b/tests/lang/func_get_arg_variation.phpt @@ -6,22 +6,21 @@ func_get_arg test function foo($a) { $a=5; - echo func_get_arg(); - echo func_get_arg(2,2); - echo func_get_arg("hello"); - echo func_get_arg(-1); - echo func_get_arg(2); + try { + echo func_get_arg(-1); + } catch (\Error $e) { + echo $e->getMessage() . \PHP_EOL; + } + + try { + echo func_get_arg(2); + } catch (\Error $e) { + echo $e->getMessage() . \PHP_EOL; + } } foo(2); -echo "\n"; -?> ---EXPECTF-- -Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d - -Warning: func_get_arg() expects exactly 1 parameter, 2 given in %s on line %d -Warning: func_get_arg() expects parameter 1 to be int, string given in %s on line %d - -Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d - -Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d +?> +--EXPECT-- +func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 +func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function 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.003.phpt b/tests/lang/func_get_args.003.phpt index 844288d904..d56de663c5 100644 --- a/tests/lang/func_get_args.003.phpt +++ b/tests/lang/func_get_args.003.phpt @@ -3,9 +3,12 @@ func_get_args() outside of a function declaration --FILE-- <?php -var_dump(func_get_args()); +try { + var_dump(func_get_args()); +} catch (\Error $e) { + echo $e->getMessage() . \PHP_EOL; +} ?> ---EXPECTREGEX-- -Warning\: func_get_args\(\)\: Called from the global scope - no function context in \S* on line 3 -bool\(false\) +--EXPECT-- +func_get_args() cannot be called from the global scope 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.003.phpt b/tests/lang/func_num_args.003.phpt index 1520c31ed4..0d97109dcc 100644 --- a/tests/lang/func_num_args.003.phpt +++ b/tests/lang/func_num_args.003.phpt @@ -3,9 +3,12 @@ func_num_args() outside of a function declaration --FILE-- <?php -var_dump(func_num_args()); +try { + func_num_args(); +} catch (Error $exception) { + echo $exception->getMessage() . "\n"; +} ?> ---EXPECTF-- -Warning: func_num_args(): Called from the global scope - no function context in %s on line %d -int(-1) +--EXPECT-- +func_num_args() must be called from a function context 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/invalid_octal.phpt b/tests/lang/invalid_octal.phpt index 213b521e88..4e14d09d7b 100644 --- a/tests/lang/invalid_octal.phpt +++ b/tests/lang/invalid_octal.phpt @@ -4,5 +4,6 @@ Invalid octal <?php $x = 08; +?> --EXPECTF-- Parse error: Invalid numeric literal in %s on line 3 diff --git a/tests/lang/operators/add_basiclong_64bit.phpt b/tests/lang/operators/add_basiclong_64bit.phpt index 0168843494..2e7a412243 100644 --- a/tests/lang/operators/add_basiclong_64bit.phpt +++ b/tests/lang/operators/add_basiclong_64bit.phpt @@ -24,45 +24,44 @@ 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); } } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 + 0 --- int(9223372036854775807) --- testing: 9223372036854775807 + 1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775807 + -1 --- int(9223372036854775806) --- testing: 9223372036854775807 + 7 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775807 + 9 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775807 + 65 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775807 + -44 --- int(9223372036854775763) --- testing: 9223372036854775807 + 2147483647 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 9223372036854775807 + 9223372036854775807 --- -float(1.844674407371E+19) +float(1.8446744073709552E+19) --- testing: -9223372036854775808 + 0 --- int(-9223372036854775808) --- testing: -9223372036854775808 + 1 --- int(-9223372036854775807) --- testing: -9223372036854775808 + -1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775808 + 7 --- int(-9223372036854775801) --- testing: -9223372036854775808 + 9 --- @@ -70,7 +69,7 @@ int(-9223372036854775799) --- testing: -9223372036854775808 + 65 --- int(-9223372036854775743) --- testing: -9223372036854775808 + -44 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775808 + 2147483647 --- int(-9223372034707292161) --- testing: -9223372036854775808 + 9223372036854775807 --- @@ -92,7 +91,7 @@ int(2147483603) --- testing: 2147483647 + 2147483647 --- int(4294967294) --- testing: 2147483647 + 9223372036854775807 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: -2147483648 + 0 --- int(-2147483648) --- testing: -2147483648 + 1 --- @@ -128,7 +127,7 @@ int(9223372034707292116) --- testing: 9223372034707292160 + 2147483647 --- int(9223372036854775807) --- testing: 9223372034707292160 + 9223372036854775807 --- -float(1.8446744071562E+19) +float(1.8446744071562068E+19) --- testing: -9223372034707292160 + 0 --- int(-9223372034707292160) --- testing: -9223372034707292160 + 1 --- @@ -164,7 +163,7 @@ int(2147483604) --- testing: 2147483648 + 2147483647 --- int(4294967295) --- testing: 2147483648 + 9223372036854775807 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: -2147483649 + 0 --- int(-2147483649) --- testing: -2147483649 + 1 --- @@ -200,7 +199,7 @@ int(4294967250) --- testing: 4294967294 + 2147483647 --- int(6442450941) --- testing: 4294967294 + 9223372036854775807 --- -float(9.2233720411497E+18) +float(9.223372041149743E+18) --- testing: 4294967295 + 0 --- int(4294967295) --- testing: 4294967295 + 1 --- @@ -218,7 +217,7 @@ int(4294967251) --- testing: 4294967295 + 2147483647 --- int(6442450942) --- testing: 4294967295 + 9223372036854775807 --- -float(9.2233720411497E+18) +float(9.223372041149743E+18) --- testing: 4294967293 + 0 --- int(4294967293) --- testing: 4294967293 + 1 --- @@ -236,7 +235,7 @@ int(4294967249) --- testing: 4294967293 + 2147483647 --- int(6442450940) --- testing: 4294967293 + 9223372036854775807 --- -float(9.2233720411497E+18) +float(9.223372041149743E+18) --- testing: 9223372036854775806 + 0 --- int(9223372036854775806) --- testing: 9223372036854775806 + 1 --- @@ -244,35 +243,35 @@ int(9223372036854775807) --- testing: 9223372036854775806 + -1 --- int(9223372036854775805) --- testing: 9223372036854775806 + 7 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775806 + 9 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775806 + 65 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775806 + -44 --- int(9223372036854775762) --- testing: 9223372036854775806 + 2147483647 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 9223372036854775806 + 9223372036854775807 --- -float(1.844674407371E+19) +float(1.8446744073709552E+19) --- testing: 9.2233720368548E+18 + 0 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 + 1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 + -1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 + 7 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 + 9 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 + 65 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 + -44 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 + 2147483647 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 9.2233720368548E+18 + 9223372036854775807 --- -float(1.844674407371E+19) +float(1.8446744073709552E+19) --- testing: -9223372036854775807 + 0 --- int(-9223372036854775807) --- testing: -9223372036854775807 + 1 --- @@ -286,27 +285,27 @@ int(-9223372036854775798) --- testing: -9223372036854775807 + 65 --- int(-9223372036854775742) --- testing: -9223372036854775807 + -44 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775807 + 2147483647 --- int(-9223372034707292160) --- testing: -9223372036854775807 + 9223372036854775807 --- int(0) --- testing: -9.2233720368548E+18 + 0 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 + 1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 + -1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 + 7 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 + 9 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 + 65 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 + -44 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 + 2147483647 --- -float(-9.2233720347073E+18) +float(-9.223372034707292E+18) --- testing: -9.2233720368548E+18 + 9223372036854775807 --- float(0) --- testing: 0 + 9223372036854775807 --- @@ -334,13 +333,13 @@ int(4294967293) --- testing: 0 + 9223372036854775806 --- int(9223372036854775806) --- testing: 0 + 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 0 + -9223372036854775807 --- int(-9223372036854775807) --- testing: 0 + -9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 1 + 9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 1 + -9223372036854775808 --- int(-9223372036854775807) --- testing: 1 + 2147483647 --- @@ -364,15 +363,15 @@ int(4294967294) --- testing: 1 + 9223372036854775806 --- int(9223372036854775807) --- testing: 1 + 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 1 + -9223372036854775807 --- int(-9223372036854775806) --- testing: 1 + -9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -1 + 9223372036854775807 --- int(9223372036854775806) --- testing: -1 + -9223372036854775808 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -1 + 2147483647 --- int(2147483646) --- testing: -1 + -2147483648 --- @@ -394,13 +393,13 @@ int(4294967292) --- testing: -1 + 9223372036854775806 --- int(9223372036854775805) --- testing: -1 + 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -1 + -9223372036854775807 --- int(-9223372036854775808) --- testing: -1 + -9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 7 + 9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 7 + -9223372036854775808 --- int(-9223372036854775801) --- testing: 7 + 2147483647 --- @@ -422,15 +421,15 @@ int(4294967302) --- testing: 7 + 4294967293 --- int(4294967300) --- testing: 7 + 9223372036854775806 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 7 + 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 7 + -9223372036854775807 --- int(-9223372036854775800) --- testing: 7 + -9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 9 + 9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9 + -9223372036854775808 --- int(-9223372036854775799) --- testing: 9 + 2147483647 --- @@ -452,15 +451,15 @@ int(4294967304) --- testing: 9 + 4294967293 --- int(4294967302) --- testing: 9 + 9223372036854775806 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9 + 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9 + -9223372036854775807 --- int(-9223372036854775798) --- testing: 9 + -9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 65 + 9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 65 + -9223372036854775808 --- int(-9223372036854775743) --- testing: 65 + 2147483647 --- @@ -482,17 +481,17 @@ int(4294967360) --- testing: 65 + 4294967293 --- int(4294967358) --- testing: 65 + 9223372036854775806 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 65 + 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 65 + -9223372036854775807 --- int(-9223372036854775742) --- testing: 65 + -9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -44 + 9223372036854775807 --- int(9223372036854775763) --- testing: -44 + -9223372036854775808 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -44 + 2147483647 --- int(2147483603) --- testing: -44 + -2147483648 --- @@ -514,13 +513,13 @@ int(4294967249) --- testing: -44 + 9223372036854775806 --- int(9223372036854775762) --- testing: -44 + 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -44 + -9223372036854775807 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -44 + -9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 2147483647 + 9223372036854775807 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 2147483647 + -9223372036854775808 --- int(-9223372034707292161) --- testing: 2147483647 + 2147483647 --- @@ -542,41 +541,40 @@ int(6442450942) --- testing: 2147483647 + 4294967293 --- int(6442450940) --- testing: 2147483647 + 9223372036854775806 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 2147483647 + 9.2233720368548E+18 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 2147483647 + -9223372036854775807 --- int(-9223372034707292160) --- testing: 2147483647 + -9.2233720368548E+18 --- -float(-9.2233720347073E+18) +float(-9.223372034707292E+18) --- testing: 9223372036854775807 + 9223372036854775807 --- -float(1.844674407371E+19) +float(1.8446744073709552E+19) --- testing: 9223372036854775807 + -9223372036854775808 --- int(-1) --- testing: 9223372036854775807 + 2147483647 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 9223372036854775807 + -2147483648 --- int(9223372034707292159) --- testing: 9223372036854775807 + 9223372034707292160 --- -float(1.8446744071562E+19) +float(1.8446744071562068E+19) --- testing: 9223372036854775807 + -9223372034707292160 --- int(2147483647) --- testing: 9223372036854775807 + 2147483648 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 9223372036854775807 + -2147483649 --- int(9223372034707292158) --- testing: 9223372036854775807 + 4294967294 --- -float(9.2233720411497E+18) +float(9.223372041149743E+18) --- testing: 9223372036854775807 + 4294967295 --- -float(9.2233720411497E+18) +float(9.223372041149743E+18) --- testing: 9223372036854775807 + 4294967293 --- -float(9.2233720411497E+18) +float(9.223372041149743E+18) --- testing: 9223372036854775807 + 9223372036854775806 --- -float(1.844674407371E+19) +float(1.8446744073709552E+19) --- testing: 9223372036854775807 + 9.2233720368548E+18 --- -float(1.844674407371E+19) +float(1.8446744073709552E+19) --- testing: 9223372036854775807 + -9223372036854775807 --- int(0) --- testing: 9223372036854775807 + -9.2233720368548E+18 --- float(0) -===DONE=== diff --git a/tests/lang/operators/add_variationStr.phpt b/tests/lang/operators/add_variationStr.phpt index cc5834c578..9f8f19dadb 100644 --- a/tests/lang/operators/add_variationStr.phpt +++ b/tests/lang/operators/add_variationStr.phpt @@ -11,15 +11,17 @@ $strVals = array( error_reporting(E_ERROR); foreach ($strVals as $strVal) { - foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' + '$otherVal' ---\n"; - var_dump($strVal+$otherVal); - } + foreach($strVals as $otherVal) { + echo "--- testing: '$strVal' + '$otherVal' ---\n"; + try { + var_dump($strVal+$otherVal); + } catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; + } + } } - ?> -===DONE=== --EXPECT-- --- testing: '0' + '0' --- int(0) @@ -32,7 +34,7 @@ float(1.2) --- testing: '0' + '-7.7' --- float(-7.7) --- testing: '0' + 'abc' --- -int(0) +Unsupported operand types: string + string --- testing: '0' + '123abc' --- int(123) --- testing: '0' + '123e5' --- @@ -48,7 +50,7 @@ int(123) --- testing: '0' + '3.4a' --- float(3.4) --- testing: '0' + 'a5.9' --- -int(0) +Unsupported operand types: string + string --- testing: '65' + '0' --- int(65) --- testing: '65' + '65' --- @@ -60,7 +62,7 @@ float(66.2) --- testing: '65' + '-7.7' --- float(57.3) --- testing: '65' + 'abc' --- -int(65) +Unsupported operand types: string + string --- testing: '65' + '123abc' --- int(188) --- testing: '65' + '123e5' --- @@ -76,7 +78,7 @@ int(188) --- testing: '65' + '3.4a' --- float(68.4) --- testing: '65' + 'a5.9' --- -int(65) +Unsupported operand types: string + string --- testing: '-44' + '0' --- int(-44) --- testing: '-44' + '65' --- @@ -88,7 +90,7 @@ float(-42.8) --- testing: '-44' + '-7.7' --- float(-51.7) --- testing: '-44' + 'abc' --- -int(-44) +Unsupported operand types: string + string --- testing: '-44' + '123abc' --- int(79) --- testing: '-44' + '123e5' --- @@ -104,7 +106,7 @@ int(79) --- testing: '-44' + '3.4a' --- float(-40.6) --- testing: '-44' + 'a5.9' --- -int(-44) +Unsupported operand types: string + string --- testing: '1.2' + '0' --- float(1.2) --- testing: '1.2' + '65' --- @@ -116,7 +118,7 @@ float(2.4) --- testing: '1.2' + '-7.7' --- float(-6.5) --- testing: '1.2' + 'abc' --- -float(1.2) +Unsupported operand types: string + string --- testing: '1.2' + '123abc' --- float(124.2) --- testing: '1.2' + '123e5' --- @@ -132,7 +134,7 @@ float(124.2) --- testing: '1.2' + '3.4a' --- float(4.6) --- testing: '1.2' + 'a5.9' --- -float(1.2) +Unsupported operand types: string + string --- testing: '-7.7' + '0' --- float(-7.7) --- testing: '-7.7' + '65' --- @@ -144,7 +146,7 @@ float(-6.5) --- testing: '-7.7' + '-7.7' --- float(-15.4) --- testing: '-7.7' + 'abc' --- -float(-7.7) +Unsupported operand types: string + string --- testing: '-7.7' + '123abc' --- float(115.3) --- testing: '-7.7' + '123e5' --- @@ -158,37 +160,37 @@ float(115.3) --- testing: '-7.7' + '123abc ' --- float(115.3) --- testing: '-7.7' + '3.4a' --- -float(-4.3) +float(-4.300000000000001) --- testing: '-7.7' + 'a5.9' --- -float(-7.7) +Unsupported operand types: string + string --- testing: 'abc' + '0' --- -int(0) +Unsupported operand types: string + string --- testing: 'abc' + '65' --- -int(65) +Unsupported operand types: string + string --- testing: 'abc' + '-44' --- -int(-44) +Unsupported operand types: string + string --- testing: 'abc' + '1.2' --- -float(1.2) +Unsupported operand types: string + string --- testing: 'abc' + '-7.7' --- -float(-7.7) +Unsupported operand types: string + string --- testing: 'abc' + 'abc' --- -int(0) +Unsupported operand types: string + string --- testing: 'abc' + '123abc' --- -int(123) +Unsupported operand types: string + string --- testing: 'abc' + '123e5' --- -float(12300000) +Unsupported operand types: string + string --- testing: 'abc' + '123e5xyz' --- -float(12300000) +Unsupported operand types: string + string --- testing: 'abc' + ' 123abc' --- -int(123) +Unsupported operand types: string + string --- testing: 'abc' + '123 abc' --- -int(123) +Unsupported operand types: string + string --- testing: 'abc' + '123abc ' --- -int(123) +Unsupported operand types: string + string --- testing: 'abc' + '3.4a' --- -float(3.4) +Unsupported operand types: string + string --- testing: 'abc' + 'a5.9' --- -int(0) +Unsupported operand types: string + string --- testing: '123abc' + '0' --- int(123) --- testing: '123abc' + '65' --- @@ -200,7 +202,7 @@ float(124.2) --- testing: '123abc' + '-7.7' --- float(115.3) --- testing: '123abc' + 'abc' --- -int(123) +Unsupported operand types: string + string --- testing: '123abc' + '123abc' --- int(246) --- testing: '123abc' + '123e5' --- @@ -216,7 +218,7 @@ int(246) --- testing: '123abc' + '3.4a' --- float(126.4) --- testing: '123abc' + 'a5.9' --- -int(123) +Unsupported operand types: string + string --- testing: '123e5' + '0' --- float(12300000) --- testing: '123e5' + '65' --- @@ -228,7 +230,7 @@ float(12300001.2) --- testing: '123e5' + '-7.7' --- float(12299992.3) --- testing: '123e5' + 'abc' --- -float(12300000) +Unsupported operand types: string + string --- testing: '123e5' + '123abc' --- float(12300123) --- testing: '123e5' + '123e5' --- @@ -244,7 +246,7 @@ float(12300123) --- testing: '123e5' + '3.4a' --- float(12300003.4) --- testing: '123e5' + 'a5.9' --- -float(12300000) +Unsupported operand types: string + string --- testing: '123e5xyz' + '0' --- float(12300000) --- testing: '123e5xyz' + '65' --- @@ -256,7 +258,7 @@ float(12300001.2) --- testing: '123e5xyz' + '-7.7' --- float(12299992.3) --- testing: '123e5xyz' + 'abc' --- -float(12300000) +Unsupported operand types: string + string --- testing: '123e5xyz' + '123abc' --- float(12300123) --- testing: '123e5xyz' + '123e5' --- @@ -272,7 +274,7 @@ float(12300123) --- testing: '123e5xyz' + '3.4a' --- float(12300003.4) --- testing: '123e5xyz' + 'a5.9' --- -float(12300000) +Unsupported operand types: string + string --- testing: ' 123abc' + '0' --- int(123) --- testing: ' 123abc' + '65' --- @@ -284,7 +286,7 @@ float(124.2) --- testing: ' 123abc' + '-7.7' --- float(115.3) --- testing: ' 123abc' + 'abc' --- -int(123) +Unsupported operand types: string + string --- testing: ' 123abc' + '123abc' --- int(246) --- testing: ' 123abc' + '123e5' --- @@ -300,7 +302,7 @@ int(246) --- testing: ' 123abc' + '3.4a' --- float(126.4) --- testing: ' 123abc' + 'a5.9' --- -int(123) +Unsupported operand types: string + string --- testing: '123 abc' + '0' --- int(123) --- testing: '123 abc' + '65' --- @@ -312,7 +314,7 @@ float(124.2) --- testing: '123 abc' + '-7.7' --- float(115.3) --- testing: '123 abc' + 'abc' --- -int(123) +Unsupported operand types: string + string --- testing: '123 abc' + '123abc' --- int(246) --- testing: '123 abc' + '123e5' --- @@ -328,7 +330,7 @@ int(246) --- testing: '123 abc' + '3.4a' --- float(126.4) --- testing: '123 abc' + 'a5.9' --- -int(123) +Unsupported operand types: string + string --- testing: '123abc ' + '0' --- int(123) --- testing: '123abc ' + '65' --- @@ -340,7 +342,7 @@ float(124.2) --- testing: '123abc ' + '-7.7' --- float(115.3) --- testing: '123abc ' + 'abc' --- -int(123) +Unsupported operand types: string + string --- testing: '123abc ' + '123abc' --- int(246) --- testing: '123abc ' + '123e5' --- @@ -356,7 +358,7 @@ int(246) --- testing: '123abc ' + '3.4a' --- float(126.4) --- testing: '123abc ' + 'a5.9' --- -int(123) +Unsupported operand types: string + string --- testing: '3.4a' + '0' --- float(3.4) --- testing: '3.4a' + '65' --- @@ -366,9 +368,9 @@ float(-40.6) --- testing: '3.4a' + '1.2' --- float(4.6) --- testing: '3.4a' + '-7.7' --- -float(-4.3) +float(-4.300000000000001) --- testing: '3.4a' + 'abc' --- -float(3.4) +Unsupported operand types: string + string --- testing: '3.4a' + '123abc' --- float(126.4) --- testing: '3.4a' + '123e5' --- @@ -384,33 +386,32 @@ float(126.4) --- testing: '3.4a' + '3.4a' --- float(6.8) --- testing: '3.4a' + 'a5.9' --- -float(3.4) +Unsupported operand types: string + string --- testing: 'a5.9' + '0' --- -int(0) +Unsupported operand types: string + string --- testing: 'a5.9' + '65' --- -int(65) +Unsupported operand types: string + string --- testing: 'a5.9' + '-44' --- -int(-44) +Unsupported operand types: string + string --- testing: 'a5.9' + '1.2' --- -float(1.2) +Unsupported operand types: string + string --- testing: 'a5.9' + '-7.7' --- -float(-7.7) +Unsupported operand types: string + string --- testing: 'a5.9' + 'abc' --- -int(0) +Unsupported operand types: string + string --- testing: 'a5.9' + '123abc' --- -int(123) +Unsupported operand types: string + string --- testing: 'a5.9' + '123e5' --- -float(12300000) +Unsupported operand types: string + string --- testing: 'a5.9' + '123e5xyz' --- -float(12300000) +Unsupported operand types: string + string --- testing: 'a5.9' + ' 123abc' --- -int(123) +Unsupported operand types: string + string --- testing: 'a5.9' + '123 abc' --- -int(123) +Unsupported operand types: string + string --- testing: 'a5.9' + '123abc ' --- -int(123) +Unsupported operand types: string + string --- testing: 'a5.9' + '3.4a' --- -float(3.4) +Unsupported operand types: string + string --- testing: 'a5.9' + 'a5.9' --- -int(0) -===DONE=== +Unsupported operand types: string + string diff --git a/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt b/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt index 30bdcf4c60..22982c7bc3 100644 --- a/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt @@ -24,20 +24,19 @@ 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); } } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 & 0 --- int(0) @@ -579,4 +578,3 @@ int(0) int(1) --- testing: 9223372036854775807 & -9.2233720368548E+18 --- int(0) -===DONE=== diff --git a/tests/lang/operators/bitwiseAnd_variationStr.phpt b/tests/lang/operators/bitwiseAnd_variationStr.phpt index 50ddb9ddb5..ed3d55f714 100644 --- a/tests/lang/operators/bitwiseAnd_variationStr.phpt +++ b/tests/lang/operators/bitwiseAnd_variationStr.phpt @@ -12,14 +12,13 @@ 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)); } } ?> -===DONE=== --EXPECT-- --- testing: '0' & '0' --- string(2) "30" @@ -413,4 +412,3 @@ string(8) "21302221" string(8) "21242421" --- testing: 'a5.9' & 'a5.9' --- string(8) "61352e39" -===DONE=== diff --git a/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt b/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt index 5b8d7c9c48..72db6d5728 100644 --- a/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt @@ -25,7 +25,6 @@ foreach ($longVals as $longVal) { } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 --- int(-9223372036854775808) @@ -57,4 +56,3 @@ int(9223372036854775807) int(9223372036854775806) --- testing: -9.2233720368548E+18 --- int(9223372036854775807) -===DONE=== diff --git a/tests/lang/operators/bitwiseNot_variationStr.phpt b/tests/lang/operators/bitwiseNot_variationStr.phpt index d0f8a75933..5319390164 100644 --- a/tests/lang/operators/bitwiseNot_variationStr.phpt +++ b/tests/lang/operators/bitwiseNot_variationStr.phpt @@ -15,7 +15,6 @@ foreach ($strVals as $strVal) { } ?> -===DONE=== --EXPECT-- --- testing: '0' --- string(2) "cf" @@ -45,4 +44,3 @@ string(14) "cecdcc9e9d9cdf" string(8) "ccd1cb9e" --- testing: 'a5.9' --- string(8) "9ecad1c6" -===DONE=== diff --git a/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt b/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt index 16d7dba40f..50b39181b1 100644 --- a/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt @@ -24,20 +24,19 @@ 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); } } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 | 0 --- int(9223372036854775807) @@ -579,4 +578,3 @@ int(-1) int(-1) --- testing: 9223372036854775807 | -9.2233720368548E+18 --- int(-1) -===DONE=== diff --git a/tests/lang/operators/bitwiseOr_variationStr.phpt b/tests/lang/operators/bitwiseOr_variationStr.phpt index a883c4687a..f11b8d8df6 100644 --- a/tests/lang/operators/bitwiseOr_variationStr.phpt +++ b/tests/lang/operators/bitwiseOr_variationStr.phpt @@ -12,14 +12,13 @@ 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)); } } ?> -===DONE=== --EXPECT-- --- testing: '0' | '0' --- string(2) "30" @@ -413,4 +412,3 @@ string(14) "71373f79626320" string(8) "733f3e79" --- testing: 'a5.9' | 'a5.9' --- string(8) "61352e39" -===DONE=== diff --git a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt index 218abf9d7a..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"; @@ -45,7 +45,6 @@ foreach ($otherVals as $otherVal) { } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 << 0 --- int(9223372036854775807) @@ -587,4 +586,3 @@ Exception: Bit shift by negative number Exception: Bit shift by negative number --- testing: 9223372036854775807 << -9.2233720368548E+18 --- Exception: Bit shift by negative number -===DONE=== diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt index db9c5be060..cf227ddf8f 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt @@ -12,30 +12,29 @@ 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) { - echo "Exception: " . $e->getMessage() . "\n"; + echo get_class($e) . ': ' . $e->getMessage() . "\n"; } } } ?> -===DONE=== --EXPECT-- --- testing: '0' << '0' --- int(0) --- testing: '0' << '65' --- int(0) --- testing: '0' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '0' << '1.2' --- int(0) --- testing: '0' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '0' << 'abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: '0' << '123abc' --- int(0) --- testing: '0' << '123e5' --- @@ -51,19 +50,19 @@ int(0) --- testing: '0' << '3.4a' --- int(0) --- testing: '0' << 'a5.9' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: '65' << '0' --- int(65) --- testing: '65' << '65' --- int(0) --- testing: '65' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '65' << '1.2' --- int(130) --- testing: '65' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '65' << 'abc' --- -int(65) +TypeError: Unsupported operand types: string << string --- testing: '65' << '123abc' --- int(0) --- testing: '65' << '123e5' --- @@ -79,19 +78,19 @@ int(0) --- testing: '65' << '3.4a' --- int(520) --- testing: '65' << 'a5.9' --- -int(65) +TypeError: Unsupported operand types: string << string --- testing: '-44' << '0' --- int(-44) --- testing: '-44' << '65' --- int(0) --- testing: '-44' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-44' << '1.2' --- int(-88) --- testing: '-44' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-44' << 'abc' --- -int(-44) +TypeError: Unsupported operand types: string << string --- testing: '-44' << '123abc' --- int(0) --- testing: '-44' << '123e5' --- @@ -107,19 +106,19 @@ int(0) --- testing: '-44' << '3.4a' --- int(-352) --- testing: '-44' << 'a5.9' --- -int(-44) +TypeError: Unsupported operand types: string << string --- testing: '1.2' << '0' --- int(1) --- testing: '1.2' << '65' --- int(0) --- testing: '1.2' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '1.2' << '1.2' --- int(2) --- testing: '1.2' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '1.2' << 'abc' --- -int(1) +TypeError: Unsupported operand types: string << string --- testing: '1.2' << '123abc' --- int(0) --- testing: '1.2' << '123e5' --- @@ -135,19 +134,19 @@ int(0) --- testing: '1.2' << '3.4a' --- int(8) --- testing: '1.2' << 'a5.9' --- -int(1) +TypeError: Unsupported operand types: string << string --- testing: '-7.7' << '0' --- int(-7) --- testing: '-7.7' << '65' --- int(0) --- testing: '-7.7' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-7.7' << '1.2' --- int(-14) --- testing: '-7.7' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-7.7' << 'abc' --- -int(-7) +TypeError: Unsupported operand types: string << string --- testing: '-7.7' << '123abc' --- int(0) --- testing: '-7.7' << '123e5' --- @@ -163,47 +162,47 @@ int(0) --- testing: '-7.7' << '3.4a' --- int(-56) --- testing: '-7.7' << 'a5.9' --- -int(-7) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '0' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '65' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '-44' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '1.2' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '-7.7' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string << string --- testing: 'abc' << 'abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123e5' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123e5xyz' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << ' 123abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123 abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123abc ' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '3.4a' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << 'a5.9' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: '123abc' << '0' --- int(123) --- testing: '123abc' << '65' --- int(0) --- testing: '123abc' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc' << '1.2' --- int(246) --- testing: '123abc' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc' << 'abc' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123abc' << '123abc' --- int(0) --- testing: '123abc' << '123e5' --- @@ -219,19 +218,19 @@ int(0) --- testing: '123abc' << '3.4a' --- int(984) --- testing: '123abc' << 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123e5' << '0' --- int(12300000) --- testing: '123e5' << '65' --- int(0) --- testing: '123e5' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5' << '1.2' --- int(24600000) --- testing: '123e5' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5' << 'abc' --- -int(12300000) +TypeError: Unsupported operand types: string << string --- testing: '123e5' << '123abc' --- int(0) --- testing: '123e5' << '123e5' --- @@ -247,19 +246,19 @@ int(0) --- testing: '123e5' << '3.4a' --- int(98400000) --- testing: '123e5' << 'a5.9' --- -int(12300000) +TypeError: Unsupported operand types: string << string --- testing: '123e5xyz' << '0' --- int(12300000) --- testing: '123e5xyz' << '65' --- int(0) --- testing: '123e5xyz' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5xyz' << '1.2' --- int(24600000) --- testing: '123e5xyz' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5xyz' << 'abc' --- -int(12300000) +TypeError: Unsupported operand types: string << string --- testing: '123e5xyz' << '123abc' --- int(0) --- testing: '123e5xyz' << '123e5' --- @@ -275,19 +274,19 @@ int(0) --- testing: '123e5xyz' << '3.4a' --- int(98400000) --- testing: '123e5xyz' << 'a5.9' --- -int(12300000) +TypeError: Unsupported operand types: string << string --- testing: ' 123abc' << '0' --- int(123) --- testing: ' 123abc' << '65' --- int(0) --- testing: ' 123abc' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: ' 123abc' << '1.2' --- int(246) --- testing: ' 123abc' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: ' 123abc' << 'abc' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: ' 123abc' << '123abc' --- int(0) --- testing: ' 123abc' << '123e5' --- @@ -303,19 +302,19 @@ int(0) --- testing: ' 123abc' << '3.4a' --- int(984) --- testing: ' 123abc' << 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123 abc' << '0' --- int(123) --- testing: '123 abc' << '65' --- int(0) --- testing: '123 abc' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123 abc' << '1.2' --- int(246) --- testing: '123 abc' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123 abc' << 'abc' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123 abc' << '123abc' --- int(0) --- testing: '123 abc' << '123e5' --- @@ -331,19 +330,19 @@ int(0) --- testing: '123 abc' << '3.4a' --- int(984) --- testing: '123 abc' << 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123abc ' << '0' --- int(123) --- testing: '123abc ' << '65' --- int(0) --- testing: '123abc ' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc ' << '1.2' --- int(246) --- testing: '123abc ' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc ' << 'abc' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123abc ' << '123abc' --- int(0) --- testing: '123abc ' << '123e5' --- @@ -359,19 +358,19 @@ int(0) --- testing: '123abc ' << '3.4a' --- int(984) --- testing: '123abc ' << 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '3.4a' << '0' --- int(3) --- testing: '3.4a' << '65' --- int(0) --- testing: '3.4a' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '3.4a' << '1.2' --- int(6) --- testing: '3.4a' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '3.4a' << 'abc' --- -int(3) +TypeError: Unsupported operand types: string << string --- testing: '3.4a' << '123abc' --- int(0) --- testing: '3.4a' << '123e5' --- @@ -387,33 +386,32 @@ int(0) --- testing: '3.4a' << '3.4a' --- int(24) --- testing: '3.4a' << 'a5.9' --- -int(3) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '0' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '65' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '-44' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '1.2' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '-7.7' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << 'abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123e5' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123e5xyz' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << ' 123abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123 abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123abc ' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '3.4a' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << 'a5.9' --- -int(0) -===DONE=== +TypeError: Unsupported operand types: string << string diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr2.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr2.phpt index 09949c56b0..904181e47c 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr2.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr2.phpt @@ -10,9 +10,7 @@ var_dump("34" << "1"); var_dump("56" << "2"); ?> -===DONE=== --EXPECT-- int(12) int(68) int(224) -===DONE=== diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt index c36e22fef4..c3e7af9892 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt @@ -16,31 +16,30 @@ 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) { - echo "Exception: " . $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo get_class($e) . ': ' . $e->getMessage() . "\n"; } } } ?> -===DONE=== --EXPECT-- --- testing: '0' << '0' --- int(0) --- testing: '0' << '65' --- int(0) --- testing: '0' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '0' << '1.2' --- int(0) --- testing: '0' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '0' << 'abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: '0' << '123abc' --- int(0) --- testing: '0' << '123e5' --- @@ -56,19 +55,19 @@ int(0) --- testing: '0' << '3.4a' --- int(0) --- testing: '0' << 'a5.9' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: '65' << '0' --- int(65) --- testing: '65' << '65' --- int(0) --- testing: '65' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '65' << '1.2' --- int(130) --- testing: '65' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '65' << 'abc' --- -int(65) +TypeError: Unsupported operand types: string << string --- testing: '65' << '123abc' --- int(0) --- testing: '65' << '123e5' --- @@ -84,19 +83,19 @@ int(0) --- testing: '65' << '3.4a' --- int(520) --- testing: '65' << 'a5.9' --- -int(65) +TypeError: Unsupported operand types: string << string --- testing: '-44' << '0' --- int(-44) --- testing: '-44' << '65' --- int(0) --- testing: '-44' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-44' << '1.2' --- int(-88) --- testing: '-44' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-44' << 'abc' --- -int(-44) +TypeError: Unsupported operand types: string << string --- testing: '-44' << '123abc' --- int(0) --- testing: '-44' << '123e5' --- @@ -112,19 +111,19 @@ int(0) --- testing: '-44' << '3.4a' --- int(-352) --- testing: '-44' << 'a5.9' --- -int(-44) +TypeError: Unsupported operand types: string << string --- testing: '1.2' << '0' --- int(1) --- testing: '1.2' << '65' --- int(0) --- testing: '1.2' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '1.2' << '1.2' --- int(2) --- testing: '1.2' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '1.2' << 'abc' --- -int(1) +TypeError: Unsupported operand types: string << string --- testing: '1.2' << '123abc' --- int(0) --- testing: '1.2' << '123e5' --- @@ -140,19 +139,19 @@ int(0) --- testing: '1.2' << '3.4a' --- int(8) --- testing: '1.2' << 'a5.9' --- -int(1) +TypeError: Unsupported operand types: string << string --- testing: '-7.7' << '0' --- int(-7) --- testing: '-7.7' << '65' --- int(0) --- testing: '-7.7' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-7.7' << '1.2' --- int(-14) --- testing: '-7.7' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-7.7' << 'abc' --- -int(-7) +TypeError: Unsupported operand types: string << string --- testing: '-7.7' << '123abc' --- int(0) --- testing: '-7.7' << '123e5' --- @@ -168,47 +167,47 @@ int(0) --- testing: '-7.7' << '3.4a' --- int(-56) --- testing: '-7.7' << 'a5.9' --- -int(-7) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '0' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '65' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '-44' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '1.2' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '-7.7' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string << string --- testing: 'abc' << 'abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123e5' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123e5xyz' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << ' 123abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123 abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '123abc ' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << '3.4a' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'abc' << 'a5.9' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: '123abc' << '0' --- int(123) --- testing: '123abc' << '65' --- int(0) --- testing: '123abc' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc' << '1.2' --- int(246) --- testing: '123abc' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc' << 'abc' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123abc' << '123abc' --- int(0) --- testing: '123abc' << '123e5' --- @@ -224,19 +223,19 @@ int(0) --- testing: '123abc' << '3.4a' --- int(984) --- testing: '123abc' << 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123e5' << '0' --- int(12300000) --- testing: '123e5' << '65' --- int(0) --- testing: '123e5' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5' << '1.2' --- int(24600000) --- testing: '123e5' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5' << 'abc' --- -int(12300000) +TypeError: Unsupported operand types: string << string --- testing: '123e5' << '123abc' --- int(0) --- testing: '123e5' << '123e5' --- @@ -252,19 +251,19 @@ int(0) --- testing: '123e5' << '3.4a' --- int(98400000) --- testing: '123e5' << 'a5.9' --- -int(12300000) +TypeError: Unsupported operand types: string << string --- testing: '123e5xyz' << '0' --- int(12300000) --- testing: '123e5xyz' << '65' --- int(0) --- testing: '123e5xyz' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5xyz' << '1.2' --- int(24600000) --- testing: '123e5xyz' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5xyz' << 'abc' --- -int(12300000) +TypeError: Unsupported operand types: string << string --- testing: '123e5xyz' << '123abc' --- int(0) --- testing: '123e5xyz' << '123e5' --- @@ -280,19 +279,19 @@ int(0) --- testing: '123e5xyz' << '3.4a' --- int(98400000) --- testing: '123e5xyz' << 'a5.9' --- -int(12300000) +TypeError: Unsupported operand types: string << string --- testing: ' 123abc' << '0' --- int(123) --- testing: ' 123abc' << '65' --- int(0) --- testing: ' 123abc' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: ' 123abc' << '1.2' --- int(246) --- testing: ' 123abc' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: ' 123abc' << 'abc' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: ' 123abc' << '123abc' --- int(0) --- testing: ' 123abc' << '123e5' --- @@ -308,19 +307,19 @@ int(0) --- testing: ' 123abc' << '3.4a' --- int(984) --- testing: ' 123abc' << 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123 abc' << '0' --- int(123) --- testing: '123 abc' << '65' --- int(0) --- testing: '123 abc' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123 abc' << '1.2' --- int(246) --- testing: '123 abc' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123 abc' << 'abc' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123 abc' << '123abc' --- int(0) --- testing: '123 abc' << '123e5' --- @@ -336,19 +335,19 @@ int(0) --- testing: '123 abc' << '3.4a' --- int(984) --- testing: '123 abc' << 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123abc ' << '0' --- int(123) --- testing: '123abc ' << '65' --- int(0) --- testing: '123abc ' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc ' << '1.2' --- int(246) --- testing: '123abc ' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc ' << 'abc' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '123abc ' << '123abc' --- int(0) --- testing: '123abc ' << '123e5' --- @@ -364,19 +363,19 @@ int(0) --- testing: '123abc ' << '3.4a' --- int(984) --- testing: '123abc ' << 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string << string --- testing: '3.4a' << '0' --- int(3) --- testing: '3.4a' << '65' --- int(0) --- testing: '3.4a' << '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '3.4a' << '1.2' --- int(6) --- testing: '3.4a' << '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '3.4a' << 'abc' --- -int(3) +TypeError: Unsupported operand types: string << string --- testing: '3.4a' << '123abc' --- int(0) --- testing: '3.4a' << '123e5' --- @@ -392,33 +391,32 @@ int(0) --- testing: '3.4a' << '3.4a' --- int(24) --- testing: '3.4a' << 'a5.9' --- -int(3) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '0' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '65' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '-44' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '1.2' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '-7.7' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << 'abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123e5' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123e5xyz' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << ' 123abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123 abc' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '123abc ' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << '3.4a' --- -int(0) +TypeError: Unsupported operand types: string << string --- testing: 'a5.9' << 'a5.9' --- -int(0) -===DONE=== +TypeError: Unsupported operand types: string << string diff --git a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt index 7a08ed09da..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"; @@ -45,7 +45,6 @@ foreach ($otherVals as $otherVal) { } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 >> 0 --- int(9223372036854775807) @@ -587,4 +586,3 @@ Exception: Bit shift by negative number Exception: Bit shift by negative number --- testing: 9223372036854775807 >> -9.2233720368548E+18 --- Exception: Bit shift by negative number -===DONE=== diff --git a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt index e3c9c8962d..d1f124933c 100644 --- a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt +++ b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt @@ -12,31 +12,30 @@ 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"; + } catch (\Throwable $e) { + echo get_class($e) . ': ' . $e->getMessage() . "\n"; } } } ?> -===DONE=== --EXPECT-- --- testing: '0' >> '0' --- int(0) --- testing: '0' >> '65' --- int(0) --- testing: '0' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '0' >> '1.2' --- int(0) --- testing: '0' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '0' >> 'abc' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: '0' >> '123abc' --- int(0) --- testing: '0' >> '123e5' --- @@ -52,19 +51,19 @@ int(0) --- testing: '0' >> '3.4a' --- int(0) --- testing: '0' >> 'a5.9' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: '65' >> '0' --- int(65) --- testing: '65' >> '65' --- int(0) --- testing: '65' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '65' >> '1.2' --- int(32) --- testing: '65' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '65' >> 'abc' --- -int(65) +TypeError: Unsupported operand types: string >> string --- testing: '65' >> '123abc' --- int(0) --- testing: '65' >> '123e5' --- @@ -80,19 +79,19 @@ int(0) --- testing: '65' >> '3.4a' --- int(8) --- testing: '65' >> 'a5.9' --- -int(65) +TypeError: Unsupported operand types: string >> string --- testing: '-44' >> '0' --- int(-44) --- testing: '-44' >> '65' --- int(-1) --- testing: '-44' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-44' >> '1.2' --- int(-22) --- testing: '-44' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-44' >> 'abc' --- -int(-44) +TypeError: Unsupported operand types: string >> string --- testing: '-44' >> '123abc' --- int(-1) --- testing: '-44' >> '123e5' --- @@ -108,19 +107,19 @@ int(-1) --- testing: '-44' >> '3.4a' --- int(-6) --- testing: '-44' >> 'a5.9' --- -int(-44) +TypeError: Unsupported operand types: string >> string --- testing: '1.2' >> '0' --- int(1) --- testing: '1.2' >> '65' --- int(0) --- testing: '1.2' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '1.2' >> '1.2' --- int(0) --- testing: '1.2' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '1.2' >> 'abc' --- -int(1) +TypeError: Unsupported operand types: string >> string --- testing: '1.2' >> '123abc' --- int(0) --- testing: '1.2' >> '123e5' --- @@ -136,19 +135,19 @@ int(0) --- testing: '1.2' >> '3.4a' --- int(0) --- testing: '1.2' >> 'a5.9' --- -int(1) +TypeError: Unsupported operand types: string >> string --- testing: '-7.7' >> '0' --- int(-7) --- testing: '-7.7' >> '65' --- int(-1) --- testing: '-7.7' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-7.7' >> '1.2' --- int(-4) --- testing: '-7.7' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '-7.7' >> 'abc' --- -int(-7) +TypeError: Unsupported operand types: string >> string --- testing: '-7.7' >> '123abc' --- int(-1) --- testing: '-7.7' >> '123e5' --- @@ -164,47 +163,47 @@ int(-1) --- testing: '-7.7' >> '3.4a' --- int(-1) --- testing: '-7.7' >> 'a5.9' --- -int(-7) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '0' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '65' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '-44' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '1.2' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '-7.7' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> 'abc' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '123abc' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '123e5' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '123e5xyz' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> ' 123abc' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '123 abc' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '123abc ' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> '3.4a' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'abc' >> 'a5.9' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: '123abc' >> '0' --- int(123) --- testing: '123abc' >> '65' --- int(0) --- testing: '123abc' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc' >> '1.2' --- int(61) --- testing: '123abc' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc' >> 'abc' --- -int(123) +TypeError: Unsupported operand types: string >> string --- testing: '123abc' >> '123abc' --- int(0) --- testing: '123abc' >> '123e5' --- @@ -220,19 +219,19 @@ int(0) --- testing: '123abc' >> '3.4a' --- int(15) --- testing: '123abc' >> 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string >> string --- testing: '123e5' >> '0' --- int(12300000) --- testing: '123e5' >> '65' --- int(0) --- testing: '123e5' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5' >> '1.2' --- int(6150000) --- testing: '123e5' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5' >> 'abc' --- -int(12300000) +TypeError: Unsupported operand types: string >> string --- testing: '123e5' >> '123abc' --- int(0) --- testing: '123e5' >> '123e5' --- @@ -248,19 +247,19 @@ int(0) --- testing: '123e5' >> '3.4a' --- int(1537500) --- testing: '123e5' >> 'a5.9' --- -int(12300000) +TypeError: Unsupported operand types: string >> string --- testing: '123e5xyz' >> '0' --- int(12300000) --- testing: '123e5xyz' >> '65' --- int(0) --- testing: '123e5xyz' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5xyz' >> '1.2' --- int(6150000) --- testing: '123e5xyz' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123e5xyz' >> 'abc' --- -int(12300000) +TypeError: Unsupported operand types: string >> string --- testing: '123e5xyz' >> '123abc' --- int(0) --- testing: '123e5xyz' >> '123e5' --- @@ -276,19 +275,19 @@ int(0) --- testing: '123e5xyz' >> '3.4a' --- int(1537500) --- testing: '123e5xyz' >> 'a5.9' --- -int(12300000) +TypeError: Unsupported operand types: string >> string --- testing: ' 123abc' >> '0' --- int(123) --- testing: ' 123abc' >> '65' --- int(0) --- testing: ' 123abc' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: ' 123abc' >> '1.2' --- int(61) --- testing: ' 123abc' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: ' 123abc' >> 'abc' --- -int(123) +TypeError: Unsupported operand types: string >> string --- testing: ' 123abc' >> '123abc' --- int(0) --- testing: ' 123abc' >> '123e5' --- @@ -304,19 +303,19 @@ int(0) --- testing: ' 123abc' >> '3.4a' --- int(15) --- testing: ' 123abc' >> 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string >> string --- testing: '123 abc' >> '0' --- int(123) --- testing: '123 abc' >> '65' --- int(0) --- testing: '123 abc' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123 abc' >> '1.2' --- int(61) --- testing: '123 abc' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123 abc' >> 'abc' --- -int(123) +TypeError: Unsupported operand types: string >> string --- testing: '123 abc' >> '123abc' --- int(0) --- testing: '123 abc' >> '123e5' --- @@ -332,19 +331,19 @@ int(0) --- testing: '123 abc' >> '3.4a' --- int(15) --- testing: '123 abc' >> 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string >> string --- testing: '123abc ' >> '0' --- int(123) --- testing: '123abc ' >> '65' --- int(0) --- testing: '123abc ' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc ' >> '1.2' --- int(61) --- testing: '123abc ' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '123abc ' >> 'abc' --- -int(123) +TypeError: Unsupported operand types: string >> string --- testing: '123abc ' >> '123abc' --- int(0) --- testing: '123abc ' >> '123e5' --- @@ -360,19 +359,19 @@ int(0) --- testing: '123abc ' >> '3.4a' --- int(15) --- testing: '123abc ' >> 'a5.9' --- -int(123) +TypeError: Unsupported operand types: string >> string --- testing: '3.4a' >> '0' --- int(3) --- testing: '3.4a' >> '65' --- int(0) --- testing: '3.4a' >> '-44' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '3.4a' >> '1.2' --- int(1) --- testing: '3.4a' >> '-7.7' --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: '3.4a' >> 'abc' --- -int(3) +TypeError: Unsupported operand types: string >> string --- testing: '3.4a' >> '123abc' --- int(0) --- testing: '3.4a' >> '123e5' --- @@ -388,33 +387,32 @@ int(0) --- testing: '3.4a' >> '3.4a' --- int(0) --- testing: '3.4a' >> 'a5.9' --- -int(3) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '0' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '65' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '-44' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '1.2' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '-7.7' --- -Exception: Bit shift by negative number +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> 'abc' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '123abc' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '123e5' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '123e5xyz' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> ' 123abc' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '123 abc' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '123abc ' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> '3.4a' --- -int(0) +TypeError: Unsupported operand types: string >> string --- testing: 'a5.9' >> 'a5.9' --- -int(0) -===DONE=== +TypeError: Unsupported operand types: string >> string diff --git a/tests/lang/operators/bitwiseShiftRight_variationStr2.phpt b/tests/lang/operators/bitwiseShiftRight_variationStr2.phpt index db90e1b338..eaa905f271 100644 --- a/tests/lang/operators/bitwiseShiftRight_variationStr2.phpt +++ b/tests/lang/operators/bitwiseShiftRight_variationStr2.phpt @@ -10,9 +10,7 @@ var_dump("34" >> "1"); var_dump("56" >> "2"); ?> -===DONE=== --EXPECT-- int(12) int(17) int(14) -===DONE=== diff --git a/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt b/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt index 1ed750cca9..0b40e9feed 100644 --- a/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt @@ -24,20 +24,19 @@ 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); } } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 ^ 0 --- int(9223372036854775807) @@ -579,4 +578,3 @@ int(-1) int(-2) --- testing: 9223372036854775807 ^ -9.2233720368548E+18 --- int(-1) -===DONE=== diff --git a/tests/lang/operators/bitwiseXor_variationStr.phpt b/tests/lang/operators/bitwiseXor_variationStr.phpt index dced933ee4..5a74d124ff 100644 --- a/tests/lang/operators/bitwiseXor_variationStr.phpt +++ b/tests/lang/operators/bitwiseXor_variationStr.phpt @@ -12,14 +12,13 @@ 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)); } } ?> -===DONE=== --EXPECT-- --- testing: '0' ^ '0' --- string(2) "00" @@ -413,4 +412,3 @@ string(8) "50071d58" string(8) "521b1a58" --- testing: 'a5.9' ^ 'a5.9' --- string(8) "00000000" -===DONE=== 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 4349ae0025..65ab5b69a2 100644 --- a/tests/lang/operators/divide_basiclong_64bit.phpt +++ b/tests/lang/operators/divide_basiclong_64bit.phpt @@ -23,24 +23,27 @@ $otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit); error_reporting(E_ERROR); foreach ($longVals as $longVal) { - foreach($otherVals as $otherVal) { - echo "--- testing: $longVal / $otherVal ---\n"; - var_dump($longVal/$otherVal); - } + foreach($otherVals as $otherVal) { + echo "--- testing: $longVal / $otherVal ---\n"; + try { + var_dump($longVal/$otherVal); + } catch (\Throwable $e) { + echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; + } + } } foreach ($otherVals as $otherVal) { foreach($longVals as $longVal) { - echo "--- testing: $otherVal / $longVal ---\n"; + echo "--- testing: $otherVal / $longVal ---\n"; var_dump($otherVal/$longVal); } } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 / 0 --- -float(INF) +DivisionByZeroError: Division by zero --- testing: 9223372036854775807 / 1 --- int(9223372036854775807) --- testing: 9223372036854775807 / -1 --- @@ -48,233 +51,233 @@ int(-9223372036854775807) --- testing: 9223372036854775807 / 7 --- int(1317624576693539401) --- testing: 9223372036854775807 / 9 --- -float(1.0248191152061E+18) +float(1.0248191152060861E+18) --- testing: 9223372036854775807 / 65 --- -float(1.4189803133623E+17) +float(1.4189803133622733E+17) --- testing: 9223372036854775807 / -44 --- -float(-2.096220917467E+17) +float(-2.0962209174669946E+17) --- testing: 9223372036854775807 / 2147483647 --- float(4294967298) --- testing: 9223372036854775807 / 9223372036854775807 --- int(1) --- testing: -9223372036854775808 / 0 --- -float(-INF) +DivisionByZeroError: Division by zero --- testing: -9223372036854775808 / 1 --- int(-9223372036854775808) --- testing: -9223372036854775808 / -1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9223372036854775808 / 7 --- -float(-1.3176245766935E+18) +float(-1.3176245766935393E+18) --- testing: -9223372036854775808 / 9 --- -float(-1.0248191152061E+18) +float(-1.0248191152060861E+18) --- testing: -9223372036854775808 / 65 --- -float(-1.4189803133623E+17) +float(-1.4189803133622733E+17) --- testing: -9223372036854775808 / -44 --- -float(2.096220917467E+17) +float(2.0962209174669946E+17) --- testing: -9223372036854775808 / 2147483647 --- float(-4294967298) --- testing: -9223372036854775808 / 9223372036854775807 --- float(-1) --- testing: 2147483647 / 0 --- -float(INF) +DivisionByZeroError: Division by zero --- testing: 2147483647 / 1 --- int(2147483647) --- testing: 2147483647 / -1 --- int(-2147483647) --- testing: 2147483647 / 7 --- -float(306783378.14286) +float(306783378.14285713) --- testing: 2147483647 / 9 --- -float(238609294.11111) +float(238609294.1111111) --- testing: 2147483647 / 65 --- -float(33038209.953846) +float(33038209.953846153) --- testing: 2147483647 / -44 --- -float(-48806446.522727) +float(-48806446.52272727) --- testing: 2147483647 / 2147483647 --- int(1) --- testing: 2147483647 / 9223372036854775807 --- -float(2.3283064354545E-10) +float(2.328306435454494E-10) --- testing: -2147483648 / 0 --- -float(-INF) +DivisionByZeroError: Division by zero --- testing: -2147483648 / 1 --- int(-2147483648) --- testing: -2147483648 / -1 --- int(2147483648) --- testing: -2147483648 / 7 --- -float(-306783378.28571) +float(-306783378.28571427) --- testing: -2147483648 / 9 --- -float(-238609294.22222) +float(-238609294.2222222) --- testing: -2147483648 / 65 --- -float(-33038209.969231) +float(-33038209.96923077) --- testing: -2147483648 / -44 --- -float(48806446.545455) +float(48806446.54545455) --- testing: -2147483648 / 2147483647 --- -float(-1.0000000004657) +float(-1.0000000004656613) --- testing: -2147483648 / 9223372036854775807 --- -float(-2.3283064365387E-10) +float(-2.3283064365386963E-10) --- testing: 9223372034707292160 / 0 --- -float(INF) +DivisionByZeroError: Division by zero --- testing: 9223372034707292160 / 1 --- int(9223372034707292160) --- testing: 9223372034707292160 / -1 --- int(-9223372034707292160) --- testing: 9223372034707292160 / 7 --- -float(1.3176245763868E+18) +float(1.317624576386756E+18) --- testing: 9223372034707292160 / 9 --- -float(1.0248191149675E+18) +float(1.0248191149674769E+18) --- testing: 9223372034707292160 / 65 --- -float(1.4189803130319E+17) +float(1.418980313031891E+17) --- testing: 9223372034707292160 / -44 --- -float(-2.0962209169789E+17) +float(-2.09622091697893E+17) --- testing: 9223372034707292160 / 2147483647 --- float(4294967297) --- testing: 9223372034707292160 / 9223372036854775807 --- -float(0.99999999976717) +float(0.9999999997671694) --- testing: -9223372034707292160 / 0 --- -float(-INF) +DivisionByZeroError: Division by zero --- testing: -9223372034707292160 / 1 --- int(-9223372034707292160) --- testing: -9223372034707292160 / -1 --- int(9223372034707292160) --- testing: -9223372034707292160 / 7 --- -float(-1.3176245763868E+18) +float(-1.317624576386756E+18) --- testing: -9223372034707292160 / 9 --- -float(-1.0248191149675E+18) +float(-1.0248191149674769E+18) --- testing: -9223372034707292160 / 65 --- -float(-1.4189803130319E+17) +float(-1.418980313031891E+17) --- testing: -9223372034707292160 / -44 --- -float(2.0962209169789E+17) +float(2.09622091697893E+17) --- testing: -9223372034707292160 / 2147483647 --- float(-4294967297) --- testing: -9223372034707292160 / 9223372036854775807 --- -float(-0.99999999976717) +float(-0.9999999997671694) --- testing: 2147483648 / 0 --- -float(INF) +DivisionByZeroError: Division by zero --- testing: 2147483648 / 1 --- int(2147483648) --- testing: 2147483648 / -1 --- int(-2147483648) --- testing: 2147483648 / 7 --- -float(306783378.28571) +float(306783378.28571427) --- testing: 2147483648 / 9 --- -float(238609294.22222) +float(238609294.2222222) --- testing: 2147483648 / 65 --- -float(33038209.969231) +float(33038209.96923077) --- testing: 2147483648 / -44 --- -float(-48806446.545455) +float(-48806446.54545455) --- testing: 2147483648 / 2147483647 --- -float(1.0000000004657) +float(1.0000000004656613) --- testing: 2147483648 / 9223372036854775807 --- -float(2.3283064365387E-10) +float(2.3283064365386963E-10) --- testing: -2147483649 / 0 --- -float(-INF) +DivisionByZeroError: Division by zero --- testing: -2147483649 / 1 --- int(-2147483649) --- testing: -2147483649 / -1 --- int(2147483649) --- testing: -2147483649 / 7 --- -float(-306783378.42857) +float(-306783378.4285714) --- testing: -2147483649 / 9 --- -float(-238609294.33333) +float(-238609294.33333334) --- testing: -2147483649 / 65 --- -float(-33038209.984615) +float(-33038209.984615386) --- testing: -2147483649 / -44 --- -float(48806446.568182) +float(48806446.56818182) --- testing: -2147483649 / 2147483647 --- -float(-1.0000000009313) +float(-1.0000000009313226) --- testing: -2147483649 / 9223372036854775807 --- -float(-2.3283064376229E-10) +float(-2.3283064376228985E-10) --- testing: 4294967294 / 0 --- -float(INF) +DivisionByZeroError: Division by zero --- testing: 4294967294 / 1 --- int(4294967294) --- testing: 4294967294 / -1 --- int(-4294967294) --- testing: 4294967294 / 7 --- -float(613566756.28571) +float(613566756.2857143) --- testing: 4294967294 / 9 --- -float(477218588.22222) +float(477218588.2222222) --- testing: 4294967294 / 65 --- -float(66076419.907692) +float(66076419.907692306) --- testing: 4294967294 / -44 --- -float(-97612893.045455) +float(-97612893.04545455) --- testing: 4294967294 / 2147483647 --- int(2) --- testing: 4294967294 / 9223372036854775807 --- -float(4.656612870909E-10) +float(4.656612870908988E-10) --- testing: 4294967295 / 0 --- -float(INF) +DivisionByZeroError: Division by zero --- testing: 4294967295 / 1 --- int(4294967295) --- testing: 4294967295 / -1 --- int(-4294967295) --- testing: 4294967295 / 7 --- -float(613566756.42857) +float(613566756.4285715) --- testing: 4294967295 / 9 --- -float(477218588.33333) +float(477218588.3333333) --- testing: 4294967295 / 65 --- -float(66076419.923077) +float(66076419.92307692) --- testing: 4294967295 / -44 --- -float(-97612893.068182) +float(-97612893.06818181) --- testing: 4294967295 / 2147483647 --- -float(2.0000000004657) +float(2.0000000004656613) --- testing: 4294967295 / 9223372036854775807 --- -float(4.6566128719932E-10) +float(4.6566128719931904E-10) --- testing: 4294967293 / 0 --- -float(INF) +DivisionByZeroError: Division by zero --- testing: 4294967293 / 1 --- int(4294967293) --- testing: 4294967293 / -1 --- int(-4294967293) --- testing: 4294967293 / 7 --- -float(613566756.14286) +float(613566756.1428572) --- testing: 4294967293 / 9 --- -float(477218588.11111) +float(477218588.1111111) --- testing: 4294967293 / 65 --- -float(66076419.892308) +float(66076419.89230769) --- testing: 4294967293 / -44 --- -float(-97612893.022727) +float(-97612893.02272727) --- testing: 4294967293 / 2147483647 --- -float(1.9999999995343) +float(1.9999999995343387) --- testing: 4294967293 / 9223372036854775807 --- -float(4.6566128698248E-10) +float(4.656612869824786E-10) --- testing: 9223372036854775806 / 0 --- -float(INF) +DivisionByZeroError: Division by zero --- testing: 9223372036854775806 / 1 --- int(9223372036854775806) --- testing: 9223372036854775806 / -1 --- int(-9223372036854775806) --- testing: 9223372036854775806 / 7 --- -float(1.3176245766935E+18) +float(1.3176245766935393E+18) --- testing: 9223372036854775806 / 9 --- -float(1.0248191152061E+18) +float(1.0248191152060861E+18) --- testing: 9223372036854775806 / 65 --- -float(1.4189803133623E+17) +float(1.4189803133622733E+17) --- testing: 9223372036854775806 / -44 --- -float(-2.096220917467E+17) +float(-2.0962209174669946E+17) --- testing: 9223372036854775806 / 2147483647 --- int(4294967298) --- testing: 9223372036854775806 / 9223372036854775807 --- float(1) --- testing: 9.2233720368548E+18 / 0 --- -float(INF) +DivisionByZeroError: Division by zero --- testing: 9.2233720368548E+18 / 1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 / -1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 9.2233720368548E+18 / 7 --- -float(1.3176245766935E+18) +float(1.3176245766935393E+18) --- testing: 9.2233720368548E+18 / 9 --- -float(1.0248191152061E+18) +float(1.0248191152060861E+18) --- testing: 9.2233720368548E+18 / 65 --- -float(1.4189803133623E+17) +float(1.4189803133622733E+17) --- testing: 9.2233720368548E+18 / -44 --- -float(-2.096220917467E+17) +float(-2.0962209174669946E+17) --- testing: 9.2233720368548E+18 / 2147483647 --- float(4294967298) --- testing: 9.2233720368548E+18 / 9223372036854775807 --- float(1) --- testing: -9223372036854775807 / 0 --- -float(-INF) +DivisionByZeroError: Division by zero --- testing: -9223372036854775807 / 1 --- int(-9223372036854775807) --- testing: -9223372036854775807 / -1 --- @@ -282,29 +285,29 @@ int(9223372036854775807) --- testing: -9223372036854775807 / 7 --- int(-1317624576693539401) --- testing: -9223372036854775807 / 9 --- -float(-1.0248191152061E+18) +float(-1.0248191152060861E+18) --- testing: -9223372036854775807 / 65 --- -float(-1.4189803133623E+17) +float(-1.4189803133622733E+17) --- testing: -9223372036854775807 / -44 --- -float(2.096220917467E+17) +float(2.0962209174669946E+17) --- testing: -9223372036854775807 / 2147483647 --- float(-4294967298) --- testing: -9223372036854775807 / 9223372036854775807 --- int(-1) --- testing: -9.2233720368548E+18 / 0 --- -float(-INF) +DivisionByZeroError: Division by zero --- testing: -9.2233720368548E+18 / 1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 / -1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9.2233720368548E+18 / 7 --- -float(-1.3176245766935E+18) +float(-1.3176245766935393E+18) --- testing: -9.2233720368548E+18 / 9 --- -float(-1.0248191152061E+18) +float(-1.0248191152060861E+18) --- testing: -9.2233720368548E+18 / 65 --- -float(-1.4189803133623E+17) +float(-1.4189803133622733E+17) --- testing: -9.2233720368548E+18 / -44 --- -float(2.096220917467E+17) +float(2.0962209174669946E+17) --- testing: -9.2233720368548E+18 / 2147483647 --- float(-4294967298) --- testing: -9.2233720368548E+18 / 9223372036854775807 --- @@ -340,215 +343,215 @@ int(0) --- testing: 0 / -9.2233720368548E+18 --- float(-0) --- testing: 1 / 9223372036854775807 --- -float(1.0842021724855E-19) +float(1.0842021724855044E-19) --- testing: 1 / -9223372036854775808 --- -float(-1.0842021724855E-19) +float(-1.0842021724855044E-19) --- testing: 1 / 2147483647 --- -float(4.6566128752458E-10) +float(4.656612875245797E-10) --- testing: 1 / -2147483648 --- -float(-4.6566128730774E-10) +float(-4.656612873077393E-10) --- testing: 1 / 9223372034707292160 --- -float(1.0842021727379E-19) +float(1.08420217273794E-19) --- testing: 1 / -9223372034707292160 --- -float(-1.0842021727379E-19) +float(-1.08420217273794E-19) --- testing: 1 / 2147483648 --- -float(4.6566128730774E-10) +float(4.656612873077393E-10) --- testing: 1 / -2147483649 --- -float(-4.656612870909E-10) +float(-4.656612870908988E-10) --- testing: 1 / 4294967294 --- -float(2.3283064376229E-10) +float(2.3283064376228985E-10) --- testing: 1 / 4294967295 --- -float(2.3283064370808E-10) +float(2.3283064370807974E-10) --- testing: 1 / 4294967293 --- -float(2.328306438165E-10) +float(2.3283064381649995E-10) --- testing: 1 / 9223372036854775806 --- -float(1.0842021724855E-19) +float(1.0842021724855044E-19) --- testing: 1 / 9.2233720368548E+18 --- -float(1.0842021724855E-19) +float(1.0842021724855044E-19) --- testing: 1 / -9223372036854775807 --- -float(-1.0842021724855E-19) +float(-1.0842021724855044E-19) --- testing: 1 / -9.2233720368548E+18 --- -float(-1.0842021724855E-19) +float(-1.0842021724855044E-19) --- testing: -1 / 9223372036854775807 --- -float(-1.0842021724855E-19) +float(-1.0842021724855044E-19) --- testing: -1 / -9223372036854775808 --- -float(1.0842021724855E-19) +float(1.0842021724855044E-19) --- testing: -1 / 2147483647 --- -float(-4.6566128752458E-10) +float(-4.656612875245797E-10) --- testing: -1 / -2147483648 --- -float(4.6566128730774E-10) +float(4.656612873077393E-10) --- testing: -1 / 9223372034707292160 --- -float(-1.0842021727379E-19) +float(-1.08420217273794E-19) --- testing: -1 / -9223372034707292160 --- -float(1.0842021727379E-19) +float(1.08420217273794E-19) --- testing: -1 / 2147483648 --- -float(-4.6566128730774E-10) +float(-4.656612873077393E-10) --- testing: -1 / -2147483649 --- -float(4.656612870909E-10) +float(4.656612870908988E-10) --- testing: -1 / 4294967294 --- -float(-2.3283064376229E-10) +float(-2.3283064376228985E-10) --- testing: -1 / 4294967295 --- -float(-2.3283064370808E-10) +float(-2.3283064370807974E-10) --- testing: -1 / 4294967293 --- -float(-2.328306438165E-10) +float(-2.3283064381649995E-10) --- testing: -1 / 9223372036854775806 --- -float(-1.0842021724855E-19) +float(-1.0842021724855044E-19) --- testing: -1 / 9.2233720368548E+18 --- -float(-1.0842021724855E-19) +float(-1.0842021724855044E-19) --- testing: -1 / -9223372036854775807 --- -float(1.0842021724855E-19) +float(1.0842021724855044E-19) --- testing: -1 / -9.2233720368548E+18 --- -float(1.0842021724855E-19) +float(1.0842021724855044E-19) --- testing: 7 / 9223372036854775807 --- -float(7.5894152073985E-19) +float(7.589415207398531E-19) --- testing: 7 / -9223372036854775808 --- -float(-7.5894152073985E-19) +float(-7.589415207398531E-19) --- testing: 7 / 2147483647 --- -float(3.2596290126721E-9) +float(3.259629012672058E-9) --- testing: 7 / -2147483648 --- -float(-3.2596290111542E-9) +float(-3.259629011154175E-9) --- testing: 7 / 9223372034707292160 --- -float(7.5894152091656E-19) +float(7.589415209165579E-19) --- testing: 7 / -9223372034707292160 --- -float(-7.5894152091656E-19) +float(-7.589415209165579E-19) --- testing: 7 / 2147483648 --- -float(3.2596290111542E-9) +float(3.259629011154175E-9) --- testing: 7 / -2147483649 --- -float(-3.2596290096363E-9) +float(-3.2596290096362918E-9) --- testing: 7 / 4294967294 --- -float(1.629814506336E-9) +float(1.629814506336029E-9) --- testing: 7 / 4294967295 --- -float(1.6298145059566E-9) +float(1.6298145059565582E-9) --- testing: 7 / 4294967293 --- -float(1.6298145067155E-9) +float(1.6298145067154997E-9) --- testing: 7 / 9223372036854775806 --- -float(7.5894152073985E-19) +float(7.589415207398531E-19) --- testing: 7 / 9.2233720368548E+18 --- -float(7.5894152073985E-19) +float(7.589415207398531E-19) --- testing: 7 / -9223372036854775807 --- -float(-7.5894152073985E-19) +float(-7.589415207398531E-19) --- testing: 7 / -9.2233720368548E+18 --- -float(-7.5894152073985E-19) +float(-7.589415207398531E-19) --- testing: 9 / 9223372036854775807 --- -float(9.7578195523695E-19) +float(9.75781955236954E-19) --- testing: 9 / -9223372036854775808 --- -float(-9.7578195523695E-19) +float(-9.75781955236954E-19) --- testing: 9 / 2147483647 --- -float(4.1909515877212E-9) +float(4.190951587721217E-9) --- testing: 9 / -2147483648 --- -float(-4.1909515857697E-9) +float(-4.190951585769653E-9) --- testing: 9 / 9223372034707292160 --- -float(9.7578195546415E-19) +float(9.75781955464146E-19) --- testing: 9 / -9223372034707292160 --- -float(-9.7578195546415E-19) +float(-9.75781955464146E-19) --- testing: 9 / 2147483648 --- -float(4.1909515857697E-9) +float(4.190951585769653E-9) --- testing: 9 / -2147483649 --- -float(-4.1909515838181E-9) +float(-4.190951583818089E-9) --- testing: 9 / 4294967294 --- -float(2.0954757938606E-9) +float(2.0954757938606086E-9) --- testing: 9 / 4294967295 --- -float(2.0954757933727E-9) +float(2.0954757933727176E-9) --- testing: 9 / 4294967293 --- -float(2.0954757943485E-9) +float(2.0954757943484996E-9) --- testing: 9 / 9223372036854775806 --- -float(9.7578195523695E-19) +float(9.75781955236954E-19) --- testing: 9 / 9.2233720368548E+18 --- -float(9.7578195523695E-19) +float(9.75781955236954E-19) --- testing: 9 / -9223372036854775807 --- -float(-9.7578195523695E-19) +float(-9.75781955236954E-19) --- testing: 9 / -9.2233720368548E+18 --- -float(-9.7578195523695E-19) +float(-9.75781955236954E-19) --- testing: 65 / 9223372036854775807 --- -float(7.0473141211558E-18) +float(7.047314121155779E-18) --- testing: 65 / -9223372036854775808 --- -float(-7.0473141211558E-18) +float(-7.047314121155779E-18) --- testing: 65 / 2147483647 --- -float(3.0267983689098E-8) +float(3.026798368909768E-8) --- testing: 65 / -2147483648 --- -float(-3.0267983675003E-8) +float(-3.026798367500305E-8) --- testing: 65 / 9223372034707292160 --- -float(7.0473141227966E-18) +float(7.04731412279661E-18) --- testing: 65 / -9223372034707292160 --- -float(-7.0473141227966E-18) +float(-7.04731412279661E-18) --- testing: 65 / 2147483648 --- -float(3.0267983675003E-8) +float(3.026798367500305E-8) --- testing: 65 / -2147483649 --- -float(-3.0267983660908E-8) +float(-3.0267983660908424E-8) --- testing: 65 / 4294967294 --- -float(1.5133991844549E-8) +float(1.513399184454884E-8) --- testing: 65 / 4294967295 --- -float(1.5133991841025E-8) +float(1.5133991841025183E-8) --- testing: 65 / 4294967293 --- -float(1.5133991848072E-8) +float(1.5133991848072497E-8) --- testing: 65 / 9223372036854775806 --- -float(7.0473141211558E-18) +float(7.047314121155779E-18) --- testing: 65 / 9.2233720368548E+18 --- -float(7.0473141211558E-18) +float(7.047314121155779E-18) --- testing: 65 / -9223372036854775807 --- -float(-7.0473141211558E-18) +float(-7.047314121155779E-18) --- testing: 65 / -9.2233720368548E+18 --- -float(-7.0473141211558E-18) +float(-7.047314121155779E-18) --- testing: -44 / 9223372036854775807 --- -float(-4.7704895589362E-18) +float(-4.7704895589362195E-18) --- testing: -44 / -9223372036854775808 --- -float(4.7704895589362E-18) +float(4.7704895589362195E-18) --- testing: -44 / 2147483647 --- -float(-2.0489096651082E-8) +float(-2.0489096651081506E-8) --- testing: -44 / -2147483648 --- -float(2.0489096641541E-8) +float(2.0489096641540527E-8) --- testing: -44 / 9223372034707292160 --- -float(-4.7704895600469E-18) +float(-4.770489560046936E-18) --- testing: -44 / -9223372034707292160 --- -float(4.7704895600469E-18) +float(4.770489560046936E-18) --- testing: -44 / 2147483648 --- -float(-2.0489096641541E-8) +float(-2.0489096641540527E-8) --- testing: -44 / -2147483649 --- -float(2.0489096632E-8) +float(2.0489096631999548E-8) --- testing: -44 / 4294967294 --- -float(-1.0244548325541E-8) +float(-1.0244548325540753E-8) --- testing: -44 / 4294967295 --- -float(-1.0244548323156E-8) +float(-1.0244548323155508E-8) --- testing: -44 / 4294967293 --- -float(-1.0244548327926E-8) +float(-1.0244548327925998E-8) --- testing: -44 / 9223372036854775806 --- -float(-4.7704895589362E-18) +float(-4.7704895589362195E-18) --- testing: -44 / 9.2233720368548E+18 --- -float(-4.7704895589362E-18) +float(-4.7704895589362195E-18) --- testing: -44 / -9223372036854775807 --- -float(4.7704895589362E-18) +float(4.7704895589362195E-18) --- testing: -44 / -9.2233720368548E+18 --- -float(4.7704895589362E-18) +float(4.7704895589362195E-18) --- testing: 2147483647 / 9223372036854775807 --- -float(2.3283064354545E-10) +float(2.328306435454494E-10) --- testing: 2147483647 / -9223372036854775808 --- -float(-2.3283064354545E-10) +float(-2.328306435454494E-10) --- testing: 2147483647 / 2147483647 --- int(1) --- testing: 2147483647 / -2147483648 --- -float(-0.99999999953434) +float(-0.9999999995343387) --- testing: 2147483647 / 9223372034707292160 --- -float(2.3283064359966E-10) +float(2.3283064359965952E-10) --- testing: 2147483647 / -9223372034707292160 --- -float(-2.3283064359966E-10) +float(-2.3283064359965952E-10) --- testing: 2147483647 / 2147483648 --- -float(0.99999999953434) +float(0.9999999995343387) --- testing: 2147483647 / -2147483649 --- -float(-0.99999999906868) +float(-0.9999999990686774) --- testing: 2147483647 / 4294967294 --- float(0.5) --- testing: 2147483647 / 4294967295 --- -float(0.49999999988358) +float(0.4999999998835847) --- testing: 2147483647 / 4294967293 --- -float(0.50000000011642) +float(0.5000000001164153) --- testing: 2147483647 / 9223372036854775806 --- -float(2.3283064354545E-10) +float(2.328306435454494E-10) --- testing: 2147483647 / 9.2233720368548E+18 --- -float(2.3283064354545E-10) +float(2.328306435454494E-10) --- testing: 2147483647 / -9223372036854775807 --- -float(-2.3283064354545E-10) +float(-2.328306435454494E-10) --- testing: 2147483647 / -9.2233720368548E+18 --- -float(-2.3283064354545E-10) +float(-2.328306435454494E-10) --- testing: 9223372036854775807 / 9223372036854775807 --- int(1) --- testing: 9223372036854775807 / -9223372036854775808 --- @@ -558,9 +561,9 @@ float(4294967298) --- testing: 9223372036854775807 / -2147483648 --- float(-4294967296) --- testing: 9223372036854775807 / 9223372034707292160 --- -float(1.0000000002328) +float(1.0000000002328306) --- testing: 9223372036854775807 / -9223372034707292160 --- -float(-1.0000000002328) +float(-1.0000000002328306) --- testing: 9223372036854775807 / 2147483648 --- float(4294967296) --- testing: 9223372036854775807 / -2147483649 --- @@ -579,4 +582,3 @@ float(1) int(-1) --- testing: 9223372036854775807 / -9.2233720368548E+18 --- float(-1) -===DONE=== diff --git a/tests/lang/operators/divide_variationStr.phpt b/tests/lang/operators/divide_variationStr.phpt index f908642765..6c62972ffd 100644 --- a/tests/lang/operators/divide_variationStr.phpt +++ b/tests/lang/operators/divide_variationStr.phpt @@ -11,406 +11,410 @@ $strVals = array( error_reporting(E_ERROR); foreach ($strVals as $strVal) { - foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' / '$otherVal' ---\n"; - var_dump($strVal/$otherVal); - } + foreach($strVals as $otherVal) { + echo "--- testing: '$strVal'/'$otherVal' ---\n"; + try { + var_dump($strVal/$otherVal); + } catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; + } catch (\DivisionByZeroError $e) { + echo $e->getMessage() . \PHP_EOL; + } + } } ?> -===DONE=== --EXPECT-- ---- testing: '0' / '0' --- -float(NAN) ---- testing: '0' / '65' --- +--- testing: '0'/'0' --- +Division by zero +--- testing: '0'/'65' --- int(0) ---- testing: '0' / '-44' --- +--- testing: '0'/'-44' --- int(0) ---- testing: '0' / '1.2' --- +--- testing: '0'/'1.2' --- float(0) ---- testing: '0' / '-7.7' --- +--- testing: '0'/'-7.7' --- float(-0) ---- testing: '0' / 'abc' --- -float(NAN) ---- testing: '0' / '123abc' --- +--- testing: '0'/'abc' --- +Unsupported operand types: string / string +--- testing: '0'/'123abc' --- int(0) ---- testing: '0' / '123e5' --- +--- testing: '0'/'123e5' --- float(0) ---- testing: '0' / '123e5xyz' --- +--- testing: '0'/'123e5xyz' --- float(0) ---- testing: '0' / ' 123abc' --- +--- testing: '0'/' 123abc' --- int(0) ---- testing: '0' / '123 abc' --- +--- testing: '0'/'123 abc' --- int(0) ---- testing: '0' / '123abc ' --- +--- testing: '0'/'123abc ' --- int(0) ---- testing: '0' / '3.4a' --- +--- testing: '0'/'3.4a' --- float(0) ---- testing: '0' / 'a5.9' --- -float(NAN) ---- testing: '65' / '0' --- -float(INF) ---- testing: '65' / '65' --- +--- testing: '0'/'a5.9' --- +Unsupported operand types: string / string +--- testing: '65'/'0' --- +Division by zero +--- testing: '65'/'65' --- int(1) ---- testing: '65' / '-44' --- -float(-1.4772727272727) ---- testing: '65' / '1.2' --- -float(54.166666666667) ---- testing: '65' / '-7.7' --- -float(-8.4415584415584) ---- testing: '65' / 'abc' --- -float(INF) ---- testing: '65' / '123abc' --- -float(0.52845528455285) ---- testing: '65' / '123e5' --- -float(5.2845528455285E-6) ---- testing: '65' / '123e5xyz' --- -float(5.2845528455285E-6) ---- testing: '65' / ' 123abc' --- -float(0.52845528455285) ---- testing: '65' / '123 abc' --- -float(0.52845528455285) ---- testing: '65' / '123abc ' --- -float(0.52845528455285) ---- testing: '65' / '3.4a' --- -float(19.117647058824) ---- testing: '65' / 'a5.9' --- -float(INF) ---- testing: '-44' / '0' --- -float(-INF) ---- testing: '-44' / '65' --- -float(-0.67692307692308) ---- testing: '-44' / '-44' --- +--- testing: '65'/'-44' --- +float(-1.4772727272727273) +--- testing: '65'/'1.2' --- +float(54.16666666666667) +--- testing: '65'/'-7.7' --- +float(-8.441558441558442) +--- testing: '65'/'abc' --- +Unsupported operand types: string / string +--- testing: '65'/'123abc' --- +float(0.5284552845528455) +--- testing: '65'/'123e5' --- +float(5.2845528455284555E-6) +--- testing: '65'/'123e5xyz' --- +float(5.2845528455284555E-6) +--- testing: '65'/' 123abc' --- +float(0.5284552845528455) +--- testing: '65'/'123 abc' --- +float(0.5284552845528455) +--- testing: '65'/'123abc ' --- +float(0.5284552845528455) +--- testing: '65'/'3.4a' --- +float(19.11764705882353) +--- testing: '65'/'a5.9' --- +Unsupported operand types: string / string +--- testing: '-44'/'0' --- +Division by zero +--- testing: '-44'/'65' --- +float(-0.676923076923077) +--- testing: '-44'/'-44' --- int(1) ---- testing: '-44' / '1.2' --- -float(-36.666666666667) ---- testing: '-44' / '-7.7' --- -float(5.7142857142857) ---- testing: '-44' / 'abc' --- -float(-INF) ---- testing: '-44' / '123abc' --- -float(-0.35772357723577) ---- testing: '-44' / '123e5' --- -float(-3.5772357723577E-6) ---- testing: '-44' / '123e5xyz' --- -float(-3.5772357723577E-6) ---- testing: '-44' / ' 123abc' --- -float(-0.35772357723577) ---- testing: '-44' / '123 abc' --- -float(-0.35772357723577) ---- testing: '-44' / '123abc ' --- -float(-0.35772357723577) ---- testing: '-44' / '3.4a' --- -float(-12.941176470588) ---- testing: '-44' / 'a5.9' --- -float(-INF) ---- testing: '1.2' / '0' --- -float(INF) ---- testing: '1.2' / '65' --- -float(0.018461538461538) ---- testing: '1.2' / '-44' --- -float(-0.027272727272727) ---- testing: '1.2' / '1.2' --- +--- testing: '-44'/'1.2' --- +float(-36.66666666666667) +--- testing: '-44'/'-7.7' --- +float(5.714285714285714) +--- testing: '-44'/'abc' --- +Unsupported operand types: string / string +--- testing: '-44'/'123abc' --- +float(-0.35772357723577236) +--- testing: '-44'/'123e5' --- +float(-3.5772357723577236E-6) +--- testing: '-44'/'123e5xyz' --- +float(-3.5772357723577236E-6) +--- testing: '-44'/' 123abc' --- +float(-0.35772357723577236) +--- testing: '-44'/'123 abc' --- +float(-0.35772357723577236) +--- testing: '-44'/'123abc ' --- +float(-0.35772357723577236) +--- testing: '-44'/'3.4a' --- +float(-12.941176470588236) +--- testing: '-44'/'a5.9' --- +Unsupported operand types: string / string +--- testing: '1.2'/'0' --- +Division by zero +--- testing: '1.2'/'65' --- +float(0.01846153846153846) +--- testing: '1.2'/'-44' --- +float(-0.02727272727272727) +--- testing: '1.2'/'1.2' --- float(1) ---- testing: '1.2' / '-7.7' --- -float(-0.15584415584416) ---- testing: '1.2' / 'abc' --- -float(INF) ---- testing: '1.2' / '123abc' --- -float(0.0097560975609756) ---- testing: '1.2' / '123e5' --- -float(9.7560975609756E-8) ---- testing: '1.2' / '123e5xyz' --- -float(9.7560975609756E-8) ---- testing: '1.2' / ' 123abc' --- -float(0.0097560975609756) ---- testing: '1.2' / '123 abc' --- -float(0.0097560975609756) ---- testing: '1.2' / '123abc ' --- -float(0.0097560975609756) ---- testing: '1.2' / '3.4a' --- -float(0.35294117647059) ---- testing: '1.2' / 'a5.9' --- -float(INF) ---- testing: '-7.7' / '0' --- -float(-INF) ---- testing: '-7.7' / '65' --- -float(-0.11846153846154) ---- testing: '-7.7' / '-44' --- -float(0.175) ---- testing: '-7.7' / '1.2' --- -float(-6.4166666666667) ---- testing: '-7.7' / '-7.7' --- +--- testing: '1.2'/'-7.7' --- +float(-0.15584415584415584) +--- testing: '1.2'/'abc' --- +Unsupported operand types: string / string +--- testing: '1.2'/'123abc' --- +float(0.00975609756097561) +--- testing: '1.2'/'123e5' --- +float(9.75609756097561E-8) +--- testing: '1.2'/'123e5xyz' --- +float(9.75609756097561E-8) +--- testing: '1.2'/' 123abc' --- +float(0.00975609756097561) +--- testing: '1.2'/'123 abc' --- +float(0.00975609756097561) +--- testing: '1.2'/'123abc ' --- +float(0.00975609756097561) +--- testing: '1.2'/'3.4a' --- +float(0.35294117647058826) +--- testing: '1.2'/'a5.9' --- +Unsupported operand types: string / string +--- testing: '-7.7'/'0' --- +Division by zero +--- testing: '-7.7'/'65' --- +float(-0.11846153846153847) +--- testing: '-7.7'/'-44' --- +float(0.17500000000000002) +--- testing: '-7.7'/'1.2' --- +float(-6.416666666666667) +--- testing: '-7.7'/'-7.7' --- float(1) ---- testing: '-7.7' / 'abc' --- -float(-INF) ---- testing: '-7.7' / '123abc' --- -float(-0.06260162601626) ---- testing: '-7.7' / '123e5' --- -float(-6.260162601626E-7) ---- testing: '-7.7' / '123e5xyz' --- -float(-6.260162601626E-7) ---- testing: '-7.7' / ' 123abc' --- -float(-0.06260162601626) ---- testing: '-7.7' / '123 abc' --- -float(-0.06260162601626) ---- testing: '-7.7' / '123abc ' --- -float(-0.06260162601626) ---- testing: '-7.7' / '3.4a' --- -float(-2.2647058823529) ---- testing: '-7.7' / 'a5.9' --- -float(-INF) ---- testing: 'abc' / '0' --- -float(NAN) ---- testing: 'abc' / '65' --- -int(0) ---- testing: 'abc' / '-44' --- -int(0) ---- testing: 'abc' / '1.2' --- -float(0) ---- testing: 'abc' / '-7.7' --- -float(-0) ---- testing: 'abc' / 'abc' --- -float(NAN) ---- testing: 'abc' / '123abc' --- -int(0) ---- testing: 'abc' / '123e5' --- -float(0) ---- testing: 'abc' / '123e5xyz' --- -float(0) ---- testing: 'abc' / ' 123abc' --- -int(0) ---- testing: 'abc' / '123 abc' --- -int(0) ---- testing: 'abc' / '123abc ' --- -int(0) ---- testing: 'abc' / '3.4a' --- -float(0) ---- testing: 'abc' / 'a5.9' --- -float(NAN) ---- testing: '123abc' / '0' --- -float(INF) ---- testing: '123abc' / '65' --- -float(1.8923076923077) ---- testing: '123abc' / '-44' --- -float(-2.7954545454545) ---- testing: '123abc' / '1.2' --- +--- testing: '-7.7'/'abc' --- +Unsupported operand types: string / string +--- testing: '-7.7'/'123abc' --- +float(-0.06260162601626017) +--- testing: '-7.7'/'123e5' --- +float(-6.260162601626017E-7) +--- testing: '-7.7'/'123e5xyz' --- +float(-6.260162601626017E-7) +--- testing: '-7.7'/' 123abc' --- +float(-0.06260162601626017) +--- testing: '-7.7'/'123 abc' --- +float(-0.06260162601626017) +--- testing: '-7.7'/'123abc ' --- +float(-0.06260162601626017) +--- testing: '-7.7'/'3.4a' --- +float(-2.264705882352941) +--- testing: '-7.7'/'a5.9' --- +Unsupported operand types: string / string +--- testing: 'abc'/'0' --- +Unsupported operand types: string / string +--- testing: 'abc'/'65' --- +Unsupported operand types: string / string +--- testing: 'abc'/'-44' --- +Unsupported operand types: string / string +--- testing: 'abc'/'1.2' --- +Unsupported operand types: string / string +--- testing: 'abc'/'-7.7' --- +Unsupported operand types: string / string +--- testing: 'abc'/'abc' --- +Unsupported operand types: string / string +--- testing: 'abc'/'123abc' --- +Unsupported operand types: string / string +--- testing: 'abc'/'123e5' --- +Unsupported operand types: string / string +--- testing: 'abc'/'123e5xyz' --- +Unsupported operand types: string / string +--- testing: 'abc'/' 123abc' --- +Unsupported operand types: string / string +--- testing: 'abc'/'123 abc' --- +Unsupported operand types: string / string +--- testing: 'abc'/'123abc ' --- +Unsupported operand types: string / string +--- testing: 'abc'/'3.4a' --- +Unsupported operand types: string / string +--- testing: 'abc'/'a5.9' --- +Unsupported operand types: string / string +--- testing: '123abc'/'0' --- +Division by zero +--- testing: '123abc'/'65' --- +float(1.8923076923076922) +--- testing: '123abc'/'-44' --- +float(-2.7954545454545454) +--- testing: '123abc'/'1.2' --- float(102.5) ---- testing: '123abc' / '-7.7' --- -float(-15.974025974026) ---- testing: '123abc' / 'abc' --- -float(INF) ---- testing: '123abc' / '123abc' --- +--- testing: '123abc'/'-7.7' --- +float(-15.974025974025974) +--- testing: '123abc'/'abc' --- +Unsupported operand types: string / string +--- testing: '123abc'/'123abc' --- int(1) ---- testing: '123abc' / '123e5' --- +--- testing: '123abc'/'123e5' --- float(1.0E-5) ---- testing: '123abc' / '123e5xyz' --- +--- testing: '123abc'/'123e5xyz' --- float(1.0E-5) ---- testing: '123abc' / ' 123abc' --- +--- testing: '123abc'/' 123abc' --- int(1) ---- testing: '123abc' / '123 abc' --- +--- testing: '123abc'/'123 abc' --- int(1) ---- testing: '123abc' / '123abc ' --- +--- testing: '123abc'/'123abc ' --- int(1) ---- testing: '123abc' / '3.4a' --- -float(36.176470588235) ---- testing: '123abc' / 'a5.9' --- -float(INF) ---- testing: '123e5' / '0' --- -float(INF) ---- testing: '123e5' / '65' --- -float(189230.76923077) ---- testing: '123e5' / '-44' --- -float(-279545.45454545) ---- testing: '123e5' / '1.2' --- +--- testing: '123abc'/'3.4a' --- +float(36.1764705882353) +--- testing: '123abc'/'a5.9' --- +Unsupported operand types: string / string +--- testing: '123e5'/'0' --- +Division by zero +--- testing: '123e5'/'65' --- +float(189230.76923076922) +--- testing: '123e5'/'-44' --- +float(-279545.45454545453) +--- testing: '123e5'/'1.2' --- float(10250000) ---- testing: '123e5' / '-7.7' --- -float(-1597402.5974026) ---- testing: '123e5' / 'abc' --- -float(INF) ---- testing: '123e5' / '123abc' --- +--- testing: '123e5'/'-7.7' --- +float(-1597402.5974025973) +--- testing: '123e5'/'abc' --- +Unsupported operand types: string / string +--- testing: '123e5'/'123abc' --- float(100000) ---- testing: '123e5' / '123e5' --- +--- testing: '123e5'/'123e5' --- float(1) ---- testing: '123e5' / '123e5xyz' --- +--- testing: '123e5'/'123e5xyz' --- float(1) ---- testing: '123e5' / ' 123abc' --- +--- testing: '123e5'/' 123abc' --- float(100000) ---- testing: '123e5' / '123 abc' --- +--- testing: '123e5'/'123 abc' --- float(100000) ---- testing: '123e5' / '123abc ' --- +--- testing: '123e5'/'123abc ' --- float(100000) ---- testing: '123e5' / '3.4a' --- -float(3617647.0588235) ---- testing: '123e5' / 'a5.9' --- -float(INF) ---- testing: '123e5xyz' / '0' --- -float(INF) ---- testing: '123e5xyz' / '65' --- -float(189230.76923077) ---- testing: '123e5xyz' / '-44' --- -float(-279545.45454545) ---- testing: '123e5xyz' / '1.2' --- +--- testing: '123e5'/'3.4a' --- +float(3617647.0588235296) +--- testing: '123e5'/'a5.9' --- +Unsupported operand types: string / string +--- testing: '123e5xyz'/'0' --- +Division by zero +--- testing: '123e5xyz'/'65' --- +float(189230.76923076922) +--- testing: '123e5xyz'/'-44' --- +float(-279545.45454545453) +--- testing: '123e5xyz'/'1.2' --- float(10250000) ---- testing: '123e5xyz' / '-7.7' --- -float(-1597402.5974026) ---- testing: '123e5xyz' / 'abc' --- -float(INF) ---- testing: '123e5xyz' / '123abc' --- +--- testing: '123e5xyz'/'-7.7' --- +float(-1597402.5974025973) +--- testing: '123e5xyz'/'abc' --- +Unsupported operand types: string / string +--- testing: '123e5xyz'/'123abc' --- float(100000) ---- testing: '123e5xyz' / '123e5' --- +--- testing: '123e5xyz'/'123e5' --- float(1) ---- testing: '123e5xyz' / '123e5xyz' --- +--- testing: '123e5xyz'/'123e5xyz' --- float(1) ---- testing: '123e5xyz' / ' 123abc' --- +--- testing: '123e5xyz'/' 123abc' --- float(100000) ---- testing: '123e5xyz' / '123 abc' --- +--- testing: '123e5xyz'/'123 abc' --- float(100000) ---- testing: '123e5xyz' / '123abc ' --- +--- testing: '123e5xyz'/'123abc ' --- float(100000) ---- testing: '123e5xyz' / '3.4a' --- -float(3617647.0588235) ---- testing: '123e5xyz' / 'a5.9' --- -float(INF) ---- testing: ' 123abc' / '0' --- -float(INF) ---- testing: ' 123abc' / '65' --- -float(1.8923076923077) ---- testing: ' 123abc' / '-44' --- -float(-2.7954545454545) ---- testing: ' 123abc' / '1.2' --- +--- testing: '123e5xyz'/'3.4a' --- +float(3617647.0588235296) +--- testing: '123e5xyz'/'a5.9' --- +Unsupported operand types: string / string +--- testing: ' 123abc'/'0' --- +Division by zero +--- testing: ' 123abc'/'65' --- +float(1.8923076923076922) +--- testing: ' 123abc'/'-44' --- +float(-2.7954545454545454) +--- testing: ' 123abc'/'1.2' --- float(102.5) ---- testing: ' 123abc' / '-7.7' --- -float(-15.974025974026) ---- testing: ' 123abc' / 'abc' --- -float(INF) ---- testing: ' 123abc' / '123abc' --- +--- testing: ' 123abc'/'-7.7' --- +float(-15.974025974025974) +--- testing: ' 123abc'/'abc' --- +Unsupported operand types: string / string +--- testing: ' 123abc'/'123abc' --- int(1) ---- testing: ' 123abc' / '123e5' --- +--- testing: ' 123abc'/'123e5' --- float(1.0E-5) ---- testing: ' 123abc' / '123e5xyz' --- +--- testing: ' 123abc'/'123e5xyz' --- float(1.0E-5) ---- testing: ' 123abc' / ' 123abc' --- +--- testing: ' 123abc'/' 123abc' --- int(1) ---- testing: ' 123abc' / '123 abc' --- +--- testing: ' 123abc'/'123 abc' --- int(1) ---- testing: ' 123abc' / '123abc ' --- +--- testing: ' 123abc'/'123abc ' --- int(1) ---- testing: ' 123abc' / '3.4a' --- -float(36.176470588235) ---- testing: ' 123abc' / 'a5.9' --- -float(INF) ---- testing: '123 abc' / '0' --- -float(INF) ---- testing: '123 abc' / '65' --- -float(1.8923076923077) ---- testing: '123 abc' / '-44' --- -float(-2.7954545454545) ---- testing: '123 abc' / '1.2' --- +--- testing: ' 123abc'/'3.4a' --- +float(36.1764705882353) +--- testing: ' 123abc'/'a5.9' --- +Unsupported operand types: string / string +--- testing: '123 abc'/'0' --- +Division by zero +--- testing: '123 abc'/'65' --- +float(1.8923076923076922) +--- testing: '123 abc'/'-44' --- +float(-2.7954545454545454) +--- testing: '123 abc'/'1.2' --- float(102.5) ---- testing: '123 abc' / '-7.7' --- -float(-15.974025974026) ---- testing: '123 abc' / 'abc' --- -float(INF) ---- testing: '123 abc' / '123abc' --- +--- testing: '123 abc'/'-7.7' --- +float(-15.974025974025974) +--- testing: '123 abc'/'abc' --- +Unsupported operand types: string / string +--- testing: '123 abc'/'123abc' --- int(1) ---- testing: '123 abc' / '123e5' --- +--- testing: '123 abc'/'123e5' --- float(1.0E-5) ---- testing: '123 abc' / '123e5xyz' --- +--- testing: '123 abc'/'123e5xyz' --- float(1.0E-5) ---- testing: '123 abc' / ' 123abc' --- +--- testing: '123 abc'/' 123abc' --- int(1) ---- testing: '123 abc' / '123 abc' --- +--- testing: '123 abc'/'123 abc' --- int(1) ---- testing: '123 abc' / '123abc ' --- +--- testing: '123 abc'/'123abc ' --- int(1) ---- testing: '123 abc' / '3.4a' --- -float(36.176470588235) ---- testing: '123 abc' / 'a5.9' --- -float(INF) ---- testing: '123abc ' / '0' --- -float(INF) ---- testing: '123abc ' / '65' --- -float(1.8923076923077) ---- testing: '123abc ' / '-44' --- -float(-2.7954545454545) ---- testing: '123abc ' / '1.2' --- +--- testing: '123 abc'/'3.4a' --- +float(36.1764705882353) +--- testing: '123 abc'/'a5.9' --- +Unsupported operand types: string / string +--- testing: '123abc '/'0' --- +Division by zero +--- testing: '123abc '/'65' --- +float(1.8923076923076922) +--- testing: '123abc '/'-44' --- +float(-2.7954545454545454) +--- testing: '123abc '/'1.2' --- float(102.5) ---- testing: '123abc ' / '-7.7' --- -float(-15.974025974026) ---- testing: '123abc ' / 'abc' --- -float(INF) ---- testing: '123abc ' / '123abc' --- +--- testing: '123abc '/'-7.7' --- +float(-15.974025974025974) +--- testing: '123abc '/'abc' --- +Unsupported operand types: string / string +--- testing: '123abc '/'123abc' --- int(1) ---- testing: '123abc ' / '123e5' --- +--- testing: '123abc '/'123e5' --- float(1.0E-5) ---- testing: '123abc ' / '123e5xyz' --- +--- testing: '123abc '/'123e5xyz' --- float(1.0E-5) ---- testing: '123abc ' / ' 123abc' --- +--- testing: '123abc '/' 123abc' --- int(1) ---- testing: '123abc ' / '123 abc' --- +--- testing: '123abc '/'123 abc' --- int(1) ---- testing: '123abc ' / '123abc ' --- +--- testing: '123abc '/'123abc ' --- int(1) ---- testing: '123abc ' / '3.4a' --- -float(36.176470588235) ---- testing: '123abc ' / 'a5.9' --- -float(INF) ---- testing: '3.4a' / '0' --- -float(INF) ---- testing: '3.4a' / '65' --- -float(0.052307692307692) ---- testing: '3.4a' / '-44' --- -float(-0.077272727272727) ---- testing: '3.4a' / '1.2' --- -float(2.8333333333333) ---- testing: '3.4a' / '-7.7' --- -float(-0.44155844155844) ---- testing: '3.4a' / 'abc' --- -float(INF) ---- testing: '3.4a' / '123abc' --- -float(0.027642276422764) ---- testing: '3.4a' / '123e5' --- -float(2.7642276422764E-7) ---- testing: '3.4a' / '123e5xyz' --- -float(2.7642276422764E-7) ---- testing: '3.4a' / ' 123abc' --- -float(0.027642276422764) ---- testing: '3.4a' / '123 abc' --- -float(0.027642276422764) ---- testing: '3.4a' / '123abc ' --- -float(0.027642276422764) ---- testing: '3.4a' / '3.4a' --- +--- testing: '123abc '/'3.4a' --- +float(36.1764705882353) +--- testing: '123abc '/'a5.9' --- +Unsupported operand types: string / string +--- testing: '3.4a'/'0' --- +Division by zero +--- testing: '3.4a'/'65' --- +float(0.052307692307692305) +--- testing: '3.4a'/'-44' --- +float(-0.07727272727272727) +--- testing: '3.4a'/'1.2' --- +float(2.8333333333333335) +--- testing: '3.4a'/'-7.7' --- +float(-0.44155844155844154) +--- testing: '3.4a'/'abc' --- +Unsupported operand types: string / string +--- testing: '3.4a'/'123abc' --- +float(0.027642276422764227) +--- testing: '3.4a'/'123e5' --- +float(2.764227642276423E-7) +--- testing: '3.4a'/'123e5xyz' --- +float(2.764227642276423E-7) +--- testing: '3.4a'/' 123abc' --- +float(0.027642276422764227) +--- testing: '3.4a'/'123 abc' --- +float(0.027642276422764227) +--- testing: '3.4a'/'123abc ' --- +float(0.027642276422764227) +--- testing: '3.4a'/'3.4a' --- float(1) ---- testing: '3.4a' / 'a5.9' --- -float(INF) ---- testing: 'a5.9' / '0' --- -float(NAN) ---- testing: 'a5.9' / '65' --- -int(0) ---- testing: 'a5.9' / '-44' --- -int(0) ---- testing: 'a5.9' / '1.2' --- -float(0) ---- testing: 'a5.9' / '-7.7' --- -float(-0) ---- testing: 'a5.9' / 'abc' --- -float(NAN) ---- testing: 'a5.9' / '123abc' --- -int(0) ---- testing: 'a5.9' / '123e5' --- -float(0) ---- testing: 'a5.9' / '123e5xyz' --- -float(0) ---- testing: 'a5.9' / ' 123abc' --- -int(0) ---- testing: 'a5.9' / '123 abc' --- -int(0) ---- testing: 'a5.9' / '123abc ' --- -int(0) ---- testing: 'a5.9' / '3.4a' --- -float(0) ---- testing: 'a5.9' / 'a5.9' --- -float(NAN) -===DONE=== +--- testing: '3.4a'/'a5.9' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'0' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'65' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'-44' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'1.2' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'-7.7' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'abc' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'123abc' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'123e5' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'123e5xyz' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/' 123abc' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'123 abc' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'123abc ' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'3.4a' --- +Unsupported operand types: string / string +--- testing: 'a5.9'/'a5.9' --- +Unsupported operand types: string / string diff --git a/tests/lang/operators/modulus_basiclong_64bit.phpt b/tests/lang/operators/modulus_basiclong_64bit.phpt index 155649d203..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"; @@ -45,7 +45,6 @@ foreach ($otherVals as $otherVal) { } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 % 0 --- Exception: Modulo by zero @@ -587,4 +586,3 @@ int(9223372036854775807) int(0) --- testing: 9223372036854775807 % -9.2233720368548E+18 --- int(9223372036854775807) -===DONE=== diff --git a/tests/lang/operators/modulus_variationStr.phpt b/tests/lang/operators/modulus_variationStr.phpt index 21765ecb7c..1f9aae88a4 100644 --- a/tests/lang/operators/modulus_variationStr.phpt +++ b/tests/lang/operators/modulus_variationStr.phpt @@ -12,21 +12,20 @@ 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) { - echo "Exception: " . $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo get_class($e) . ': ' . $e->getMessage() . "\n"; } } } ?> -===DONE=== --EXPECT-- --- testing: '0' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '0' % '65' --- int(0) --- testing: '0' % '-44' --- @@ -36,7 +35,7 @@ int(0) --- testing: '0' % '-7.7' --- int(0) --- testing: '0' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '0' % '123abc' --- int(0) --- testing: '0' % '123e5' --- @@ -52,9 +51,9 @@ int(0) --- testing: '0' % '3.4a' --- int(0) --- testing: '0' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '65' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '65' % '65' --- int(0) --- testing: '65' % '-44' --- @@ -64,7 +63,7 @@ int(0) --- testing: '65' % '-7.7' --- int(2) --- testing: '65' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '65' % '123abc' --- int(65) --- testing: '65' % '123e5' --- @@ -80,9 +79,9 @@ int(65) --- testing: '65' % '3.4a' --- int(2) --- testing: '65' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '-44' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '-44' % '65' --- int(-44) --- testing: '-44' % '-44' --- @@ -92,7 +91,7 @@ int(0) --- testing: '-44' % '-7.7' --- int(-2) --- testing: '-44' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '-44' % '123abc' --- int(-44) --- testing: '-44' % '123e5' --- @@ -108,9 +107,9 @@ int(-44) --- testing: '-44' % '3.4a' --- int(-2) --- testing: '-44' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '1.2' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '1.2' % '65' --- int(1) --- testing: '1.2' % '-44' --- @@ -120,7 +119,7 @@ int(0) --- testing: '1.2' % '-7.7' --- int(1) --- testing: '1.2' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '1.2' % '123abc' --- int(1) --- testing: '1.2' % '123e5' --- @@ -136,9 +135,9 @@ int(1) --- testing: '1.2' % '3.4a' --- int(1) --- testing: '1.2' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '-7.7' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '-7.7' % '65' --- int(-7) --- testing: '-7.7' % '-44' --- @@ -148,7 +147,7 @@ int(0) --- testing: '-7.7' % '-7.7' --- int(0) --- testing: '-7.7' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '-7.7' % '123abc' --- int(-7) --- testing: '-7.7' % '123e5' --- @@ -164,37 +163,37 @@ int(-7) --- testing: '-7.7' % '3.4a' --- int(-1) --- testing: '-7.7' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '0' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '65' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '-44' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '1.2' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '-7.7' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '123abc' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '123e5' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '123e5xyz' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % ' 123abc' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '123 abc' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '123abc ' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % '3.4a' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'abc' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123abc' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '123abc' % '65' --- int(58) --- testing: '123abc' % '-44' --- @@ -204,7 +203,7 @@ int(0) --- testing: '123abc' % '-7.7' --- int(4) --- testing: '123abc' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123abc' % '123abc' --- int(0) --- testing: '123abc' % '123e5' --- @@ -220,9 +219,9 @@ int(0) --- testing: '123abc' % '3.4a' --- int(0) --- testing: '123abc' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123e5' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '123e5' % '65' --- int(50) --- testing: '123e5' % '-44' --- @@ -232,7 +231,7 @@ int(0) --- testing: '123e5' % '-7.7' --- int(6) --- testing: '123e5' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123e5' % '123abc' --- int(0) --- testing: '123e5' % '123e5' --- @@ -248,9 +247,9 @@ int(0) --- testing: '123e5' % '3.4a' --- int(0) --- testing: '123e5' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123e5xyz' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '123e5xyz' % '65' --- int(50) --- testing: '123e5xyz' % '-44' --- @@ -260,7 +259,7 @@ int(0) --- testing: '123e5xyz' % '-7.7' --- int(6) --- testing: '123e5xyz' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123e5xyz' % '123abc' --- int(0) --- testing: '123e5xyz' % '123e5' --- @@ -276,9 +275,9 @@ int(0) --- testing: '123e5xyz' % '3.4a' --- int(0) --- testing: '123e5xyz' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: ' 123abc' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: ' 123abc' % '65' --- int(58) --- testing: ' 123abc' % '-44' --- @@ -288,7 +287,7 @@ int(0) --- testing: ' 123abc' % '-7.7' --- int(4) --- testing: ' 123abc' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: ' 123abc' % '123abc' --- int(0) --- testing: ' 123abc' % '123e5' --- @@ -304,9 +303,9 @@ int(0) --- testing: ' 123abc' % '3.4a' --- int(0) --- testing: ' 123abc' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123 abc' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '123 abc' % '65' --- int(58) --- testing: '123 abc' % '-44' --- @@ -316,7 +315,7 @@ int(0) --- testing: '123 abc' % '-7.7' --- int(4) --- testing: '123 abc' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123 abc' % '123abc' --- int(0) --- testing: '123 abc' % '123e5' --- @@ -332,9 +331,9 @@ int(0) --- testing: '123 abc' % '3.4a' --- int(0) --- testing: '123 abc' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123abc ' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '123abc ' % '65' --- int(58) --- testing: '123abc ' % '-44' --- @@ -344,7 +343,7 @@ int(0) --- testing: '123abc ' % '-7.7' --- int(4) --- testing: '123abc ' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '123abc ' % '123abc' --- int(0) --- testing: '123abc ' % '123e5' --- @@ -360,9 +359,9 @@ int(0) --- testing: '123abc ' % '3.4a' --- int(0) --- testing: '123abc ' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '3.4a' % '0' --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: '3.4a' % '65' --- int(3) --- testing: '3.4a' % '-44' --- @@ -372,7 +371,7 @@ int(0) --- testing: '3.4a' % '-7.7' --- int(3) --- testing: '3.4a' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: '3.4a' % '123abc' --- int(3) --- testing: '3.4a' % '123e5' --- @@ -388,33 +387,32 @@ int(3) --- testing: '3.4a' % '3.4a' --- int(0) --- testing: '3.4a' % 'a5.9' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '0' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '65' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '-44' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '1.2' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '-7.7' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % 'abc' --- -Exception: Modulo by zero +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '123abc' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '123e5' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '123e5xyz' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % ' 123abc' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '123 abc' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '123abc ' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % '3.4a' --- -int(0) +TypeError: Unsupported operand types: string % string --- testing: 'a5.9' % 'a5.9' --- -Exception: Modulo by zero -===DONE=== +TypeError: Unsupported operand types: string % string diff --git a/tests/lang/operators/multiply_basiclong_64bit.phpt b/tests/lang/operators/multiply_basiclong_64bit.phpt index 512c3fbc18..d57ec28ef1 100644 --- a/tests/lang/operators/multiply_basiclong_64bit.phpt +++ b/tests/lang/operators/multiply_basiclong_64bit.phpt @@ -24,20 +24,19 @@ 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); } } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 * 0 --- int(0) @@ -46,35 +45,35 @@ int(9223372036854775807) --- testing: 9223372036854775807 * -1 --- int(-9223372036854775807) --- testing: 9223372036854775807 * 7 --- -float(6.4563604257983E+19) +float(6.456360425798343E+19) --- testing: 9223372036854775807 * 9 --- -float(8.3010348331693E+19) +float(8.301034833169298E+19) --- testing: 9223372036854775807 * 65 --- -float(5.9951918239556E+20) +float(5.995191823955604E+20) --- testing: 9223372036854775807 * -44 --- -float(-4.0582836962161E+20) +float(-4.0582836962161014E+20) --- testing: 9223372036854775807 * 2147483647 --- -float(1.9807040619343E+28) +float(1.9807040619342712E+28) --- testing: 9223372036854775807 * 9223372036854775807 --- -float(8.5070591730235E+37) +float(8.507059173023462E+37) --- testing: -9223372036854775808 * 0 --- int(0) --- testing: -9223372036854775808 * 1 --- int(-9223372036854775808) --- testing: -9223372036854775808 * -1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9223372036854775808 * 7 --- -float(-6.4563604257983E+19) +float(-6.456360425798343E+19) --- testing: -9223372036854775808 * 9 --- -float(-8.3010348331693E+19) +float(-8.301034833169298E+19) --- testing: -9223372036854775808 * 65 --- -float(-5.9951918239556E+20) +float(-5.995191823955604E+20) --- testing: -9223372036854775808 * -44 --- -float(4.0582836962161E+20) +float(4.0582836962161014E+20) --- testing: -9223372036854775808 * 2147483647 --- -float(-1.9807040619343E+28) +float(-1.9807040619342712E+28) --- testing: -9223372036854775808 * 9223372036854775807 --- -float(-8.5070591730235E+37) +float(-8.507059173023462E+37) --- testing: 2147483647 * 0 --- int(0) --- testing: 2147483647 * 1 --- @@ -92,7 +91,7 @@ int(-94489280468) --- testing: 2147483647 * 2147483647 --- int(4611686014132420609) --- testing: 2147483647 * 9223372036854775807 --- -float(1.9807040619343E+28) +float(1.9807040619342712E+28) --- testing: -2147483648 * 0 --- int(0) --- testing: -2147483648 * 1 --- @@ -110,7 +109,7 @@ int(94489280512) --- testing: -2147483648 * 2147483647 --- int(-4611686016279904256) --- testing: -2147483648 * 9223372036854775807 --- -float(-1.9807040628566E+28) +float(-1.9807040628566084E+28) --- testing: 9223372034707292160 * 0 --- int(0) --- testing: 9223372034707292160 * 1 --- @@ -118,17 +117,17 @@ int(9223372034707292160) --- testing: 9223372034707292160 * -1 --- int(-9223372034707292160) --- testing: 9223372034707292160 * 7 --- -float(6.4563604242951E+19) +float(6.4563604242951045E+19) --- testing: 9223372034707292160 * 9 --- -float(8.3010348312366E+19) +float(8.301034831236563E+19) --- testing: 9223372034707292160 * 65 --- -float(5.9951918225597E+20) +float(5.99519182255974E+20) --- testing: 9223372034707292160 * -44 --- -float(-4.0582836952712E+20) +float(-4.0582836952712086E+20) --- testing: 9223372034707292160 * 2147483647 --- -float(1.9807040614731E+28) +float(1.9807040614731026E+28) --- testing: 9223372034707292160 * 9223372036854775807 --- -float(8.5070591710428E+37) +float(8.5070591710427575E+37) --- testing: -9223372034707292160 * 0 --- int(0) --- testing: -9223372034707292160 * 1 --- @@ -136,17 +135,17 @@ int(-9223372034707292160) --- testing: -9223372034707292160 * -1 --- int(9223372034707292160) --- testing: -9223372034707292160 * 7 --- -float(-6.4563604242951E+19) +float(-6.4563604242951045E+19) --- testing: -9223372034707292160 * 9 --- -float(-8.3010348312366E+19) +float(-8.301034831236563E+19) --- testing: -9223372034707292160 * 65 --- -float(-5.9951918225597E+20) +float(-5.99519182255974E+20) --- testing: -9223372034707292160 * -44 --- -float(4.0582836952712E+20) +float(4.0582836952712086E+20) --- testing: -9223372034707292160 * 2147483647 --- -float(-1.9807040614731E+28) +float(-1.9807040614731026E+28) --- testing: -9223372034707292160 * 9223372036854775807 --- -float(-8.5070591710428E+37) +float(-8.5070591710427575E+37) --- testing: 2147483648 * 0 --- int(0) --- testing: 2147483648 * 1 --- @@ -164,7 +163,7 @@ int(-94489280512) --- testing: 2147483648 * 2147483647 --- int(4611686016279904256) --- testing: 2147483648 * 9223372036854775807 --- -float(1.9807040628566E+28) +float(1.9807040628566084E+28) --- testing: -2147483649 * 0 --- int(0) --- testing: -2147483649 * 1 --- @@ -182,7 +181,7 @@ int(94489280556) --- testing: -2147483649 * 2147483647 --- int(-4611686018427387903) --- testing: -2147483649 * 9223372036854775807 --- -float(-1.9807040637789E+28) +float(-1.9807040637789456E+28) --- testing: 4294967294 * 0 --- int(0) --- testing: 4294967294 * 1 --- @@ -200,7 +199,7 @@ int(-188978560936) --- testing: 4294967294 * 2147483647 --- int(9223372028264841218) --- testing: 4294967294 * 9223372036854775807 --- -float(3.9614081238685E+28) +float(3.9614081238685425E+28) --- testing: 4294967295 * 0 --- int(0) --- testing: 4294967295 * 1 --- @@ -218,7 +217,7 @@ int(-188978560980) --- testing: 4294967295 * 2147483647 --- int(9223372030412324865) --- testing: 4294967295 * 9223372036854775807 --- -float(3.9614081247909E+28) +float(3.9614081247908797E+28) --- testing: 4294967293 * 0 --- int(0) --- testing: 4294967293 * 1 --- @@ -236,7 +235,7 @@ int(-188978560892) --- testing: 4294967293 * 2147483647 --- int(9223372026117357571) --- testing: 4294967293 * 9223372036854775807 --- -float(3.9614081229462E+28) +float(3.9614081229462053E+28) --- testing: 9223372036854775806 * 0 --- int(0) --- testing: 9223372036854775806 * 1 --- @@ -244,35 +243,35 @@ int(9223372036854775806) --- testing: 9223372036854775806 * -1 --- int(-9223372036854775806) --- testing: 9223372036854775806 * 7 --- -float(6.4563604257983E+19) +float(6.456360425798343E+19) --- testing: 9223372036854775806 * 9 --- -float(8.3010348331693E+19) +float(8.301034833169298E+19) --- testing: 9223372036854775806 * 65 --- -float(5.9951918239556E+20) +float(5.995191823955604E+20) --- testing: 9223372036854775806 * -44 --- -float(-4.0582836962161E+20) +float(-4.0582836962161014E+20) --- testing: 9223372036854775806 * 2147483647 --- -float(1.9807040619343E+28) +float(1.9807040619342712E+28) --- testing: 9223372036854775806 * 9223372036854775807 --- -float(8.5070591730235E+37) +float(8.507059173023462E+37) --- testing: 9.2233720368548E+18 * 0 --- float(0) --- testing: 9.2233720368548E+18 * 1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 * -1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 9.2233720368548E+18 * 7 --- -float(6.4563604257983E+19) +float(6.456360425798343E+19) --- testing: 9.2233720368548E+18 * 9 --- -float(8.3010348331693E+19) +float(8.301034833169298E+19) --- testing: 9.2233720368548E+18 * 65 --- -float(5.9951918239556E+20) +float(5.995191823955604E+20) --- testing: 9.2233720368548E+18 * -44 --- -float(-4.0582836962161E+20) +float(-4.0582836962161014E+20) --- testing: 9.2233720368548E+18 * 2147483647 --- -float(1.9807040619343E+28) +float(1.9807040619342712E+28) --- testing: 9.2233720368548E+18 * 9223372036854775807 --- -float(8.5070591730235E+37) +float(8.507059173023462E+37) --- testing: -9223372036854775807 * 0 --- int(0) --- testing: -9223372036854775807 * 1 --- @@ -280,35 +279,35 @@ int(-9223372036854775807) --- testing: -9223372036854775807 * -1 --- int(9223372036854775807) --- testing: -9223372036854775807 * 7 --- -float(-6.4563604257983E+19) +float(-6.456360425798343E+19) --- testing: -9223372036854775807 * 9 --- -float(-8.3010348331693E+19) +float(-8.301034833169298E+19) --- testing: -9223372036854775807 * 65 --- -float(-5.9951918239556E+20) +float(-5.995191823955604E+20) --- testing: -9223372036854775807 * -44 --- -float(4.0582836962161E+20) +float(4.0582836962161014E+20) --- testing: -9223372036854775807 * 2147483647 --- -float(-1.9807040619343E+28) +float(-1.9807040619342712E+28) --- testing: -9223372036854775807 * 9223372036854775807 --- -float(-8.5070591730235E+37) +float(-8.507059173023462E+37) --- testing: -9.2233720368548E+18 * 0 --- float(-0) --- testing: -9.2233720368548E+18 * 1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 * -1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9.2233720368548E+18 * 7 --- -float(-6.4563604257983E+19) +float(-6.456360425798343E+19) --- testing: -9.2233720368548E+18 * 9 --- -float(-8.3010348331693E+19) +float(-8.301034833169298E+19) --- testing: -9.2233720368548E+18 * 65 --- -float(-5.9951918239556E+20) +float(-5.995191823955604E+20) --- testing: -9.2233720368548E+18 * -44 --- -float(4.0582836962161E+20) +float(4.0582836962161014E+20) --- testing: -9.2233720368548E+18 * 2147483647 --- -float(-1.9807040619343E+28) +float(-1.9807040619342712E+28) --- testing: -9.2233720368548E+18 * 9223372036854775807 --- -float(-8.5070591730235E+37) +float(-8.507059173023462E+37) --- testing: 0 * 9223372036854775807 --- int(0) --- testing: 0 * -9223372036854775808 --- @@ -364,15 +363,15 @@ int(4294967293) --- testing: 1 * 9223372036854775806 --- int(9223372036854775806) --- testing: 1 * 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 1 * -9223372036854775807 --- int(-9223372036854775807) --- testing: 1 * -9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -1 * 9223372036854775807 --- int(-9223372036854775807) --- testing: -1 * -9223372036854775808 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -1 * 2147483647 --- int(-2147483647) --- testing: -1 * -2147483648 --- @@ -394,23 +393,23 @@ int(-4294967293) --- testing: -1 * 9223372036854775806 --- int(-9223372036854775806) --- testing: -1 * 9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -1 * -9223372036854775807 --- int(9223372036854775807) --- testing: -1 * -9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 7 * 9223372036854775807 --- -float(6.4563604257983E+19) +float(6.456360425798343E+19) --- testing: 7 * -9223372036854775808 --- -float(-6.4563604257983E+19) +float(-6.456360425798343E+19) --- testing: 7 * 2147483647 --- int(15032385529) --- testing: 7 * -2147483648 --- int(-15032385536) --- testing: 7 * 9223372034707292160 --- -float(6.4563604242951E+19) +float(6.4563604242951045E+19) --- testing: 7 * -9223372034707292160 --- -float(-6.4563604242951E+19) +float(-6.4563604242951045E+19) --- testing: 7 * 2147483648 --- int(15032385536) --- testing: 7 * -2147483649 --- @@ -422,25 +421,25 @@ int(30064771065) --- testing: 7 * 4294967293 --- int(30064771051) --- testing: 7 * 9223372036854775806 --- -float(6.4563604257983E+19) +float(6.456360425798343E+19) --- testing: 7 * 9.2233720368548E+18 --- -float(6.4563604257983E+19) +float(6.456360425798343E+19) --- testing: 7 * -9223372036854775807 --- -float(-6.4563604257983E+19) +float(-6.456360425798343E+19) --- testing: 7 * -9.2233720368548E+18 --- -float(-6.4563604257983E+19) +float(-6.456360425798343E+19) --- testing: 9 * 9223372036854775807 --- -float(8.3010348331693E+19) +float(8.301034833169298E+19) --- testing: 9 * -9223372036854775808 --- -float(-8.3010348331693E+19) +float(-8.301034833169298E+19) --- testing: 9 * 2147483647 --- int(19327352823) --- testing: 9 * -2147483648 --- int(-19327352832) --- testing: 9 * 9223372034707292160 --- -float(8.3010348312366E+19) +float(8.301034831236563E+19) --- testing: 9 * -9223372034707292160 --- -float(-8.3010348312366E+19) +float(-8.301034831236563E+19) --- testing: 9 * 2147483648 --- int(19327352832) --- testing: 9 * -2147483649 --- @@ -452,25 +451,25 @@ int(38654705655) --- testing: 9 * 4294967293 --- int(38654705637) --- testing: 9 * 9223372036854775806 --- -float(8.3010348331693E+19) +float(8.301034833169298E+19) --- testing: 9 * 9.2233720368548E+18 --- -float(8.3010348331693E+19) +float(8.301034833169298E+19) --- testing: 9 * -9223372036854775807 --- -float(-8.3010348331693E+19) +float(-8.301034833169298E+19) --- testing: 9 * -9.2233720368548E+18 --- -float(-8.3010348331693E+19) +float(-8.301034833169298E+19) --- testing: 65 * 9223372036854775807 --- -float(5.9951918239556E+20) +float(5.995191823955604E+20) --- testing: 65 * -9223372036854775808 --- -float(-5.9951918239556E+20) +float(-5.995191823955604E+20) --- testing: 65 * 2147483647 --- int(139586437055) --- testing: 65 * -2147483648 --- int(-139586437120) --- testing: 65 * 9223372034707292160 --- -float(5.9951918225597E+20) +float(5.99519182255974E+20) --- testing: 65 * -9223372034707292160 --- -float(-5.9951918225597E+20) +float(-5.99519182255974E+20) --- testing: 65 * 2147483648 --- int(139586437120) --- testing: 65 * -2147483649 --- @@ -482,25 +481,25 @@ int(279172874175) --- testing: 65 * 4294967293 --- int(279172874045) --- testing: 65 * 9223372036854775806 --- -float(5.9951918239556E+20) +float(5.995191823955604E+20) --- testing: 65 * 9.2233720368548E+18 --- -float(5.9951918239556E+20) +float(5.995191823955604E+20) --- testing: 65 * -9223372036854775807 --- -float(-5.9951918239556E+20) +float(-5.995191823955604E+20) --- testing: 65 * -9.2233720368548E+18 --- -float(-5.9951918239556E+20) +float(-5.995191823955604E+20) --- testing: -44 * 9223372036854775807 --- -float(-4.0582836962161E+20) +float(-4.0582836962161014E+20) --- testing: -44 * -9223372036854775808 --- -float(4.0582836962161E+20) +float(4.0582836962161014E+20) --- testing: -44 * 2147483647 --- int(-94489280468) --- testing: -44 * -2147483648 --- int(94489280512) --- testing: -44 * 9223372034707292160 --- -float(-4.0582836952712E+20) +float(-4.0582836952712086E+20) --- testing: -44 * -9223372034707292160 --- -float(4.0582836952712E+20) +float(4.0582836952712086E+20) --- testing: -44 * 2147483648 --- int(-94489280512) --- testing: -44 * -2147483649 --- @@ -512,25 +511,25 @@ int(-188978560980) --- testing: -44 * 4294967293 --- int(-188978560892) --- testing: -44 * 9223372036854775806 --- -float(-4.0582836962161E+20) +float(-4.0582836962161014E+20) --- testing: -44 * 9.2233720368548E+18 --- -float(-4.0582836962161E+20) +float(-4.0582836962161014E+20) --- testing: -44 * -9223372036854775807 --- -float(4.0582836962161E+20) +float(4.0582836962161014E+20) --- testing: -44 * -9.2233720368548E+18 --- -float(4.0582836962161E+20) +float(4.0582836962161014E+20) --- testing: 2147483647 * 9223372036854775807 --- -float(1.9807040619343E+28) +float(1.9807040619342712E+28) --- testing: 2147483647 * -9223372036854775808 --- -float(-1.9807040619343E+28) +float(-1.9807040619342712E+28) --- testing: 2147483647 * 2147483647 --- int(4611686014132420609) --- testing: 2147483647 * -2147483648 --- int(-4611686016279904256) --- testing: 2147483647 * 9223372034707292160 --- -float(1.9807040614731E+28) +float(1.9807040614731026E+28) --- testing: 2147483647 * -9223372034707292160 --- -float(-1.9807040614731E+28) +float(-1.9807040614731026E+28) --- testing: 2147483647 * 2147483648 --- int(4611686016279904256) --- testing: 2147483647 * -2147483649 --- @@ -542,41 +541,40 @@ int(9223372030412324865) --- testing: 2147483647 * 4294967293 --- int(9223372026117357571) --- testing: 2147483647 * 9223372036854775806 --- -float(1.9807040619343E+28) +float(1.9807040619342712E+28) --- testing: 2147483647 * 9.2233720368548E+18 --- -float(1.9807040619343E+28) +float(1.9807040619342712E+28) --- testing: 2147483647 * -9223372036854775807 --- -float(-1.9807040619343E+28) +float(-1.9807040619342712E+28) --- testing: 2147483647 * -9.2233720368548E+18 --- -float(-1.9807040619343E+28) +float(-1.9807040619342712E+28) --- testing: 9223372036854775807 * 9223372036854775807 --- -float(8.5070591730235E+37) +float(8.507059173023462E+37) --- testing: 9223372036854775807 * -9223372036854775808 --- -float(-8.5070591730235E+37) +float(-8.507059173023462E+37) --- testing: 9223372036854775807 * 2147483647 --- -float(1.9807040619343E+28) +float(1.9807040619342712E+28) --- testing: 9223372036854775807 * -2147483648 --- -float(-1.9807040628566E+28) +float(-1.9807040628566084E+28) --- testing: 9223372036854775807 * 9223372034707292160 --- -float(8.5070591710428E+37) +float(8.5070591710427575E+37) --- testing: 9223372036854775807 * -9223372034707292160 --- -float(-8.5070591710428E+37) +float(-8.5070591710427575E+37) --- testing: 9223372036854775807 * 2147483648 --- -float(1.9807040628566E+28) +float(1.9807040628566084E+28) --- testing: 9223372036854775807 * -2147483649 --- -float(-1.9807040637789E+28) +float(-1.9807040637789456E+28) --- testing: 9223372036854775807 * 4294967294 --- -float(3.9614081238685E+28) +float(3.9614081238685425E+28) --- testing: 9223372036854775807 * 4294967295 --- -float(3.9614081247909E+28) +float(3.9614081247908797E+28) --- testing: 9223372036854775807 * 4294967293 --- -float(3.9614081229462E+28) +float(3.9614081229462053E+28) --- testing: 9223372036854775807 * 9223372036854775806 --- -float(8.5070591730235E+37) +float(8.507059173023462E+37) --- testing: 9223372036854775807 * 9.2233720368548E+18 --- -float(8.5070591730235E+37) +float(8.507059173023462E+37) --- testing: 9223372036854775807 * -9223372036854775807 --- -float(-8.5070591730235E+37) +float(-8.507059173023462E+37) --- testing: 9223372036854775807 * -9.2233720368548E+18 --- -float(-8.5070591730235E+37) -===DONE=== +float(-8.507059173023462E+37) diff --git a/tests/lang/operators/multiply_variationStr.phpt b/tests/lang/operators/multiply_variationStr.phpt index 50735e2548..af650ae993 100644 --- a/tests/lang/operators/multiply_variationStr.phpt +++ b/tests/lang/operators/multiply_variationStr.phpt @@ -11,15 +11,17 @@ $strVals = array( error_reporting(E_ERROR); foreach ($strVals as $strVal) { - foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' * '$otherVal' ---\n"; - var_dump($strVal*$otherVal); - } + foreach($strVals as $otherVal) { + echo "--- testing: '$strVal' * '$otherVal' ---\n"; + try { + var_dump($strVal*$otherVal); + } catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; + } + } } - ?> -===DONE=== --EXPECT-- --- testing: '0' * '0' --- int(0) @@ -32,7 +34,7 @@ float(0) --- testing: '0' * '-7.7' --- float(-0) --- testing: '0' * 'abc' --- -int(0) +Unsupported operand types: string * string --- testing: '0' * '123abc' --- int(0) --- testing: '0' * '123e5' --- @@ -48,7 +50,7 @@ int(0) --- testing: '0' * '3.4a' --- float(0) --- testing: '0' * 'a5.9' --- -int(0) +Unsupported operand types: string * string --- testing: '65' * '0' --- int(0) --- testing: '65' * '65' --- @@ -60,7 +62,7 @@ float(78) --- testing: '65' * '-7.7' --- float(-500.5) --- testing: '65' * 'abc' --- -int(0) +Unsupported operand types: string * string --- testing: '65' * '123abc' --- int(7995) --- testing: '65' * '123e5' --- @@ -76,7 +78,7 @@ int(7995) --- testing: '65' * '3.4a' --- float(221) --- testing: '65' * 'a5.9' --- -int(0) +Unsupported operand types: string * string --- testing: '-44' * '0' --- int(0) --- testing: '-44' * '65' --- @@ -88,7 +90,7 @@ float(-52.8) --- testing: '-44' * '-7.7' --- float(338.8) --- testing: '-44' * 'abc' --- -int(0) +Unsupported operand types: string * string --- testing: '-44' * '123abc' --- int(-5412) --- testing: '-44' * '123e5' --- @@ -104,7 +106,7 @@ int(-5412) --- testing: '-44' * '3.4a' --- float(-149.6) --- testing: '-44' * 'a5.9' --- -int(0) +Unsupported operand types: string * string --- testing: '1.2' * '0' --- float(0) --- testing: '1.2' * '65' --- @@ -116,7 +118,7 @@ float(1.44) --- testing: '1.2' * '-7.7' --- float(-9.24) --- testing: '1.2' * 'abc' --- -float(0) +Unsupported operand types: string * string --- testing: '1.2' * '123abc' --- float(147.6) --- testing: '1.2' * '123e5' --- @@ -132,7 +134,7 @@ float(147.6) --- testing: '1.2' * '3.4a' --- float(4.08) --- testing: '1.2' * 'a5.9' --- -float(0) +Unsupported operand types: string * string --- testing: '-7.7' * '0' --- float(-0) --- testing: '-7.7' * '65' --- @@ -142,9 +144,9 @@ float(338.8) --- testing: '-7.7' * '1.2' --- float(-9.24) --- testing: '-7.7' * '-7.7' --- -float(59.29) +float(59.290000000000006) --- testing: '-7.7' * 'abc' --- -float(-0) +Unsupported operand types: string * string --- testing: '-7.7' * '123abc' --- float(-947.1) --- testing: '-7.7' * '123e5' --- @@ -160,35 +162,35 @@ float(-947.1) --- testing: '-7.7' * '3.4a' --- float(-26.18) --- testing: '-7.7' * 'a5.9' --- -float(-0) +Unsupported operand types: string * string --- testing: 'abc' * '0' --- -int(0) +Unsupported operand types: string * string --- testing: 'abc' * '65' --- -int(0) +Unsupported operand types: string * string --- testing: 'abc' * '-44' --- -int(0) +Unsupported operand types: string * string --- testing: 'abc' * '1.2' --- -float(0) +Unsupported operand types: string * string --- testing: 'abc' * '-7.7' --- -float(-0) +Unsupported operand types: string * string --- testing: 'abc' * 'abc' --- -int(0) +Unsupported operand types: string * string --- testing: 'abc' * '123abc' --- -int(0) +Unsupported operand types: string * string --- testing: 'abc' * '123e5' --- -float(0) +Unsupported operand types: string * string --- testing: 'abc' * '123e5xyz' --- -float(0) +Unsupported operand types: string * string --- testing: 'abc' * ' 123abc' --- -int(0) +Unsupported operand types: string * string --- testing: 'abc' * '123 abc' --- -int(0) +Unsupported operand types: string * string --- testing: 'abc' * '123abc ' --- -int(0) +Unsupported operand types: string * string --- testing: 'abc' * '3.4a' --- -float(0) +Unsupported operand types: string * string --- testing: 'abc' * 'a5.9' --- -int(0) +Unsupported operand types: string * string --- testing: '123abc' * '0' --- int(0) --- testing: '123abc' * '65' --- @@ -200,7 +202,7 @@ float(147.6) --- testing: '123abc' * '-7.7' --- float(-947.1) --- testing: '123abc' * 'abc' --- -int(0) +Unsupported operand types: string * string --- testing: '123abc' * '123abc' --- int(15129) --- testing: '123abc' * '123e5' --- @@ -216,7 +218,7 @@ int(15129) --- testing: '123abc' * '3.4a' --- float(418.2) --- testing: '123abc' * 'a5.9' --- -int(0) +Unsupported operand types: string * string --- testing: '123e5' * '0' --- float(0) --- testing: '123e5' * '65' --- @@ -228,13 +230,13 @@ float(14760000) --- testing: '123e5' * '-7.7' --- float(-94710000) --- testing: '123e5' * 'abc' --- -float(0) +Unsupported operand types: string * string --- testing: '123e5' * '123abc' --- float(1512900000) --- testing: '123e5' * '123e5' --- -float(1.5129E+14) +float(151290000000000) --- testing: '123e5' * '123e5xyz' --- -float(1.5129E+14) +float(151290000000000) --- testing: '123e5' * ' 123abc' --- float(1512900000) --- testing: '123e5' * '123 abc' --- @@ -244,7 +246,7 @@ float(1512900000) --- testing: '123e5' * '3.4a' --- float(41820000) --- testing: '123e5' * 'a5.9' --- -float(0) +Unsupported operand types: string * string --- testing: '123e5xyz' * '0' --- float(0) --- testing: '123e5xyz' * '65' --- @@ -256,13 +258,13 @@ float(14760000) --- testing: '123e5xyz' * '-7.7' --- float(-94710000) --- testing: '123e5xyz' * 'abc' --- -float(0) +Unsupported operand types: string * string --- testing: '123e5xyz' * '123abc' --- float(1512900000) --- testing: '123e5xyz' * '123e5' --- -float(1.5129E+14) +float(151290000000000) --- testing: '123e5xyz' * '123e5xyz' --- -float(1.5129E+14) +float(151290000000000) --- testing: '123e5xyz' * ' 123abc' --- float(1512900000) --- testing: '123e5xyz' * '123 abc' --- @@ -272,7 +274,7 @@ float(1512900000) --- testing: '123e5xyz' * '3.4a' --- float(41820000) --- testing: '123e5xyz' * 'a5.9' --- -float(0) +Unsupported operand types: string * string --- testing: ' 123abc' * '0' --- int(0) --- testing: ' 123abc' * '65' --- @@ -284,7 +286,7 @@ float(147.6) --- testing: ' 123abc' * '-7.7' --- float(-947.1) --- testing: ' 123abc' * 'abc' --- -int(0) +Unsupported operand types: string * string --- testing: ' 123abc' * '123abc' --- int(15129) --- testing: ' 123abc' * '123e5' --- @@ -300,7 +302,7 @@ int(15129) --- testing: ' 123abc' * '3.4a' --- float(418.2) --- testing: ' 123abc' * 'a5.9' --- -int(0) +Unsupported operand types: string * string --- testing: '123 abc' * '0' --- int(0) --- testing: '123 abc' * '65' --- @@ -312,7 +314,7 @@ float(147.6) --- testing: '123 abc' * '-7.7' --- float(-947.1) --- testing: '123 abc' * 'abc' --- -int(0) +Unsupported operand types: string * string --- testing: '123 abc' * '123abc' --- int(15129) --- testing: '123 abc' * '123e5' --- @@ -328,7 +330,7 @@ int(15129) --- testing: '123 abc' * '3.4a' --- float(418.2) --- testing: '123 abc' * 'a5.9' --- -int(0) +Unsupported operand types: string * string --- testing: '123abc ' * '0' --- int(0) --- testing: '123abc ' * '65' --- @@ -340,7 +342,7 @@ float(147.6) --- testing: '123abc ' * '-7.7' --- float(-947.1) --- testing: '123abc ' * 'abc' --- -int(0) +Unsupported operand types: string * string --- testing: '123abc ' * '123abc' --- int(15129) --- testing: '123abc ' * '123e5' --- @@ -356,7 +358,7 @@ int(15129) --- testing: '123abc ' * '3.4a' --- float(418.2) --- testing: '123abc ' * 'a5.9' --- -int(0) +Unsupported operand types: string * string --- testing: '3.4a' * '0' --- float(0) --- testing: '3.4a' * '65' --- @@ -368,7 +370,7 @@ float(4.08) --- testing: '3.4a' * '-7.7' --- float(-26.18) --- testing: '3.4a' * 'abc' --- -float(0) +Unsupported operand types: string * string --- testing: '3.4a' * '123abc' --- float(418.2) --- testing: '3.4a' * '123e5' --- @@ -382,35 +384,34 @@ float(418.2) --- testing: '3.4a' * '123abc ' --- float(418.2) --- testing: '3.4a' * '3.4a' --- -float(11.56) +float(11.559999999999999) --- testing: '3.4a' * 'a5.9' --- -float(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '0' --- -int(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '65' --- -int(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '-44' --- -int(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '1.2' --- -float(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '-7.7' --- -float(-0) +Unsupported operand types: string * string --- testing: 'a5.9' * 'abc' --- -int(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '123abc' --- -int(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '123e5' --- -float(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '123e5xyz' --- -float(0) +Unsupported operand types: string * string --- testing: 'a5.9' * ' 123abc' --- -int(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '123 abc' --- -int(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '123abc ' --- -int(0) +Unsupported operand types: string * string --- testing: 'a5.9' * '3.4a' --- -float(0) +Unsupported operand types: string * string --- testing: 'a5.9' * 'a5.9' --- -int(0) -===DONE=== +Unsupported operand types: string * string diff --git a/tests/lang/operators/nan-comparison-false.phpt b/tests/lang/operators/nan-comparison-false.phpt index 2c44405670..1bb1f7b23d 100644 --- a/tests/lang/operators/nan-comparison-false.phpt +++ b/tests/lang/operators/nan-comparison-false.phpt @@ -15,6 +15,7 @@ var_dump(0 < $nan); var_dump(0 <= $nan); var_dump(0 > $nan); var_dump(0 >= $nan); +?> --EXPECT-- ** CONST bool(false) diff --git a/tests/lang/operators/negate_basiclong_64bit.phpt b/tests/lang/operators/negate_basiclong_64bit.phpt index bce8982126..66e7248e0f 100644 --- a/tests/lang/operators/negate_basiclong_64bit.phpt +++ b/tests/lang/operators/negate_basiclong_64bit.phpt @@ -25,12 +25,11 @@ foreach ($longVals as $longVal) { } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 --- int(-9223372036854775807) --- testing: -9223372036854775808 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 2147483647 --- int(-2147483647) --- testing: -2147483648 --- @@ -52,9 +51,8 @@ int(-4294967293) --- testing: 9223372036854775806 --- int(-9223372036854775806) --- testing: 9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775807 --- int(9223372036854775807) --- testing: -9.2233720368548E+18 --- -float(9.2233720368548E+18) -===DONE=== +float(9.223372036854776E+18) diff --git a/tests/lang/operators/negate_variationStr.phpt b/tests/lang/operators/negate_variationStr.phpt index 7956ef4a1c..43b2f6a52a 100644 --- a/tests/lang/operators/negate_variationStr.phpt +++ b/tests/lang/operators/negate_variationStr.phpt @@ -8,14 +8,16 @@ $strVals = array( "a5.9" ); - foreach ($strVals as $strVal) { - echo "--- testing: '$strVal' ---\n"; - var_dump(-$strVal); + echo "--- testing: '$strVal' ---\n"; + try { + var_dump(-$strVal); + } catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; + } } ?> -===DONE=== --EXPECTF-- --- testing: '0' --- int(0) @@ -28,37 +30,32 @@ float(-1.2) --- testing: '-7.7' --- float(7.7) --- testing: 'abc' --- - -Warning: A non-numeric value encountered in %s on line %d -int(0) +Unsupported operand types: string * int --- testing: '123abc' --- -Notice: A non well formed numeric value encountered in %s on line %d +Warning: A non-numeric value encountered in %s on line %d int(-123) --- testing: '123e5' --- float(-12300000) --- testing: '123e5xyz' --- -Notice: A non well formed numeric value encountered in %s on line %d +Warning: A non-numeric value encountered in %s on line %d float(-12300000) --- testing: ' 123abc' --- -Notice: A non well formed numeric value encountered in %s on line %d +Warning: A non-numeric value encountered in %s on line %d int(-123) --- testing: '123 abc' --- -Notice: A non well formed numeric value encountered in %s on line %d +Warning: A non-numeric value encountered in %s on line %d int(-123) --- testing: '123abc ' --- -Notice: A non well formed numeric value encountered in %s on line %d +Warning: A non-numeric value encountered in %s on line %d int(-123) --- testing: '3.4a' --- -Notice: A non well formed numeric value encountered in %s on line %d +Warning: A non-numeric value encountered in %s on line %d float(-3.4) --- testing: 'a5.9' --- - -Warning: A non-numeric value encountered in %s on line %d -int(0) -===DONE=== +Unsupported operand types: string * int diff --git a/tests/lang/operators/operator_equals_basic.phpt b/tests/lang/operators/operator_equals_basic.phpt index 1f83a48180..63ab1ac68d 100644 --- a/tests/lang/operators/operator_equals_basic.phpt +++ b/tests/lang/operators/operator_equals_basic.phpt @@ -8,17 +8,17 @@ $valid_false = array(0, "", 0.0, array(), NULL); $int1 = 679; $int2 = -67835; -$valid_int1 = array("679", "679abc", " 679", "679 ", 679.0, 6.79E2, "+679", +679); -$valid_int2 = array("-67835", "-67835abc", " -67835", "-67835 ", -67835.000, -6.7835E4); -$invalid_int1 = array("6 7 9", "6y79", 678); -$invalid_int2 = array("- 67835", "-67,835", "-67 835", "-678y35", -76834); +$valid_int1 = array("679", " 679", "679 ", 679.0, 6.79E2, "+679", +679); +$valid_int2 = array("-67835", " -67835", "-67835 ", -67835.000, -6.7835E4); +$invalid_int1 = array("679abc", "6 7 9", "6y79", 678); +$invalid_int2 = array("-67835abc", "- 67835", "-67,835", "-67 835", "-678y35", -76834); $float1 = 57385.45835; $float2 = -67345.76567; -$valid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", 5.738545835e4); -$valid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", -6.734576567E4); -$invalid_float1 = array("57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4); -$invalid_float2 = array("- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4); +$valid_float1 = array("57385.45835", " 57385.45835", 5.738545835e4); +$valid_float2 = array("-67345.76567", " -67345.76567", -6.734576567E4); +$invalid_float1 = array("57385.45835aaa", "57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4); +$invalid_float2 = array("-67345.76567aaa", "- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4); $toCompare = array( @@ -59,7 +59,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_equals_variation.phpt b/tests/lang/operators/operator_equals_variation.phpt index ad561454ae..65fe4a9aae 100644 --- a/tests/lang/operators/operator_equals_variation.phpt +++ b/tests/lang/operators/operator_equals_variation.phpt @@ -57,7 +57,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_equals_variation_64bit.phpt b/tests/lang/operators/operator_equals_variation_64bit.phpt index 15d440978e..7a04e244a4 100644 --- a/tests/lang/operators/operator_equals_variation_64bit.phpt +++ b/tests/lang/operators/operator_equals_variation_64bit.phpt @@ -59,7 +59,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_gt_basic.phpt b/tests/lang/operators/operator_gt_basic.phpt index 66c457f0b1..bb13bd9599 100644 --- a/tests/lang/operators/operator_gt_basic.phpt +++ b/tests/lang/operators/operator_gt_basic.phpt @@ -8,16 +8,16 @@ $valid_false = array(0, "", 0.0, array(), NULL); $int1 = 679; $int2 = -67835; $valid_int1 = array("678", "678abc", " 678", "678 ", 678.0, 6.789E2, "+678", +678); -$valid_int2 = array("-67836", "-67836abc", " -67836", "-67836 ", -67835.0001, -6.78351E4); +$valid_int2 = array("-67836", " -67836", -67835.0001, -6.78351E4, "-67836 "); $invalid_int1 = array(679, "679"); -$invalid_int2 = array(-67835, "-67835"); +$invalid_int2 = array(-67835, "-67835", "-67836abc"); $float1 = 57385.45835; $float2 = -67345.76567; $valid_float1 = array("57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); -$valid_float2 = array("-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4); +$valid_float2 = array("-67345.76568", " -67345.76568", -6.734576568E4); $invalid_float1 = array(57385.45835, 5.738545835e4); -$invalid_float2 = array(-67345.76567, -6.734576567E4); +$invalid_float2 = array(-67345.76567, -6.734576567E4, "-67345.76568aaa"); $toCompare = array( @@ -59,7 +59,5 @@ if ($failed == false) { echo "Test Passed\n"; } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_gt_or_equal_basic.phpt b/tests/lang/operators/operator_gt_or_equal_basic.phpt index 006c22baeb..442e721659 100644 --- a/tests/lang/operators/operator_gt_or_equal_basic.phpt +++ b/tests/lang/operators/operator_gt_or_equal_basic.phpt @@ -7,17 +7,17 @@ $valid_false = array(0, "", 0.0, array(), NULL); $int1 = 679; $int2 = -67835; -$valid_int1 = array("679", "679abc", " 679", 679.0, 6.79E2, "678", "678abc", " 678", 678.0, 6.78E2, 6.789E2, "+678", +678); -$valid_int2 = array("-67835", "-67835abc", " -67835", -67835.000, -6.7835E4, "-67836", "-67836abc". " -67836", -67835.0001, -6.78351E4, "-67836", -67835.0001, -6.78351E4); -$invalid_int1 = array(680, "680"); -$invalid_int2 = array(-67834, "-67834"); +$valid_int1 = array("679", " 679", 679.0, 6.79E2, "678", "678abc", " 678", 678.0, 6.78E2, 6.789E2, "+678", +678); +$valid_int2 = array("-67835", " -67835", -67835.000, -6.7835E4, "-67836", -67835.0001, -6.78351E4, "-67836", -67835.0001, -6.78351E4); +$invalid_int1 = array(680, "680", "679abc"); +$invalid_int2 = array(-67834, "-67834", "-67835abc", "-67836abc". " -67836"); $float1 = 57385.45835; $float2 = -67345.76567; -$valid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", 5.738545835e4, "57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); -$valid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", -6.734576567E4, "-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4); -$invalid_float1 = array(57385.45836, 5.738545836e4); -$invalid_float2 = array(-67345.76564, -6.734576564E4); +$valid_float1 = array("57385.45835", " 57385.45835", 5.738545835e4, "57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); +$valid_float2 = array("-67345.76567", " -67345.76567", -6.734576567E4, "-67345.76568", " -67345.76568", -6.734576568E4); +$invalid_float1 = array(57385.45836, 5.738545836e4, "57385.45835aaa"); +$invalid_float2 = array(-67345.76564, -6.734576564E4, "-67345.76567aaa", "-67345.76568aaa"); $toCompare = array( @@ -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; + } + } } } @@ -59,7 +59,5 @@ if ($failed == false) { echo "Test Passed\n"; } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_gt_or_equal_variation.phpt b/tests/lang/operators/operator_gt_or_equal_variation.phpt index 1e3a338e73..eb0bd91b76 100644 --- a/tests/lang/operators/operator_gt_or_equal_variation.phpt +++ b/tests/lang/operators/operator_gt_or_equal_variation.phpt @@ -57,7 +57,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt b/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt index d6245abbfc..71dd554e34 100644 --- a/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt +++ b/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt @@ -57,7 +57,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_gt_variation.phpt b/tests/lang/operators/operator_gt_variation.phpt index 4c56ec5e6a..9c85b1848a 100644 --- a/tests/lang/operators/operator_gt_variation.phpt +++ b/tests/lang/operators/operator_gt_variation.phpt @@ -52,7 +52,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_gt_variation_64bit.phpt b/tests/lang/operators/operator_gt_variation_64bit.phpt index 60a34c8986..fb3947f3e5 100644 --- a/tests/lang/operators/operator_gt_variation_64bit.phpt +++ b/tests/lang/operators/operator_gt_variation_64bit.phpt @@ -56,7 +56,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_identical_basic.phpt b/tests/lang/operators/operator_identical_basic.phpt index cddba995a6..8f566523d0 100644 --- a/tests/lang/operators/operator_identical_basic.phpt +++ b/tests/lang/operators/operator_identical_basic.phpt @@ -59,7 +59,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_identical_recusion-01.phpt b/tests/lang/operators/operator_identical_recusion-01.phpt index 70a7605bae..4828c2a383 100644 --- a/tests/lang/operators/operator_identical_recusion-01.phpt +++ b/tests/lang/operators/operator_identical_recusion-01.phpt @@ -6,5 +6,6 @@ $n = 0; $a = [[$n]]; $b = [&$a]; var_dump($a === $b); +?> --EXPECT-- bool(false) diff --git a/tests/lang/operators/operator_identical_variation.phpt b/tests/lang/operators/operator_identical_variation.phpt index 8b8e1dc7ea..0bc3329f59 100644 --- a/tests/lang/operators/operator_identical_variation.phpt +++ b/tests/lang/operators/operator_identical_variation.phpt @@ -57,7 +57,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_identical_variation_64bit.phpt b/tests/lang/operators/operator_identical_variation_64bit.phpt index cd098699f2..13dd3e8442 100644 --- a/tests/lang/operators/operator_identical_variation_64bit.phpt +++ b/tests/lang/operators/operator_identical_variation_64bit.phpt @@ -59,7 +59,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_lt_basic.phpt b/tests/lang/operators/operator_lt_basic.phpt index 4574fb7d1d..e3fedddf83 100644 --- a/tests/lang/operators/operator_lt_basic.phpt +++ b/tests/lang/operators/operator_lt_basic.phpt @@ -8,16 +8,16 @@ $valid_false = array(0, "", 0.0, array(), NULL); $int1 = 677; $int2 = -67837; $valid_int1 = array("678", "678abc", " 678", "678 ", 678.0, 6.789E2, "+678", +678); -$valid_int2 = array("-67836", "-67836abc", " -67836", "-67836 ", -67835.0001, -6.78351E4); +$valid_int2 = array("-67836", " -67836", -67835.0001, -6.78351E4, "-67836 "); $invalid_int1 = array(676, "676"); -$invalid_int2 = array(-67837, "-67837"); +$invalid_int2 = array(-67837, "-67837", "-67836abc"); $float1 = 57385.45835; $float2 = -67345.76567; $valid_float1 = array("57385.45836", "57385.45836aaa", " 57385.45836", 5.738545836e4); -$valid_float2 = array("-67345.76566", "-67345.76566aaa", " -67345.76566", -6.734576566E4); +$valid_float2 = array("-67345.76566", " -67345.76566", -6.734576566E4); $invalid_float1 = array(57385.45835, 5.738545835e4); -$invalid_float2 = array(-67345.76567, -6.734576567E4); +$invalid_float2 = array(-67345.76567, -6.734576567E4, "-67345.76566aaa"); $toCompare = array( @@ -56,7 +56,5 @@ if ($failed == false) { echo "Test Passed\n"; } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_lt_or_equal_basic.phpt b/tests/lang/operators/operator_lt_or_equal_basic.phpt index 5439fd7d75..bc8b1f31fe 100644 --- a/tests/lang/operators/operator_lt_or_equal_basic.phpt +++ b/tests/lang/operators/operator_lt_or_equal_basic.phpt @@ -8,16 +8,16 @@ $valid_false = array(0, "", 0.0, array(), NULL); $int1 = 678; $int2 = -67836; $valid_int1 = array("679", "679abc", " 679", 679.0, 6.79E2, "678", "678abc", " 678", 678.0, 6.78E2, 6.789E2, "+678", +678); -$valid_int2 = array("-67835", "-67835abc", " -67835", -67835.000, -6.7835E4, "-67836", "-67836abc". " -67836", -67835.0001, -6.78351E4, "-67836", -67835.0001, -6.78351E4); +$valid_int2 = array("-67835", " -67835", -67835.000, -6.7835E4, "-67836", "-67836abc". " -67836", -67835.0001, -6.78351E4, "-67836", -67835.0001, -6.78351E4); $invalid_int1 = array(677, "677"); -$invalid_int2 = array(-67874, "-67837"); +$invalid_int2 = array(-67874, "-67837", "-67835abc"); $float1 = 57385.45834; $float2 = -67345.76568; $valid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", 5.738545835e4, "57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); -$valid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", -6.734576567E4, "-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4); +$valid_float2 = array("-67345.76567", " -67345.76567", -6.734576567E4, "-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4); $invalid_float1 = array(57385.45833, 5.738545833e4); -$invalid_float2 = array(-67345.76569, -6.734576569E4); +$invalid_float2 = array(-67345.76569, -6.734576569E4, "-67345.76567aaa"); $toCompare = array( true, $valid_true, $valid_false, @@ -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; + } + } } } @@ -58,7 +58,5 @@ if ($failed == false) { echo "Test Passed\n"; } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_lt_or_equal_variation.phpt b/tests/lang/operators/operator_lt_or_equal_variation.phpt index a003138ceb..27d45142a2 100644 --- a/tests/lang/operators/operator_lt_or_equal_variation.phpt +++ b/tests/lang/operators/operator_lt_or_equal_variation.phpt @@ -57,7 +57,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt b/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt index 50afd9b3e5..293d429c05 100644 --- a/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt +++ b/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt @@ -57,7 +57,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_lt_variation.phpt b/tests/lang/operators/operator_lt_variation.phpt index 18a6631665..a4886c257b 100644 --- a/tests/lang/operators/operator_lt_variation.phpt +++ b/tests/lang/operators/operator_lt_variation.phpt @@ -50,7 +50,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_lt_variation_64bit.phpt b/tests/lang/operators/operator_lt_variation_64bit.phpt index 663b840e61..84156669cd 100644 --- a/tests/lang/operators/operator_lt_variation_64bit.phpt +++ b/tests/lang/operators/operator_lt_variation_64bit.phpt @@ -54,7 +54,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_notequals_basic.phpt b/tests/lang/operators/operator_notequals_basic.phpt index 35bd83e445..156c60d6da 100644 --- a/tests/lang/operators/operator_notequals_basic.phpt +++ b/tests/lang/operators/operator_notequals_basic.phpt @@ -8,17 +8,17 @@ $valid_false = array(0, "", 0.0, array(), NULL); $int1 = 679; $int2 = -67835; -$valid_int1 = array("6 7 9", "6y79", 678); -$valid_int2 = array("- 67835", "-67,835", "-67 835", "-678y35", -76834); -$invalid_int1 = array("679", "679abc", " 679", "679 ", 679.0, 6.79E2, "+679", +679); -$invalid_int2 = array("-67835", "-67835abc", " -67835", "-67835 ", -67835.000, -6.7835E4); +$valid_int1 = array("679abc", "6 7 9", "6y79", 678); +$valid_int2 = array("-67835abc", "- 67835", "-67,835", "-67 835", "-678y35", -76834); +$invalid_int1 = array("679", " 679", "679 ", 679.0, 6.79E2, "+679", +679); +$invalid_int2 = array("-67835", " -67835", "-67835 ", -67835.000, -6.7835E4); $float1 = 57385.45835; $float2 = -67345.76567; -$valid_float1 = array("57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4); -$valid_float2 = array("- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4); -$invalid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", 5.738545835e4); -$invalid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", -6.734576567E4); +$valid_float1 = array("57385.45835aaa", "57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4); +$valid_float2 = array("-67345.76567aaa", "- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4); +$invalid_float1 = array("57385.45835", " 57385.45835", 5.738545835e4); +$invalid_float2 = array("-67345.76567", " -67345.76567", -6.734576567E4); $toCompare = array( @@ -59,7 +59,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_notequals_variation.phpt b/tests/lang/operators/operator_notequals_variation.phpt index 137888506f..a6eea6701d 100644 --- a/tests/lang/operators/operator_notequals_variation.phpt +++ b/tests/lang/operators/operator_notequals_variation.phpt @@ -57,7 +57,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_notequals_variation_64bit.phpt b/tests/lang/operators/operator_notequals_variation_64bit.phpt index ea06b49264..1a5491c760 100644 --- a/tests/lang/operators/operator_notequals_variation_64bit.phpt +++ b/tests/lang/operators/operator_notequals_variation_64bit.phpt @@ -59,7 +59,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_notidentical_basic.phpt b/tests/lang/operators/operator_notidentical_basic.phpt index d24c936119..79c4ad7798 100644 --- a/tests/lang/operators/operator_notidentical_basic.phpt +++ b/tests/lang/operators/operator_notidentical_basic.phpt @@ -59,7 +59,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_notidentical_variation.phpt b/tests/lang/operators/operator_notidentical_variation.phpt index bae03f85b7..09d492be21 100644 --- a/tests/lang/operators/operator_notidentical_variation.phpt +++ b/tests/lang/operators/operator_notidentical_variation.phpt @@ -58,7 +58,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_notidentical_variation_64bit.phpt b/tests/lang/operators/operator_notidentical_variation_64bit.phpt index d24f8b6234..03dfa1fca1 100644 --- a/tests/lang/operators/operator_notidentical_variation_64bit.phpt +++ b/tests/lang/operators/operator_notidentical_variation_64bit.phpt @@ -59,7 +59,5 @@ if ($failed == false) { } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== diff --git a/tests/lang/operators/operator_spaceship_basic.phpt b/tests/lang/operators/operator_spaceship_basic.phpt index 13b80612dc..f74201bc5f 100644 --- a/tests/lang/operators/operator_spaceship_basic.phpt +++ b/tests/lang/operators/operator_spaceship_basic.phpt @@ -8,16 +8,16 @@ $valid_false = array(0, "", 0.0, array(), NULL); $int1 = 679; $int2 = -67835; $valid_int1 = array("678", "678abc", " 678", "678 ", 678.0, 6.789E2, "+678", +678); -$valid_int2 = array("-67836", "-67836abc", " -67836", "-67836 ", -67835.0001, -6.78351E4); +$valid_int2 = array("-67836", " -67836", "-67836 ", -67835.0001, -6.78351E4); $invalid_int1 = array(679, "679"); -$invalid_int2 = array(-67835, "-67835"); +$invalid_int2 = array(-67835, "-67835", "-67836abc"); $float1 = 57385.45835; $float2 = -67345.76567; $valid_float1 = array("57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4); -$valid_float2 = array("-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4); +$valid_float2 = array("-67345.76568", " -67345.76568", -6.734576568E4); $invalid_float1 = array(57385.45835, 5.738545835e4); -$invalid_float2 = array(-67345.76567, -6.734576567E4); +$invalid_float2 = array(-67345.76567, -6.734576567E4, "-67345.76568aaa"); $toCompare = array( @@ -88,7 +88,5 @@ if ($failed == false) { echo "Test Passed\n"; } ?> -===DONE=== --EXPECT-- Test Passed -===DONE=== 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/postdec_basiclong_64bit.phpt b/tests/lang/operators/postdec_basiclong_64bit.phpt index 5d0af4d553..a372739134 100644 --- a/tests/lang/operators/postdec_basiclong_64bit.phpt +++ b/tests/lang/operators/postdec_basiclong_64bit.phpt @@ -26,12 +26,11 @@ foreach ($longVals as $longVal) { } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 --- int(9223372036854775806) --- testing: -9223372036854775808 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 2147483647 --- int(2147483646) --- testing: -2147483648 --- @@ -53,9 +52,8 @@ int(4294967292) --- testing: 9223372036854775806 --- int(9223372036854775805) --- testing: 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9223372036854775807 --- int(-9223372036854775808) --- testing: -9.2233720368548E+18 --- -float(-9.2233720368548E+18) -===DONE=== +float(-9.223372036854776E+18) diff --git a/tests/lang/operators/postdec_variationStr.phpt b/tests/lang/operators/postdec_variationStr.phpt index da88951e46..cb452ccba9 100644 --- a/tests/lang/operators/postdec_variationStr.phpt +++ b/tests/lang/operators/postdec_variationStr.phpt @@ -16,7 +16,6 @@ foreach ($strVals as $strVal) { } ?> -===DONE=== --EXPECT-- --- testing: '0' --- int(-1) @@ -25,7 +24,7 @@ int(64) --- testing: '-44' --- int(-45) --- testing: '1.2' --- -float(0.2) +float(0.19999999999999996) --- testing: '-7.7' --- float(-8.7) --- testing: 'abc' --- @@ -46,4 +45,3 @@ string(7) "123abc " string(4) "3.4a" --- testing: 'a5.9' --- string(4) "a5.9" -===DONE=== diff --git a/tests/lang/operators/postinc_basiclong_64bit.phpt b/tests/lang/operators/postinc_basiclong_64bit.phpt index d1003e22a5..8c1446b7ef 100644 --- a/tests/lang/operators/postinc_basiclong_64bit.phpt +++ b/tests/lang/operators/postinc_basiclong_64bit.phpt @@ -26,10 +26,9 @@ foreach ($longVals as $longVal) { } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9223372036854775808 --- int(-9223372036854775807) --- testing: 2147483647 --- @@ -53,9 +52,8 @@ int(4294967294) --- testing: 9223372036854775806 --- int(9223372036854775807) --- testing: 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9223372036854775807 --- int(-9223372036854775806) --- testing: -9.2233720368548E+18 --- -float(-9.2233720368548E+18) -===DONE=== +float(-9.223372036854776E+18) diff --git a/tests/lang/operators/postinc_variationStr.phpt b/tests/lang/operators/postinc_variationStr.phpt index c83d598fb7..800b5c2455 100644 --- a/tests/lang/operators/postinc_variationStr.phpt +++ b/tests/lang/operators/postinc_variationStr.phpt @@ -16,7 +16,6 @@ foreach ($strVals as $strVal) { } ?> -===DONE=== --EXPECT-- --- testing: '0' --- int(1) @@ -46,4 +45,3 @@ string(7) "123abc " string(4) "3.4b" --- testing: 'a5.9' --- string(4) "a5.0" -===DONE=== diff --git a/tests/lang/operators/predec_basiclong_64bit.phpt b/tests/lang/operators/predec_basiclong_64bit.phpt index 1f460a06e0..5e74f71566 100644 --- a/tests/lang/operators/predec_basiclong_64bit.phpt +++ b/tests/lang/operators/predec_basiclong_64bit.phpt @@ -25,12 +25,11 @@ foreach ($longVals as $longVal) { } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 --- int(9223372036854775806) --- testing: -9223372036854775808 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 2147483647 --- int(2147483646) --- testing: -2147483648 --- @@ -52,9 +51,8 @@ int(4294967292) --- testing: 9223372036854775806 --- int(9223372036854775805) --- testing: 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9223372036854775807 --- int(-9223372036854775808) --- testing: -9.2233720368548E+18 --- -float(-9.2233720368548E+18) -===DONE=== +float(-9.223372036854776E+18) diff --git a/tests/lang/operators/predec_variationStr.phpt b/tests/lang/operators/predec_variationStr.phpt index 8fb1bffac8..ebbb6c9de3 100644 --- a/tests/lang/operators/predec_variationStr.phpt +++ b/tests/lang/operators/predec_variationStr.phpt @@ -15,7 +15,6 @@ foreach ($strVals as $strVal) { } ?> -===DONE=== --EXPECT-- --- testing: '0' --- int(-1) @@ -24,7 +23,7 @@ int(64) --- testing: '-44' --- int(-45) --- testing: '1.2' --- -float(0.2) +float(0.19999999999999996) --- testing: '-7.7' --- float(-8.7) --- testing: 'abc' --- @@ -45,4 +44,3 @@ string(7) "123abc " string(4) "3.4a" --- testing: 'a5.9' --- string(4) "a5.9" -===DONE=== diff --git a/tests/lang/operators/preinc_basiclong_64bit.phpt b/tests/lang/operators/preinc_basiclong_64bit.phpt index 40a03f9d7a..ff2190c06f 100644 --- a/tests/lang/operators/preinc_basiclong_64bit.phpt +++ b/tests/lang/operators/preinc_basiclong_64bit.phpt @@ -25,10 +25,9 @@ foreach ($longVals as $longVal) { } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9223372036854775808 --- int(-9223372036854775807) --- testing: 2147483647 --- @@ -52,9 +51,8 @@ int(4294967294) --- testing: 9223372036854775806 --- int(9223372036854775807) --- testing: 9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -9223372036854775807 --- int(-9223372036854775806) --- testing: -9.2233720368548E+18 --- -float(-9.2233720368548E+18) -===DONE=== +float(-9.223372036854776E+18) diff --git a/tests/lang/operators/preinc_variationStr.phpt b/tests/lang/operators/preinc_variationStr.phpt index 4e607057f7..abb3663889 100644 --- a/tests/lang/operators/preinc_variationStr.phpt +++ b/tests/lang/operators/preinc_variationStr.phpt @@ -16,7 +16,6 @@ foreach ($strVals as $strVal) { } ?> -===DONE=== --EXPECT-- --- testing: '0' --- int(1) @@ -64,4 +63,3 @@ string(3) "10a" string(3) "20a" --- testing: '99z' --- string(4) "100a" -===DONE=== diff --git a/tests/lang/operators/subtract_basiclong_64bit.phpt b/tests/lang/operators/subtract_basiclong_64bit.phpt index 0c403f343e..9b7f6111d6 100644 --- a/tests/lang/operators/subtract_basiclong_64bit.phpt +++ b/tests/lang/operators/subtract_basiclong_64bit.phpt @@ -24,27 +24,26 @@ 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); } } ?> -===DONE=== --EXPECT-- --- testing: 9223372036854775807 - 0 --- int(9223372036854775807) --- testing: 9223372036854775807 - 1 --- int(9223372036854775806) --- testing: 9223372036854775807 - -1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775807 - 7 --- int(9223372036854775800) --- testing: 9223372036854775807 - 9 --- @@ -52,7 +51,7 @@ int(9223372036854775798) --- testing: 9223372036854775807 - 65 --- int(9223372036854775742) --- testing: 9223372036854775807 - -44 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775807 - 2147483647 --- int(9223372034707292160) --- testing: 9223372036854775807 - 9223372036854775807 --- @@ -60,21 +59,21 @@ int(0) --- testing: -9223372036854775808 - 0 --- int(-9223372036854775808) --- testing: -9223372036854775808 - 1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775808 - -1 --- int(-9223372036854775807) --- testing: -9223372036854775808 - 7 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775808 - 9 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775808 - 65 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775808 - -44 --- int(-9223372036854775764) --- testing: -9223372036854775808 - 2147483647 --- -float(-9.2233720390023E+18) +float(-9.22337203900226E+18) --- testing: -9223372036854775808 - 9223372036854775807 --- -float(-1.844674407371E+19) +float(-1.8446744073709552E+19) --- testing: 2147483647 - 0 --- int(2147483647) --- testing: 2147483647 - 1 --- @@ -110,7 +109,7 @@ int(-2147483604) --- testing: -2147483648 - 2147483647 --- int(-4294967295) --- testing: -2147483648 - 9223372036854775807 --- -float(-9.2233720390023E+18) +float(-9.22337203900226E+18) --- testing: 9223372034707292160 - 0 --- int(9223372034707292160) --- testing: 9223372034707292160 - 1 --- @@ -146,7 +145,7 @@ int(-9223372034707292116) --- testing: -9223372034707292160 - 2147483647 --- int(-9223372036854775807) --- testing: -9223372034707292160 - 9223372036854775807 --- -float(-1.8446744071562E+19) +float(-1.8446744071562068E+19) --- testing: 2147483648 - 0 --- int(2147483648) --- testing: 2147483648 - 1 --- @@ -182,7 +181,7 @@ int(-2147483605) --- testing: -2147483649 - 2147483647 --- int(-4294967296) --- testing: -2147483649 - 9223372036854775807 --- -float(-9.2233720390023E+18) +float(-9.22337203900226E+18) --- testing: 4294967294 - 0 --- int(4294967294) --- testing: 4294967294 - 1 --- @@ -250,27 +249,27 @@ int(9223372036854775797) --- testing: 9223372036854775806 - 65 --- int(9223372036854775741) --- testing: 9223372036854775806 - -44 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9223372036854775806 - 2147483647 --- int(9223372034707292159) --- testing: 9223372036854775806 - 9223372036854775807 --- int(-1) --- testing: 9.2233720368548E+18 - 0 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 - 1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 - -1 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 - 7 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 - 9 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 - 65 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 - -44 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9.2233720368548E+18 - 2147483647 --- -float(9.2233720347073E+18) +float(9.223372034707292E+18) --- testing: 9.2233720368548E+18 - 9223372036854775807 --- float(0) --- testing: -9223372036854775807 - 0 --- @@ -280,39 +279,39 @@ int(-9223372036854775808) --- testing: -9223372036854775807 - -1 --- int(-9223372036854775806) --- testing: -9223372036854775807 - 7 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775807 - 9 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775807 - 65 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9223372036854775807 - -44 --- int(-9223372036854775763) --- testing: -9223372036854775807 - 2147483647 --- -float(-9.2233720390023E+18) +float(-9.22337203900226E+18) --- testing: -9223372036854775807 - 9223372036854775807 --- -float(-1.844674407371E+19) +float(-1.8446744073709552E+19) --- testing: -9.2233720368548E+18 - 0 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 - 1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 - -1 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 - 7 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 - 9 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 - 65 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 - -44 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -9.2233720368548E+18 - 2147483647 --- -float(-9.2233720390023E+18) +float(-9.22337203900226E+18) --- testing: -9.2233720368548E+18 - 9223372036854775807 --- -float(-1.844674407371E+19) +float(-1.8446744073709552E+19) --- testing: 0 - 9223372036854775807 --- int(-9223372036854775807) --- testing: 0 - -9223372036854775808 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 0 - 2147483647 --- int(-2147483647) --- testing: 0 - -2147483648 --- @@ -334,15 +333,15 @@ int(-4294967293) --- testing: 0 - 9223372036854775806 --- int(-9223372036854775806) --- testing: 0 - 9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 0 - -9223372036854775807 --- int(9223372036854775807) --- testing: 0 - -9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 1 - 9223372036854775807 --- int(-9223372036854775806) --- testing: 1 - -9223372036854775808 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 1 - 2147483647 --- int(-2147483646) --- testing: 1 - -2147483648 --- @@ -364,11 +363,11 @@ int(-4294967292) --- testing: 1 - 9223372036854775806 --- int(-9223372036854775805) --- testing: 1 - 9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 1 - -9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 1 - -9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -1 - 9223372036854775807 --- int(-9223372036854775808) --- testing: -1 - -9223372036854775808 --- @@ -394,15 +393,15 @@ int(-4294967294) --- testing: -1 - 9223372036854775806 --- int(-9223372036854775807) --- testing: -1 - 9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -1 - -9223372036854775807 --- int(9223372036854775806) --- testing: -1 - -9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 7 - 9223372036854775807 --- int(-9223372036854775800) --- testing: 7 - -9223372036854775808 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 7 - 2147483647 --- int(-2147483640) --- testing: 7 - -2147483648 --- @@ -424,15 +423,15 @@ int(-4294967286) --- testing: 7 - 9223372036854775806 --- int(-9223372036854775799) --- testing: 7 - 9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 7 - -9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 7 - -9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9 - 9223372036854775807 --- int(-9223372036854775798) --- testing: 9 - -9223372036854775808 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9 - 2147483647 --- int(-2147483638) --- testing: 9 - -2147483648 --- @@ -454,15 +453,15 @@ int(-4294967284) --- testing: 9 - 9223372036854775806 --- int(-9223372036854775797) --- testing: 9 - 9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 9 - -9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 9 - -9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 65 - 9223372036854775807 --- int(-9223372036854775742) --- testing: 65 - -9223372036854775808 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 65 - 2147483647 --- int(-2147483582) --- testing: 65 - -2147483648 --- @@ -484,13 +483,13 @@ int(-4294967228) --- testing: 65 - 9223372036854775806 --- int(-9223372036854775741) --- testing: 65 - 9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: 65 - -9223372036854775807 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 65 - -9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: -44 - 9223372036854775807 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -44 - -9223372036854775808 --- int(9223372036854775764) --- testing: -44 - 2147483647 --- @@ -512,17 +511,17 @@ int(-4294967339) --- testing: -44 - 4294967293 --- int(-4294967337) --- testing: -44 - 9223372036854775806 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -44 - 9.2233720368548E+18 --- -float(-9.2233720368548E+18) +float(-9.223372036854776E+18) --- testing: -44 - -9223372036854775807 --- int(9223372036854775763) --- testing: -44 - -9.2233720368548E+18 --- -float(9.2233720368548E+18) +float(9.223372036854776E+18) --- testing: 2147483647 - 9223372036854775807 --- int(-9223372034707292160) --- testing: 2147483647 - -9223372036854775808 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 2147483647 - 2147483647 --- int(0) --- testing: 2147483647 - -2147483648 --- @@ -544,27 +543,27 @@ int(-2147483646) --- testing: 2147483647 - 9223372036854775806 --- int(-9223372034707292159) --- testing: 2147483647 - 9.2233720368548E+18 --- -float(-9.2233720347073E+18) +float(-9.223372034707292E+18) --- testing: 2147483647 - -9223372036854775807 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 2147483647 - -9.2233720368548E+18 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 9223372036854775807 - 9223372036854775807 --- int(0) --- testing: 9223372036854775807 - -9223372036854775808 --- -float(1.844674407371E+19) +float(1.8446744073709552E+19) --- testing: 9223372036854775807 - 2147483647 --- int(9223372034707292160) --- testing: 9223372036854775807 - -2147483648 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 9223372036854775807 - 9223372034707292160 --- int(2147483647) --- testing: 9223372036854775807 - -9223372034707292160 --- -float(1.8446744071562E+19) +float(1.8446744071562068E+19) --- testing: 9223372036854775807 - 2147483648 --- int(9223372034707292159) --- testing: 9223372036854775807 - -2147483649 --- -float(9.2233720390023E+18) +float(9.22337203900226E+18) --- testing: 9223372036854775807 - 4294967294 --- int(9223372032559808513) --- testing: 9223372036854775807 - 4294967295 --- @@ -576,7 +575,6 @@ int(1) --- testing: 9223372036854775807 - 9.2233720368548E+18 --- float(0) --- testing: 9223372036854775807 - -9223372036854775807 --- -float(1.844674407371E+19) +float(1.8446744073709552E+19) --- testing: 9223372036854775807 - -9.2233720368548E+18 --- -float(1.844674407371E+19) -===DONE=== +float(1.8446744073709552E+19) diff --git a/tests/lang/operators/subtract_variationStr.phpt b/tests/lang/operators/subtract_variationStr.phpt index 393b172fb1..6df852498d 100644 --- a/tests/lang/operators/subtract_variationStr.phpt +++ b/tests/lang/operators/subtract_variationStr.phpt @@ -11,15 +11,17 @@ $strVals = array( error_reporting(E_ERROR); foreach ($strVals as $strVal) { - foreach($strVals as $otherVal) { - echo "--- testing: '$strVal' - '$otherVal' ---\n"; - var_dump($strVal-$otherVal); - } + foreach($strVals as $otherVal) { + echo "--- testing: '$strVal' - '$otherVal' ---\n"; + try { + var_dump($strVal-$otherVal); + } catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; + } + } } - ?> -===DONE=== --EXPECT-- --- testing: '0' - '0' --- int(0) @@ -32,7 +34,7 @@ float(-1.2) --- testing: '0' - '-7.7' --- float(7.7) --- testing: '0' - 'abc' --- -int(0) +Unsupported operand types: string - string --- testing: '0' - '123abc' --- int(-123) --- testing: '0' - '123e5' --- @@ -48,7 +50,7 @@ int(-123) --- testing: '0' - '3.4a' --- float(-3.4) --- testing: '0' - 'a5.9' --- -int(0) +Unsupported operand types: string - string --- testing: '65' - '0' --- int(65) --- testing: '65' - '65' --- @@ -60,7 +62,7 @@ float(63.8) --- testing: '65' - '-7.7' --- float(72.7) --- testing: '65' - 'abc' --- -int(65) +Unsupported operand types: string - string --- testing: '65' - '123abc' --- int(-58) --- testing: '65' - '123e5' --- @@ -76,7 +78,7 @@ int(-58) --- testing: '65' - '3.4a' --- float(61.6) --- testing: '65' - 'a5.9' --- -int(65) +Unsupported operand types: string - string --- testing: '-44' - '0' --- int(-44) --- testing: '-44' - '65' --- @@ -88,7 +90,7 @@ float(-45.2) --- testing: '-44' - '-7.7' --- float(-36.3) --- testing: '-44' - 'abc' --- -int(-44) +Unsupported operand types: string - string --- testing: '-44' - '123abc' --- int(-167) --- testing: '-44' - '123e5' --- @@ -104,7 +106,7 @@ int(-167) --- testing: '-44' - '3.4a' --- float(-47.4) --- testing: '-44' - 'a5.9' --- -int(-44) +Unsupported operand types: string - string --- testing: '1.2' - '0' --- float(1.2) --- testing: '1.2' - '65' --- @@ -116,7 +118,7 @@ float(0) --- testing: '1.2' - '-7.7' --- float(8.9) --- testing: '1.2' - 'abc' --- -float(1.2) +Unsupported operand types: string - string --- testing: '1.2' - '123abc' --- float(-121.8) --- testing: '1.2' - '123e5' --- @@ -132,7 +134,7 @@ float(-121.8) --- testing: '1.2' - '3.4a' --- float(-2.2) --- testing: '1.2' - 'a5.9' --- -float(1.2) +Unsupported operand types: string - string --- testing: '-7.7' - '0' --- float(-7.7) --- testing: '-7.7' - '65' --- @@ -144,7 +146,7 @@ float(-8.9) --- testing: '-7.7' - '-7.7' --- float(0) --- testing: '-7.7' - 'abc' --- -float(-7.7) +Unsupported operand types: string - string --- testing: '-7.7' - '123abc' --- float(-130.7) --- testing: '-7.7' - '123e5' --- @@ -160,35 +162,35 @@ float(-130.7) --- testing: '-7.7' - '3.4a' --- float(-11.1) --- testing: '-7.7' - 'a5.9' --- -float(-7.7) +Unsupported operand types: string - string --- testing: 'abc' - '0' --- -int(0) +Unsupported operand types: string - string --- testing: 'abc' - '65' --- -int(-65) +Unsupported operand types: string - string --- testing: 'abc' - '-44' --- -int(44) +Unsupported operand types: string - string --- testing: 'abc' - '1.2' --- -float(-1.2) +Unsupported operand types: string - string --- testing: 'abc' - '-7.7' --- -float(7.7) +Unsupported operand types: string - string --- testing: 'abc' - 'abc' --- -int(0) +Unsupported operand types: string - string --- testing: 'abc' - '123abc' --- -int(-123) +Unsupported operand types: string - string --- testing: 'abc' - '123e5' --- -float(-12300000) +Unsupported operand types: string - string --- testing: 'abc' - '123e5xyz' --- -float(-12300000) +Unsupported operand types: string - string --- testing: 'abc' - ' 123abc' --- -int(-123) +Unsupported operand types: string - string --- testing: 'abc' - '123 abc' --- -int(-123) +Unsupported operand types: string - string --- testing: 'abc' - '123abc ' --- -int(-123) +Unsupported operand types: string - string --- testing: 'abc' - '3.4a' --- -float(-3.4) +Unsupported operand types: string - string --- testing: 'abc' - 'a5.9' --- -int(0) +Unsupported operand types: string - string --- testing: '123abc' - '0' --- int(123) --- testing: '123abc' - '65' --- @@ -200,7 +202,7 @@ float(121.8) --- testing: '123abc' - '-7.7' --- float(130.7) --- testing: '123abc' - 'abc' --- -int(123) +Unsupported operand types: string - string --- testing: '123abc' - '123abc' --- int(0) --- testing: '123abc' - '123e5' --- @@ -216,7 +218,7 @@ int(0) --- testing: '123abc' - '3.4a' --- float(119.6) --- testing: '123abc' - 'a5.9' --- -int(123) +Unsupported operand types: string - string --- testing: '123e5' - '0' --- float(12300000) --- testing: '123e5' - '65' --- @@ -228,7 +230,7 @@ float(12299998.8) --- testing: '123e5' - '-7.7' --- float(12300007.7) --- testing: '123e5' - 'abc' --- -float(12300000) +Unsupported operand types: string - string --- testing: '123e5' - '123abc' --- float(12299877) --- testing: '123e5' - '123e5' --- @@ -244,7 +246,7 @@ float(12299877) --- testing: '123e5' - '3.4a' --- float(12299996.6) --- testing: '123e5' - 'a5.9' --- -float(12300000) +Unsupported operand types: string - string --- testing: '123e5xyz' - '0' --- float(12300000) --- testing: '123e5xyz' - '65' --- @@ -256,7 +258,7 @@ float(12299998.8) --- testing: '123e5xyz' - '-7.7' --- float(12300007.7) --- testing: '123e5xyz' - 'abc' --- -float(12300000) +Unsupported operand types: string - string --- testing: '123e5xyz' - '123abc' --- float(12299877) --- testing: '123e5xyz' - '123e5' --- @@ -272,7 +274,7 @@ float(12299877) --- testing: '123e5xyz' - '3.4a' --- float(12299996.6) --- testing: '123e5xyz' - 'a5.9' --- -float(12300000) +Unsupported operand types: string - string --- testing: ' 123abc' - '0' --- int(123) --- testing: ' 123abc' - '65' --- @@ -284,7 +286,7 @@ float(121.8) --- testing: ' 123abc' - '-7.7' --- float(130.7) --- testing: ' 123abc' - 'abc' --- -int(123) +Unsupported operand types: string - string --- testing: ' 123abc' - '123abc' --- int(0) --- testing: ' 123abc' - '123e5' --- @@ -300,7 +302,7 @@ int(0) --- testing: ' 123abc' - '3.4a' --- float(119.6) --- testing: ' 123abc' - 'a5.9' --- -int(123) +Unsupported operand types: string - string --- testing: '123 abc' - '0' --- int(123) --- testing: '123 abc' - '65' --- @@ -312,7 +314,7 @@ float(121.8) --- testing: '123 abc' - '-7.7' --- float(130.7) --- testing: '123 abc' - 'abc' --- -int(123) +Unsupported operand types: string - string --- testing: '123 abc' - '123abc' --- int(0) --- testing: '123 abc' - '123e5' --- @@ -328,7 +330,7 @@ int(0) --- testing: '123 abc' - '3.4a' --- float(119.6) --- testing: '123 abc' - 'a5.9' --- -int(123) +Unsupported operand types: string - string --- testing: '123abc ' - '0' --- int(123) --- testing: '123abc ' - '65' --- @@ -340,7 +342,7 @@ float(121.8) --- testing: '123abc ' - '-7.7' --- float(130.7) --- testing: '123abc ' - 'abc' --- -int(123) +Unsupported operand types: string - string --- testing: '123abc ' - '123abc' --- int(0) --- testing: '123abc ' - '123e5' --- @@ -356,7 +358,7 @@ int(0) --- testing: '123abc ' - '3.4a' --- float(119.6) --- testing: '123abc ' - 'a5.9' --- -int(123) +Unsupported operand types: string - string --- testing: '3.4a' - '0' --- float(3.4) --- testing: '3.4a' - '65' --- @@ -368,7 +370,7 @@ float(2.2) --- testing: '3.4a' - '-7.7' --- float(11.1) --- testing: '3.4a' - 'abc' --- -float(3.4) +Unsupported operand types: string - string --- testing: '3.4a' - '123abc' --- float(-119.6) --- testing: '3.4a' - '123e5' --- @@ -384,33 +386,32 @@ float(-119.6) --- testing: '3.4a' - '3.4a' --- float(0) --- testing: '3.4a' - 'a5.9' --- -float(3.4) +Unsupported operand types: string - string --- testing: 'a5.9' - '0' --- -int(0) +Unsupported operand types: string - string --- testing: 'a5.9' - '65' --- -int(-65) +Unsupported operand types: string - string --- testing: 'a5.9' - '-44' --- -int(44) +Unsupported operand types: string - string --- testing: 'a5.9' - '1.2' --- -float(-1.2) +Unsupported operand types: string - string --- testing: 'a5.9' - '-7.7' --- -float(7.7) +Unsupported operand types: string - string --- testing: 'a5.9' - 'abc' --- -int(0) +Unsupported operand types: string - string --- testing: 'a5.9' - '123abc' --- -int(-123) +Unsupported operand types: string - string --- testing: 'a5.9' - '123e5' --- -float(-12300000) +Unsupported operand types: string - string --- testing: 'a5.9' - '123e5xyz' --- -float(-12300000) +Unsupported operand types: string - string --- testing: 'a5.9' - ' 123abc' --- -int(-123) +Unsupported operand types: string - string --- testing: 'a5.9' - '123 abc' --- -int(-123) +Unsupported operand types: string - string --- testing: 'a5.9' - '123abc ' --- -int(-123) +Unsupported operand types: string - string --- testing: 'a5.9' - '3.4a' --- -float(-3.4) +Unsupported operand types: string - string --- testing: 'a5.9' - 'a5.9' --- -int(0) -===DONE=== +Unsupported operand types: string - string 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..fbb6bd2a6c 100644 --- a/tests/lang/passByReference_002.phpt +++ b/tests/lang/passByReference_002.phpt @@ -5,11 +5,14 @@ Attempt to pass a constant by reference function f(&$arg1) { - var_dump($arg1++); + var_dump($arg1++); } f(2); ?> --EXPECTF-- -Fatal error: Only variables can be passed by reference in %s on line 8 +Fatal error: Uncaught Error: f(): Argument #1 ($arg1) cannot be passed by reference in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d diff --git a/tests/lang/passByReference_003.phpt b/tests/lang/passByReference_003.phpt index ad9e1e39de..11c3e32c50 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"; @@ -25,16 +25,16 @@ var_dump($undef2) --EXPECTF-- Passing undefined by value -Notice: Undefined variable: undef1 in %s on line %d +Warning: Undefined variable $undef1 in %s on line %d -Notice: Trying to access array offset on value of type null in %s on line %d +Warning: Trying to access array offset on value of type null in %s on line %d Inside passbyVal call: NULL After call -Notice: Undefined variable: undef1 in %s on line %d +Warning: Undefined variable $undef1 in %s on line %d NULL Passing undefined by reference 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_005.phpt b/tests/lang/passByReference_005.phpt index dc32962d67..72a42e550d 100644 --- a/tests/lang/passByReference_005.phpt +++ b/tests/lang/passByReference_005.phpt @@ -4,70 +4,95 @@ Pass uninitialised variables by reference and by value to test implicit initiali <?php function v($val) { - $val = "Val changed"; + $val = "Val changed"; } function r(&$ref) { - $ref = "Ref changed"; + $ref = "Ref changed"; } - function vv($val1, $val2) { - $val1 = "Val1 changed"; - $val2 = "Val2 changed"; + $val1 = "Val1 changed"; + $val2 = "Val2 changed"; } function vr($val, &$ref) { - $val = "Val changed"; - $ref = "Ref changed"; + $val = "Val changed"; + $ref = "Ref changed"; } function rv(&$ref, $val) { - $val = "Val changed"; - $ref = "Ref changed"; + $val = "Val changed"; + $ref = "Ref changed"; } function rr(&$ref1, &$ref2) { - $ref1 = "Ref1 changed"; - $ref2 = "Ref2 changed"; + $ref1 = "Ref1 changed"; + $ref2 = "Ref2 changed"; } class C { - - function __construct($val, &$ref) { - $val = "Val changed"; - $ref = "Ref changed"; - } - - function v($val) { - $val = "Val changed"; - } - - function r(&$ref) { - $ref = "Ref changed"; - } - - function vv($val1, $val2) { - $val1 = "Val1 changed"; - $val2 = "Val2 changed"; - } - - function vr($val, &$ref) { - $val = "Val changed"; - $ref = "Ref changed"; - } - - function rv(&$ref, $val) { - $val = "Val changed"; - $ref = "Ref changed"; - } - - function rr(&$ref1, &$ref2) { - $ref1 = "Ref1 changed"; - $ref2 = "Ref2 changed"; - } - + function __construct($val, &$ref) { + $val = "Val changed"; + $ref = "Ref changed"; + } + + function v($val) { + $val = "Val changed"; + } + + function r(&$ref) { + $ref = "Ref changed"; + } + + function vv($val1, $val2) { + $val1 = "Val1 changed"; + $val2 = "Val2 changed"; + } + + function vr($val, &$ref) { + $val = "Val changed"; + $ref = "Ref changed"; + } + + function rv(&$ref, $val) { + $val = "Val changed"; + $ref = "Ref changed"; + } + + function rr(&$ref1, &$ref2) { + $ref1 = "Ref1 changed"; + $ref2 = "Ref2 changed"; + } + + static function static_v($val) { + $val = "Val changed"; + } + + static function static_r(&$ref) { + $ref = "Ref changed"; + } + + static function static_vv($val1, $val2) { + $val1 = "Val1 changed"; + $val2 = "Val2 changed"; + } + + static function static_vr($val, &$ref) { + $val = "Val changed"; + $ref = "Ref changed"; + } + + static function static_rv(&$ref, $val) { + $val = "Val changed"; + $ref = "Ref changed"; + } + + static function static_rr(&$ref1, &$ref2) { + $ref1 = "Ref1 changed"; + $ref2 = "Ref2 changed"; + } } echo "\n ---- Pass by ref / pass by val: functions ----\n"; @@ -95,24 +120,24 @@ var_dump($u1, $u2); echo "\n\n ---- Pass by ref / pass by val: static method calls ----\n"; unset($u1, $u2); -C::v($u1); -C::r($u2); +C::static_v($u1); +C::static_r($u2); var_dump($u1, $u2); unset($u1, $u2); -C::vv($u1, $u2); +C::static_vv($u1, $u2); var_dump($u1, $u2); unset($u1, $u2); -C::vr($u1, $u2); +C::static_vr($u1, $u2); var_dump($u1, $u2); unset($u1, $u2); -C::rv($u1, $u2); +C::static_rv($u1, $u2); var_dump($u1, $u2); unset($u1, $u2); -C::rr($u1, $u2); +C::static_rr($u1, $u2); var_dump($u1, $u2); echo "\n\n ---- Pass by ref / pass by val: instance method calls ----\n"; @@ -145,31 +170,31 @@ var_dump($u1, $u2); --EXPECTF-- ---- Pass by ref / pass by val: functions ---- -Notice: Undefined variable: u1 in %s on line 72 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u1 in %s on line 74 +Warning: Undefined variable $u1 in %s on line %d NULL string(11) "Ref changed" -Notice: Undefined variable: u1 in %s on line 77 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u2 in %s on line 77 +Warning: Undefined variable $u2 in %s on line %d -Notice: Undefined variable: u1 in %s on line 78 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u2 in %s on line 78 +Warning: Undefined variable $u2 in %s on line %d NULL NULL -Notice: Undefined variable: u1 in %s on line 81 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u1 in %s on line 82 +Warning: Undefined variable $u1 in %s on line %d NULL string(11) "Ref changed" -Notice: Undefined variable: u2 in %s on line 85 +Warning: Undefined variable $u2 in %s on line %d -Notice: Undefined variable: u2 in %s on line 86 +Warning: Undefined variable $u2 in %s on line %d string(11) "Ref changed" NULL string(12) "Ref1 changed" @@ -178,82 +203,70 @@ string(12) "Ref2 changed" ---- Pass by ref / pass by val: static method calls ---- -Deprecated: Non-static method C::v() should not be called statically in %s on line 95 - -Notice: Undefined variable: u1 in %s on line 95 +Warning: Undefined variable $u1 in %s on line %d -Deprecated: Non-static method C::r() should not be called statically in %s on line 96 - -Notice: Undefined variable: u1 in %s on line 97 +Warning: Undefined variable $u1 in %s on line %d NULL string(11) "Ref changed" -Deprecated: Non-static method C::vv() should not be called statically in %s on line 100 - -Notice: Undefined variable: u1 in %s on line 100 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u2 in %s on line 100 +Warning: Undefined variable $u2 in %s on line %d -Notice: Undefined variable: u1 in %s on line 101 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u2 in %s on line 101 +Warning: Undefined variable $u2 in %s on line %d NULL NULL -Deprecated: Non-static method C::vr() should not be called statically in %s on line 104 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u1 in %s on line 104 - -Notice: Undefined variable: u1 in %s on line 105 +Warning: Undefined variable $u1 in %s on line %d NULL string(11) "Ref changed" -Deprecated: Non-static method C::rv() should not be called statically in %s on line 108 - -Notice: Undefined variable: u2 in %s on line 108 +Warning: Undefined variable $u2 in %s on line %d -Notice: Undefined variable: u2 in %s on line 109 +Warning: Undefined variable $u2 in %s on line %d string(11) "Ref changed" NULL - -Deprecated: Non-static method C::rr() should not be called statically in %s on line 112 string(12) "Ref1 changed" string(12) "Ref2 changed" ---- Pass by ref / pass by val: instance method calls ---- -Notice: Undefined variable: u1 in %s on line 117 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u1 in %s on line 118 +Warning: Undefined variable $u1 in %s on line %d NULL string(11) "Ref changed" -Notice: Undefined variable: u1 in %s on line 121 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u1 in %s on line 123 +Warning: Undefined variable $u1 in %s on line %d NULL string(11) "Ref changed" -Notice: Undefined variable: u1 in %s on line 126 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u2 in %s on line 126 +Warning: Undefined variable $u2 in %s on line %d -Notice: Undefined variable: u1 in %s on line 127 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u2 in %s on line 127 +Warning: Undefined variable $u2 in %s on line %d NULL NULL -Notice: Undefined variable: u1 in %s on line 130 +Warning: Undefined variable $u1 in %s on line %d -Notice: Undefined variable: u1 in %s on line 131 +Warning: Undefined variable $u1 in %s on line %d NULL string(11) "Ref changed" -Notice: Undefined variable: u2 in %s on line 134 +Warning: Undefined variable $u2 in %s on line %d -Notice: Undefined variable: u2 in %s on line 135 +Warning: Undefined variable $u2 in %s on line %d string(11) "Ref changed" NULL string(12) "Ref1 changed" diff --git a/tests/lang/passByReference_006.phpt b/tests/lang/passByReference_006.phpt index c1478663ca..4c098acff3 100644 --- a/tests/lang/passByReference_006.phpt +++ b/tests/lang/passByReference_006.phpt @@ -3,70 +3,54 @@ Pass uninitialised objects and arrays by reference to test implicit initialisati --FILE-- <?php -function refs(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) { +function refs(&$ref1, &$ref2) { $ref1 = "Ref1 changed"; $ref2 = "Ref2 changed"; - $ref3 = "Ref3 changed"; - $ref4 = "Ref4 changed"; - $ref5 = "Ref5 changed"; } class C { - function __construct(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) { - $ref1 = "Ref1 changed"; - $ref2 = "Ref2 changed"; - $ref3 = "Ref3 changed"; - $ref4 = "Ref4 changed"; - $ref5 = "Ref5 changed"; - } - - function refs(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) { - $ref1 = "Ref1 changed"; - $ref2 = "Ref2 changed"; - $ref3 = "Ref3 changed"; - $ref4 = "Ref4 changed"; - $ref5 = "Ref5 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"; + } } echo "\n ---- Pass uninitialised array & object by ref: function call ---\n"; -unset($u1, $u2, $u3, $u4, $u5); -refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); -var_dump($u1, $u2, $u3, $u4, $u5); +unset($u1, $u2); +refs($u1[0], $u2[0][1]); +var_dump($u1, $u2); echo "\n ---- Pass uninitialised arrays & objects by ref: static method call ---\n"; -unset($u1, $u2, $u3, $u4, $u5); -C::refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); -var_dump($u1, $u2, $u3, $u4, $u5); +unset($u1, $u2); +C::static_refs($u1[0], $u2[0][1]); +var_dump($u1, $u2); echo "\n\n---- Pass uninitialised arrays & objects by ref: constructor ---\n"; -unset($u1, $u2, $u3, $u4, $u5); -$c = new C($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); -var_dump($u1, $u2, $u3, $u4, $u5); +unset($u1, $u2); +$c = new C($u1[0], $u2[0][1]); +var_dump($u1, $u2); echo "\n ---- Pass uninitialised arrays & objects by ref: instance method call ---\n"; -unset($u1, $u2, $u3, $u4, $u5); -$c->refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); -var_dump($u1, $u2, $u3, $u4, $u5); +unset($u1, $u2); +$c->refs($u1[0], $u2[0][1]); +var_dump($u1, $u2); ?> ---EXPECTF-- - ---- Pass uninitialised array & object by ref: function call --- - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d +--EXPECT-- +---- Pass uninitialised array & object by ref: function call --- array(1) { [0]=> string(12) "Ref1 changed" @@ -78,43 +62,8 @@ array(1) { string(12) "Ref2 changed" } } -object(stdClass)#%d (1) { - ["a"]=> - string(12) "Ref3 changed" -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - string(12) "Ref4 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - object(stdClass)#%d (1) { - ["c"]=> - string(12) "Ref5 changed" - } - } -} ---- Pass uninitialised arrays & objects by ref: static method call --- - -Deprecated: Non-static method C::refs() should not be called statically in %s on line 39 - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d array(1) { [0]=> string(12) "Ref1 changed" @@ -126,42 +75,9 @@ array(1) { string(12) "Ref2 changed" } } -object(stdClass)#%d (1) { - ["a"]=> - string(12) "Ref3 changed" -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - string(12) "Ref4 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - object(stdClass)#%d (1) { - ["c"]=> - string(12) "Ref5 changed" - } - } -} ---- Pass uninitialised arrays & objects by ref: constructor --- - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d array(1) { [0]=> string(12) "Ref1 changed" @@ -173,41 +89,8 @@ array(1) { string(12) "Ref2 changed" } } -object(stdClass)#%d (1) { - ["a"]=> - string(12) "Ref3 changed" -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - string(12) "Ref4 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - object(stdClass)#%d (1) { - ["c"]=> - string(12) "Ref5 changed" - } - } -} ---- Pass uninitialised arrays & objects by ref: instance method call --- - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d - -Warning: Creating default object from empty value in %spassByReference_006.php on line %d array(1) { [0]=> string(12) "Ref1 changed" @@ -219,24 +102,3 @@ array(1) { string(12) "Ref2 changed" } } -object(stdClass)#%d (1) { - ["a"]=> - string(12) "Ref3 changed" -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - string(12) "Ref4 changed" - } -} -object(stdClass)#%d (1) { - ["a"]=> - object(stdClass)#%d (1) { - ["b"]=> - object(stdClass)#%d (1) { - ["c"]=> - string(12) "Ref5 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/passByReference_009.phpt b/tests/lang/passByReference_009.phpt index 7b723d552e..d51cf9a2cb 100644 --- a/tests/lang/passByReference_009.phpt +++ b/tests/lang/passByReference_009.phpt @@ -1,5 +1,5 @@ --TEST-- -Assignement as argument +Assignment as argument --FILE-- <?php function foo(&$x, &$y) { $x = 1; echo $y ; } diff --git a/tests/lang/passByReference_010.phpt b/tests/lang/passByReference_010.phpt index f996073c0f..d6709ff84e 100644 --- a/tests/lang/passByReference_010.phpt +++ b/tests/lang/passByReference_010.phpt @@ -9,42 +9,52 @@ function f(&$a) { } echo "\n\n---> Pass constant assignment by reference:\n"; -f($a="a.original"); -var_dump($a); +try { + f($a="a.original"); + var_dump($a); +} catch (Throwable $e) { + echo "Exception: " . $e->getMessage() ."\n"; +} echo "\n\n---> Pass variable assignment by reference:\n"; -unset($a); -$a = "a.original"; -f($b = $a); -var_dump($a); +try { + unset($a); + $a = "a.original"; + f($b = $a); + var_dump($a); +} catch (Throwable $e) { + echo "Exception: " . $e->getMessage() ."\n"; +} echo "\n\n---> Pass reference assignment by reference:\n"; -unset($a, $b); -$a = "a.original"; -f($b =& $a); -var_dump($a); +try { + unset($a, $b); + $a = "a.original"; + f($b =& $a); + var_dump($a); +} catch (Throwable $e) { + echo "Exception: " . $e->getMessage() ."\n"; +} echo "\n\n---> Pass concat assignment by reference:\n"; -unset($a, $b); -$b = "b.original"; -$a = "a.original"; -f($b .= $a); -var_dump($a); +try { + unset($a, $b); + $b = "b.original"; + $a = "a.original"; + f($b .= $a); + var_dump($a); +} catch (Throwable $e) { + echo "Exception: " . $e->getMessage() ."\n"; +} ?> ---EXPECTF-- +--EXPECT-- ---> Pass constant assignment by reference: - -Notice: Only variables should be passed by reference in %s on line 9 -string(10) "a.original" -string(10) "a.original" +Exception: f(): Argument #1 ($a) cannot be passed by reference ---> Pass variable assignment by reference: - -Notice: Only variables should be passed by reference in %s on line 15 -string(10) "a.original" -string(10) "a.original" +Exception: f(): Argument #1 ($a) cannot be passed by reference ---> Pass reference assignment by reference: @@ -53,7 +63,4 @@ string(9) "a.changed" ---> Pass concat assignment by reference: - -Notice: Only variables should be passed by reference in %s on line 28 -string(20) "b.originala.original" -string(10) "a.original" +Exception: f(): Argument #1 ($a) cannot be passed by reference diff --git a/tests/lang/passByReference_012.phpt b/tests/lang/passByReference_012.phpt index 3bc60a484e..cbc9dcf8f9 100644 --- a/tests/lang/passByReference_012.phpt +++ b/tests/lang/passByReference_012.phpt @@ -13,11 +13,9 @@ $original = array ( array ( 'one' )); $stack = $original; var_dump(array_shift(array_shift($stack))); ?> -===DONE=== --EXPECTF-- Notice: Only variables should be passed by reference in %s on line %d string(3) "two" Notice: Only variables should be passed by reference in %s on line %d string(3) "one" -===DONE=== 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..3dc0aaa106 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"; @@ -28,6 +28,7 @@ var_dump (testReturnVarByRef()); echo "\n---> 2. Return a value by reference -> Warning:\n"; var_dump (testReturnValByRef()); +?> --EXPECTF-- ---> 1. Return a variable by reference -> No warning: int(1) diff --git a/tests/lang/short_tags.004.phpt b/tests/lang/short_tags.004.phpt index 6df8af1c2a..4111475e5e 100644 --- a/tests/lang/short_tags.004.phpt +++ b/tests/lang/short_tags.004.phpt @@ -29,6 +29,6 @@ This gets echoed twice <? $b=3; ?> -Notice: Undefined variable: b in %s on line %d +Warning: Undefined variable $b in %s on line %d -Notice: Undefined variable: b in %s on line %d +Warning: Undefined variable $b in %s on line %d 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/string/unicode_escape.phpt b/tests/lang/string/unicode_escape.phpt index 1092cee533..e6e63ea0d8 100644 --- a/tests/lang/string/unicode_escape.phpt +++ b/tests/lang/string/unicode_escape.phpt @@ -9,6 +9,7 @@ var_dump("\u{ff}"); // case-insensitive var_dump("\u{2603}"); // Unicode snowman var_dump("\u{1F602}"); // FACE WITH TEARS OF JOY emoji var_dump("\u{0000001F602}"); // Leading zeroes permitted +?> --EXPECT-- string(1) "a" string(2) "ÿ" diff --git a/tests/lang/string/unicode_escape_empty.phpt b/tests/lang/string/unicode_escape_empty.phpt index 0d975ef86a..f50330f679 100644 --- a/tests/lang/string/unicode_escape_empty.phpt +++ b/tests/lang/string/unicode_escape_empty.phpt @@ -4,5 +4,6 @@ Invalid Unicode escape sequence: Empty <?php var_dump("\u{}"); +?> --EXPECTF-- Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d diff --git a/tests/lang/string/unicode_escape_incomplete.phpt b/tests/lang/string/unicode_escape_incomplete.phpt index 169e6a278c..5746f86e69 100644 --- a/tests/lang/string/unicode_escape_incomplete.phpt +++ b/tests/lang/string/unicode_escape_incomplete.phpt @@ -4,5 +4,6 @@ Invalid Unicode escape sequence: Incomplete <?php var_dump("\u{blah"); +?> --EXPECTF-- Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d diff --git a/tests/lang/string/unicode_escape_large_codepoint.phpt b/tests/lang/string/unicode_escape_large_codepoint.phpt index 249e6e152a..9f13186e29 100644 --- a/tests/lang/string/unicode_escape_large_codepoint.phpt +++ b/tests/lang/string/unicode_escape_large_codepoint.phpt @@ -4,5 +4,6 @@ Invalid Unicode escape sequence: Large codepoint <?php var_dump("\u{110000}"); // U+10FFFF + 1 +?> --EXPECTF-- Parse error: Invalid UTF-8 codepoint escape sequence: Codepoint too large in %s on line %d diff --git a/tests/lang/string/unicode_escape_legacy.phpt b/tests/lang/string/unicode_escape_legacy.phpt index c5cac68669..6f7c2bf708 100644 --- a/tests/lang/string/unicode_escape_legacy.phpt +++ b/tests/lang/string/unicode_escape_legacy.phpt @@ -7,6 +7,7 @@ Tolerated Unicode escape sequences: Legacy compatibility var_dump("\u"); var_dump("\u202e"); var_dump("\ufoobar"); +?> --EXPECT-- string(2) "\u" string(6) "\u202e" diff --git a/tests/lang/string/unicode_escape_sign.phpt b/tests/lang/string/unicode_escape_sign.phpt index 4f3ef7c72b..07fe0d2e20 100644 --- a/tests/lang/string/unicode_escape_sign.phpt +++ b/tests/lang/string/unicode_escape_sign.phpt @@ -4,5 +4,6 @@ Invalid Unicode escape sequence: Positive sign <?php var_dump("\u{+1F602}"); +?> --EXPECTF-- Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d diff --git a/tests/lang/string/unicode_escape_sign2.phpt b/tests/lang/string/unicode_escape_sign2.phpt index daf34b3ab6..53544dedf0 100644 --- a/tests/lang/string/unicode_escape_sign2.phpt +++ b/tests/lang/string/unicode_escape_sign2.phpt @@ -4,5 +4,6 @@ Invalid Unicode escape sequence: Negative sign <?php var_dump("\u{-1F602}"); +?> --EXPECTF-- Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d diff --git a/tests/lang/string/unicode_escape_surrogates.phpt b/tests/lang/string/unicode_escape_surrogates.phpt index 09e525ad12..8ca46c8f98 100644 --- a/tests/lang/string/unicode_escape_surrogates.phpt +++ b/tests/lang/string/unicode_escape_surrogates.phpt @@ -9,6 +9,7 @@ Valid Unicode escape sequences: Surrogate halves var_dump(bin2hex("\u{D801}")); var_dump(bin2hex("\u{DC00}")); var_dump(bin2hex("\u{D801}\u{DC00}")); // CESU-8 encoding of U+10400 +?> --EXPECT-- string(6) "eda081" string(6) "edb080" diff --git a/tests/lang/string/unicode_escape_whitespace.phpt b/tests/lang/string/unicode_escape_whitespace.phpt index 11fa690210..61235042d0 100644 --- a/tests/lang/string/unicode_escape_whitespace.phpt +++ b/tests/lang/string/unicode_escape_whitespace.phpt @@ -4,5 +4,6 @@ Invalid Unicode escape sequence: Whitespace <?php var_dump("\u{1F602 }"); +?> --EXPECTF-- Parse error: Invalid UTF-8 codepoint escape sequence in %s on line %d diff --git a/tests/lang/string_decimals_001.phpt b/tests/lang/string_decimals_001.phpt index 2bd3ef62a2..2d01fce6a5 100644 --- a/tests/lang/string_decimals_001.phpt +++ b/tests/lang/string_decimals_001.phpt @@ -15,7 +15,6 @@ test("9.."); test("9.9."); test("9.9.9"); ?> -===DONE=== --EXPECT-- --> Testing ..9: int(0) @@ -25,7 +24,7 @@ bool(false) --> Testing .9.: int(0) float(0.9) -bool(true) +bool(false) --> Testing 9..: int(9) @@ -41,4 +40,3 @@ bool(true) int(9) float(9.9) bool(true) -===DONE=== diff --git a/tests/lang/syntax_errors.phpt b/tests/lang/syntax_errors.phpt new file mode 100644 index 0000000000..1b52c31c6a --- /dev/null +++ b/tests/lang/syntax_errors.phpt @@ -0,0 +1,57 @@ +--TEST-- +Detailed reporting on specific types of syntax errors +--FILE-- +<?php +$badCode = [ + "if(1 > 2", /* unclosed ( */ + "[1, 2,", /* unclosed [ */ + "if(1) { echo 'hello'; ", /* unclosed { */ + "(1 + 2));", /* too many ) */ + "[1, 2]]", /* too many ] */ + "if (1) { } }", /* too many } */ + "(1 + 2];", /* ] doesn't match ( */ + "[1, 2)];", /* ) doesn't match [ */ + "if(1) { echo 'a'; )}", /* ) doesn't match { */ + /* separately test cases where the faulty construct spans multiple lines, + since the error message should refer to the starting line in those cases */ + "if(1 > 2) {\n echo '1';", /* unclosed (, spans multiple lines */ + "[1,\n2,\n3,", /* unclosed [, spans multiple lines */ + "{\n echo '1';\n echo '2';", /* unclosed {, spans multiple lines */ + "(1 +\n 2 +\n 3))", /* too many ), spans multiple lines */ + "[1,\n2,\n3]];", /* too many ], spans multiple lines */ + "if (1)\n {\n }}", /* too many }, spans multiple lines */ + "(1 +\n\n 2])", /* ] doesn't match (, spans multiple lines */ + "[1,\n2,\n3)]", /* ) doesn't match [, spans multiple lines */ + "if(1) {\n echo 'a';\n)}", /* ) doesn't match {, spans multiple lines */ + ]; + +foreach ($badCode as $code) { + try { + eval($code); + } catch (ParseError $e) { + echo $e->getMessage(), "\n"; + } +} + +echo "==DONE==\n"; +?> +--EXPECT-- +Unclosed '(' +Unclosed '[' +Unclosed '{' +Unmatched ')' +Unmatched ']' +Unmatched '}' +Unclosed '(' does not match ']' +Unclosed '[' does not match ')' +Unclosed '{' does not match ')' +Unclosed '{' on line 1 +Unclosed '[' on line 1 +Unclosed '{' on line 1 +Unmatched ')' +Unmatched ']' +Unmatched '}' +Unclosed '(' on line 1 does not match ']' +Unclosed '[' on line 1 does not match ')' +Unclosed '{' on line 1 does not match ')' +==DONE== diff --git a/tests/lang/this_assignment.phpt b/tests/lang/this_assignment.phpt index a7c76174a5..995c326d4f 100644 --- a/tests/lang/this_assignment.phpt +++ b/tests/lang/this_assignment.phpt @@ -37,7 +37,5 @@ $b->who(); echo "\n"; ?> -===DONE=== --EXPECT-- firstfirstfirstfirstsecondsecondsecondsecondsecond -===DONE=== 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_001.phpt b/tests/lang/type_hints_001.phpt index f82a53fe75..293b469cd2 100644 --- a/tests/lang/type_hints_001.phpt +++ b/tests/lang/type_hints_001.phpt @@ -20,7 +20,7 @@ type_hint_foo($bar); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Argument 1 passed to type_hint_foo() must be an instance of Foo, instance of Bar given, called in %s on line 16 and defined in %s:9 +Fatal error: Uncaught TypeError: type_hint_foo(): Argument #1 ($a) must be of type Foo, Bar given, called in %s on line 16 and defined in %s:9 Stack trace: #0 %s(%d): type_hint_foo(Object(Bar)) #1 {main} 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 f6b04dabff..1a90940f42 100644 --- a/tests/lang/type_hints_003.phpt +++ b/tests/lang/type_hints_003.phpt @@ -3,9 +3,9 @@ ZE2 type --FILE-- <?php class T { - function f(P $p = 42) { - } + function f(P $p = 42) { + } } ?> --EXPECTF-- -Fatal error: Default value for parameters with a class type can only be NULL in %stype_hints_003.php on line 3 +Fatal error: Cannot use int as default value for parameter $p of type P in %s on line %d diff --git a/tests/lang/zend_throw_exception_001.phpt b/tests/lang/zend_throw_exception_001.phpt new file mode 100644 index 0000000000..c8d3603e72 --- /dev/null +++ b/tests/lang/zend_throw_exception_001.phpt @@ -0,0 +1,14 @@ +--TEST-- +zend_throw_exception with NULL message +--FILE-- +<?php +assert_options(ASSERT_EXCEPTION, true); +try { + $assert = 'assert'; + $assert(false); +} catch (AssertionError $assertionError) { + echo 'Done' . PHP_EOL; +} +?> +--EXPECT-- +Done diff --git a/tests/output/bug46897.phpt b/tests/output/bug46897.phpt index 8fe80bcb65..0e77938e47 100644 --- a/tests/output/bug46897.phpt +++ b/tests/output/bug46897.phpt @@ -18,10 +18,10 @@ echo 'Done'; ?> --EXPECTF-- [callback:1]Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line %d +Notice: ob_flush(): Failed to flush buffer of callback (0) in %s on line %d bool(false) string(%d) "Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line %d +Notice: ob_flush(): Failed to flush buffer of callback (0) in %s on line %d bool(false) " Done diff --git a/tests/output/bug60282.phpt b/tests/output/bug60282.phpt index 08bcc0f201..ffa28d18a4 100644 --- a/tests/output/bug60282.phpt +++ b/tests/output/bug60282.phpt @@ -8,5 +8,6 @@ ob_start(); ob_start(); ob_start('ob_gzhandler'); echo "done"; +?> --EXPECT-- done diff --git a/tests/output/bug60321.phpt b/tests/output/bug60321.phpt index e9c109dbf7..4ec6990cca 100644 --- a/tests/output/bug60321.phpt +++ b/tests/output/bug60321.phpt @@ -4,6 +4,7 @@ Bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty) <?php $return = ob_get_status(true); var_dump($return); +?> --EXPECT-- array(0) { } diff --git a/tests/output/bug60322.phpt b/tests/output/bug60322.phpt index f4d7139458..9628558d3a 100644 --- a/tests/output/bug60322.phpt +++ b/tests/output/bug60322.phpt @@ -7,5 +7,6 @@ output_buffering=128 ob_start(); while(@ob_end_clean()); var_dump(ob_get_clean()); +?> --EXPECT-- bool(false) 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/bug74815.phpt b/tests/output/bug74815.phpt deleted file mode 100644 index 1d9c825999..0000000000 --- a/tests/output/bug74815.phpt +++ /dev/null @@ -1,19 +0,0 @@ ---TEST-- -Bug #74815 crash with a combination of INI entries at startup ---FILE-- -<?php - -$php = getenv("TEST_PHP_EXECUTABLE"); - -echo shell_exec("$php -n -d error_log=".__DIR__."/error_log.tmp -d error_reporting=E_ALL -d log_errors=On -d track_errors=On -v"); - -?> -==DONE== ---CLEAN-- -<?php -unlink(__DIR__.'/error_log.tmp'); -?> ---EXPECTF-- -Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0 -%A -==DONE== diff --git a/tests/output/bug75236.phpt b/tests/output/bug75236.phpt index f6c7a51aa3..bee4732cb2 100644 --- a/tests/output/bug75236.phpt +++ b/tests/output/bug75236.phpt @@ -14,5 +14,5 @@ Bug #75236: infinite loop when printing an error-message --EXPECTF-- before getfilecontent <br /> -<b>Warning</b>: file_get_contents(no/suchfile): failed to open stream: No such file or directory in <b>%s</b> on line <b>7</b><br /> +<b>Warning</b>: file_get_contents(no/suchfile): Failed to open stream: No such file or directory in <b>%s</b> on line <b>7</b><br /> after getfilecontent diff --git a/tests/output/flush_basic_001.phpt b/tests/output/flush_basic_001.phpt index fb1ce2c208..266cda1e24 100644 --- a/tests/output/flush_basic_001.phpt +++ b/tests/output/flush_basic_001.phpt @@ -3,7 +3,6 @@ Test basic functionality of flush() --FILE-- <?php /* - * proto void flush(void) * Function is implemented in ext/standard/basic_functions.c. */ 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..f188071939 100644 --- a/tests/output/ob_011.phpt +++ b/tests/output/ob_011.phpt @@ -1,10 +1,16 @@ --TEST-- output buffering - fatalism +--SKIPIF-- +<?php +if (PHP_OS_FAMILY === 'Windows' && ini_get('opcache.jit') && ini_get('opcache.jit_buffer_size') && !PHP_DEBUG) { + die('xfail crashes on Windows with JITted release builds'); +} +?> --FILE-- <?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_014.phpt b/tests/output/ob_014.phpt index 09534270f3..0893db5d25 100644 --- a/tests/output/ob_014.phpt +++ b/tests/output/ob_014.phpt @@ -4,19 +4,12 @@ output buffering - failure <?php ob_start("str_rot13"); echo "foo\n"; -// str_rot13 expects 1 param and returns NULL when passed 2 params. -// It is invoked with 2 params when used as an OB callback. -// Therefore, there will be no data in the buffer. This is expected: see bug 46900. -ob_end_flush(); - -// Show the error. -print_r(error_get_last()); +try { + ob_end_flush(); +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ?> ---EXPECTF-- -Array -( - [type] => 2 - [message] => str_rot13() expects exactly 1 parameter, 2 given - [file] => %s - [line] => 7 -) +--EXPECT-- +foo +str_rot13() expects exactly 1 argument, 2 given diff --git a/tests/output/ob_015.phpt b/tests/output/ob_015.phpt index 2acdb40d0a..47c9b24be1 100644 --- a/tests/output/ob_015.phpt +++ b/tests/output/ob_015.phpt @@ -3,20 +3,13 @@ output buffering - failure --FILE-- <?php ob_start("str_rot13", 1); -echo "foo\n"; -// str_rot13 expects 1 param and returns NULL when passed 2 params. -// It is invoked with 2 params when used as an OB callback. -// Therefore, there will be no data in the buffer. This is expected: see bug 46900. +try { + echo "foo\n"; +} catch (TypeError $e) { + echo $e->getMessage(), "\n"; +} ob_end_flush(); - -// Show the error. -print_r(error_get_last()); ?> ---EXPECTF-- -Array -( - [type] => 2 - [message] => str_rot13() expects exactly 1 parameter, 2 given - [file] => %s - [line] => 7 -) +--EXPECT-- +foo +str_rot13() expects exactly 1 argument, 2 given diff --git a/tests/output/ob_017.phpt b/tests/output/ob_017.phpt index 1dc5fc59be..a214d40f18 100644 --- a/tests/output/ob_017.phpt +++ b/tests/output/ob_017.phpt @@ -1,14 +1,14 @@ --TEST-- -output buffering - stati +output buffering - statuses --INI-- opcache.optimization_level=0 --FILE-- <?php -$stati = array(); +$statuses = array(); function oh($str, $flags) { - global $stati; - $stati[] = "$flags: $str"; - return $str; + global $statuses; + $statuses[] = "$flags: $str"; + return $str; } ob_start("oh", 3); echo "yes"; @@ -19,7 +19,7 @@ ob_clean(); echo "yes!\n"; echo "no"; ob_end_clean(); -print_r($stati); +print_r($statuses); ?> --EXPECT-- yes! diff --git a/tests/output/ob_clean_basic_001.phpt b/tests/output/ob_clean_basic_001.phpt index bd91676b12..c247fd12f7 100644 --- a/tests/output/ob_clean_basic_001.phpt +++ b/tests/output/ob_clean_basic_001.phpt @@ -2,12 +2,6 @@ Test ob_clean() function : basic functionality --FILE-- <?php -/* Prototype : proto bool ob_clean(void) - * Description: Clean (delete) the current output buffer - * Source code: main/output.c - * Alias to functions: - */ - echo "*** Testing ob_clean() : basic functionality ***\n"; // Zero arguments @@ -29,7 +23,7 @@ echo "Done"; -- Testing ob_clean() function with Zero arguments -- -Notice: ob_clean(): failed to delete buffer. No buffer to delete in %s on line 12 +Notice: ob_clean(): Failed to delete buffer. No buffer to delete in %s on line %d bool(false) string(61) "bool(true) Ensure the buffer is still active after the clean." diff --git a/tests/output/ob_end_clean_basic_001.phpt b/tests/output/ob_end_clean_basic_001.phpt index 6824857675..e3432a2243 100644 --- a/tests/output/ob_end_clean_basic_001.phpt +++ b/tests/output/ob_end_clean_basic_001.phpt @@ -3,7 +3,6 @@ Test return type and value, as well as basic behaviour, for ob_end_clean() --FILE-- <?php /* - * proto bool ob_end_clean(void) * Function is implemented in main/output.c */ @@ -20,10 +19,10 @@ var_dump(ob_end_clean()); ?> --EXPECTF-- -Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in %s on line 7 +Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in %s on line %d bool(false) bool(true) bool(true) -Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in %s on line 16 +Notice: ob_end_clean(): Failed to delete buffer. No buffer to delete in %s on line %d bool(false) diff --git a/tests/output/ob_end_flush_basic_001.phpt b/tests/output/ob_end_flush_basic_001.phpt index 811d6a0761..1a2e7f63a3 100644 --- a/tests/output/ob_end_flush_basic_001.phpt +++ b/tests/output/ob_end_flush_basic_001.phpt @@ -2,12 +2,6 @@ Test ob_end_flush() function : basic functionality --FILE-- <?php -/* Prototype : proto bool ob_end_flush(void) - * Description: Flush (send) the output buffer, and delete current output buffer - * Source code: main/output.c - * Alias to functions: - */ - echo "*** Testing ob_end_flush() : basic functionality ***\n"; // Zero arguments @@ -30,12 +24,12 @@ echo "Done"; -- Testing ob_end_flush() function with Zero arguments -- -Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %s on line 12 +Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %s on line %d bool(false) bool(true) Hello bool(true) -Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %s on line 21 +Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %s on line %d bool(false) Done diff --git a/tests/output/ob_flush_basic_001.phpt b/tests/output/ob_flush_basic_001.phpt index e53c7e5a23..e26f69f1a4 100644 --- a/tests/output/ob_flush_basic_001.phpt +++ b/tests/output/ob_flush_basic_001.phpt @@ -2,12 +2,6 @@ Test ob_flush() function : basic functionality --FILE-- <?php -/* Prototype : proto bool ob_flush(void) - * Description: Flush (send) contents of the output buffer. The last buffer content is sent to next buffer - * Source code: main/output.c - * Alias to functions: - */ - echo "*** Testing ob_flush() : basic functionality ***\n"; // Zero arguments @@ -30,7 +24,7 @@ echo "Done"; -- Testing ob_flush() function with Zero arguments -- -Notice: ob_flush(): failed to flush buffer. No buffer to flush in %s on line 12 +Notice: ob_flush(): Failed to flush buffer. No buffer to flush in %s on line %d bool(false) This should get flushed. bool(true) diff --git a/tests/output/ob_get_clean_basic_001.phpt b/tests/output/ob_get_clean_basic_001.phpt index 2ccf490485..c545dcbd14 100644 --- a/tests/output/ob_get_clean_basic_001.phpt +++ b/tests/output/ob_get_clean_basic_001.phpt @@ -3,7 +3,6 @@ Test return type and value, as well as basic behaviour, of ob_get_clean() --FILE-- <?php /* - * proto bool ob_get_clean(void) * Function is implemented in main/output.c */ diff --git a/tests/output/ob_get_clean_basic_002.phpt b/tests/output/ob_get_clean_basic_002.phpt index 9b74438594..30e2adcfab 100644 --- a/tests/output/ob_get_clean_basic_002.phpt +++ b/tests/output/ob_get_clean_basic_002.phpt @@ -3,7 +3,6 @@ Test basic behaviour of ob_get_clean() --FILE-- <?php /* - * proto bool ob_get_clean(void) * Function is implemented in main/output.c */ diff --git a/tests/output/ob_get_contents_basic_001.phpt b/tests/output/ob_get_contents_basic_001.phpt index 3f24ea04f6..21c7d3c83a 100644 --- a/tests/output/ob_get_contents_basic_001.phpt +++ b/tests/output/ob_get_contents_basic_001.phpt @@ -4,13 +4,6 @@ Test ob_get_contents() function : basic functionality Iain Lewis <ilewis@php.net> --FILE-- <?php -/* Prototype : proto string ob_get_contents(void) - * Description: Return the contents of the output buffer - * Source code: main/output.c - * Alias to functions: - */ - - echo "*** Testing ob_get_contents() : basic functionality ***\n"; // Zero arguments diff --git a/tests/output/ob_get_length_basic_001.phpt b/tests/output/ob_get_length_basic_001.phpt index 892d106719..9895d3d806 100644 --- a/tests/output/ob_get_length_basic_001.phpt +++ b/tests/output/ob_get_length_basic_001.phpt @@ -3,7 +3,6 @@ Test return type and value, as well as basic behaviour, of ob_get_length() --FILE-- <?php /* - * proto int ob_get_length(void) * Function is implemented in main/output.c */ diff --git a/tests/output/ob_get_level_basic_001.phpt b/tests/output/ob_get_level_basic_001.phpt index 4a6c84785b..3c95d3661a 100644 --- a/tests/output/ob_get_level_basic_001.phpt +++ b/tests/output/ob_get_level_basic_001.phpt @@ -2,12 +2,6 @@ Test ob_get_level() function : basic functionality --FILE-- <?php -/* Prototype : proto int ob_get_level(void) - * Description: Return the nesting level of the output buffer - * Source code: main/output.c - * Alias to functions: - */ - echo "*** Testing ob_get_level() : basic functionality ***\n"; // Zero arguments @@ -42,6 +36,6 @@ int(2) int(1) int(0) -Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %s on line 26 +Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %s on line %d int(0) Done diff --git a/tests/output/ob_implicit_flush_basic_001.phpt b/tests/output/ob_implicit_flush_basic_001.phpt index 780eb6dfbb..a5370eda52 100644 --- a/tests/output/ob_implicit_flush_basic_001.phpt +++ b/tests/output/ob_implicit_flush_basic_001.phpt @@ -2,12 +2,6 @@ Test ob_implicit_flush() function : check return value (always null). --FILE-- <?php -/* Prototype : proto void ob_implicit_flush([int flag]) - * Description: Turn implicit flush on/off and is equivalent to calling flush() after every output call - * Source code: main/output.c - * Alias to functions: - */ - echo "*** Testing ob_implicit_flush() : check return value ***\n"; var_dump(ob_implicit_flush()); diff --git a/tests/output/ob_implicit_flush_basic_002.phpt b/tests/output/ob_implicit_flush_basic_002.phpt index 37d10ba640..3e46d8f810 100644 --- a/tests/output/ob_implicit_flush_basic_002.phpt +++ b/tests/output/ob_implicit_flush_basic_002.phpt @@ -2,12 +2,6 @@ Test ob_implicit_flush() function : ensure implicit flushing does not apply to user buffers. --FILE-- <?php -/* Prototype : proto void ob_implicit_flush([int flag]) - * Description: Turn implicit flush on/off and is equivalent to calling flush() after every output call - * Source code: main/output.c - * Alias to functions: - */ - echo "*** Testing ob_implicit_flush() : ensure implicit flushing does not apply to user buffers. ***\n"; // Start a user buffer diff --git a/tests/output/ob_start_basic_001.phpt b/tests/output/ob_start_basic_001.phpt index 0b06f6077f..8d9b3be2ac 100644 --- a/tests/output/ob_start_basic_001.phpt +++ b/tests/output/ob_start_basic_001.phpt @@ -3,7 +3,6 @@ Test return type and value for ob_start() --FILE-- <?php /* - * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ diff --git a/tests/output/ob_start_basic_002.phpt b/tests/output/ob_start_basic_002.phpt index 2412ae57f0..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: @@ -35,7 +35,6 @@ foreach ($callbacks as $callback) { } ?> -==DONE== --EXPECT-- --> Use callback 'return_empty_string': @@ -52,4 +51,3 @@ I stole your output. --> Use callback 'return_zero': 0 -==DONE== 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..41edb01eb9 100644 --- a/tests/output/ob_start_basic_004.phpt +++ b/tests/output/ob_start_basic_004.phpt @@ -5,15 +5,14 @@ opcache.optimization_level=0 --FILE-- <?php /* - * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ // 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 7cab6ed35f..d13c27c4af 100644 --- a/tests/output/ob_start_basic_005.phpt +++ b/tests/output/ob_start_basic_005.phpt @@ -3,14 +3,13 @@ ob_start(): non-static method as static callbacks. --FILE-- <?php /* - * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ Class C { - function h($string) { - return $string; - } + function h($string) { + return $string; + } } function checkAndClean() { @@ -25,9 +24,10 @@ checkAndClean(); ?> --EXPECTF-- -Warning: ob_start(): non-static method C::h() should not be called statically in %s on line 20 -bool(true) +Warning: ob_start(): non-static method C::h() cannot be called statically in %s on line %d + +Notice: ob_start(): Failed to create buffer in %s on line %d +bool(false) Array ( - [0] => C::h ) diff --git a/tests/output/ob_start_basic_006.phpt b/tests/output/ob_start_basic_006.phpt index d4d0fcc149..30b086c63d 100644 --- a/tests/output/ob_start_basic_006.phpt +++ b/tests/output/ob_start_basic_006.phpt @@ -3,37 +3,36 @@ ob_start(): ensure multiple buffer initialization with a single call using array --FILE-- <?php /* - * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ 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() { @@ -43,7 +42,7 @@ function checkAndClean() { } } -echo "\n ---> Test arrays: \n"; +echo "\n ---> Test arrays:\n"; var_dump(ob_start(array("f"))); checkAndClean(); @@ -72,43 +71,43 @@ var_dump(ob_start(array('f', 'C::g', array(array($c, "g"), array($c, "h"))))); checkAndClean(); ?> --EXPECTF-- - ---> Test arrays: +---> Test arrays: -Warning: ob_start(): array must have exactly two members in %s on line 44 +Warning: ob_start(): array must have exactly two members in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 44 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) Array ( ) -Warning: ob_start(): class 'f' not found in %s on line 47 +Warning: ob_start(): class "f" not found in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 47 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) Array ( ) -Warning: ob_start(): array must have exactly two members in %s on line 50 +Warning: ob_start(): array must have exactly two members in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 50 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) Array ( ) -Warning: ob_start(): array must have exactly two members in %s on line 53 +Warning: ob_start(): array must have exactly two members in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 53 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) Array ( ) -Warning: ob_start(): array must have exactly two members in %s on line 56 +Warning: ob_start(): array must have exactly two members in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 56 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) Array ( @@ -126,9 +125,9 @@ Array ) -Warning: ob_start(): array must have exactly two members in %s on line 68 +Warning: ob_start(): array must have exactly two members in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 68 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) Array ( diff --git a/tests/output/ob_start_basic_unerasable_001.phpt b/tests/output/ob_start_basic_unerasable_001.phpt index e97fd45420..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); @@ -14,9 +14,7 @@ echo "This call will obtain the content:\n"; $str = ob_get_contents(); var_dump($str); ?> -==DONE== --EXPECT-- [callback:1]This call will obtain the content: string(35) "This call will obtain the content: " -==DONE== diff --git a/tests/output/ob_start_basic_unerasable_002.phpt b/tests/output/ob_start_basic_unerasable_002.phpt index 4fc1f53635..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); @@ -21,13 +21,13 @@ var_dump(ob_get_level()); --EXPECTF-- [callback:1]All of the following calls will fail to clean/remove the topmost buffer: -Notice: ob_clean(): failed to delete buffer of callback (0) in %s on line 11 +Notice: ob_clean(): Failed to delete buffer of callback (0) in %s on line 11 bool(false) -Notice: ob_end_clean(): failed to discard buffer of callback (0) in %s on line 12 +Notice: ob_end_clean(): Failed to discard buffer of callback (0) in %s on line 12 bool(false) -Notice: ob_end_flush(): failed to send buffer of callback (0) in %s on line 13 +Notice: ob_end_flush(): Failed to send buffer of callback (0) in %s on line 13 bool(false) The OB nesting will still be 1 level deep: int(1) diff --git a/tests/output/ob_start_basic_unerasable_003.phpt b/tests/output/ob_start_basic_unerasable_003.phpt index 9c09bd5e5f..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); @@ -16,7 +16,7 @@ var_dump($str); ?> --EXPECTF-- [callback:1]This call will obtain the content, but will not clean the buffer. -Notice: ob_get_clean(): failed to discard buffer of callback (0) in %s on line 11 +Notice: ob_get_clean(): Failed to discard buffer of callback (0) in %s on line 11 -Notice: ob_get_clean(): failed to delete buffer of callback (0) in %s on line 11 +Notice: ob_get_clean(): Failed to delete buffer of callback (0) in %s on line 11 string(65) "This call will obtain the content, but will not clean the buffer." diff --git a/tests/output/ob_start_basic_unerasable_004.phpt b/tests/output/ob_start_basic_unerasable_004.phpt index 02308b3ef4..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); @@ -16,7 +16,7 @@ var_dump($str); ?> --EXPECTF-- [callback:1]This call will obtain the content, but will not flush the buffer. -Notice: ob_get_flush(): failed to send buffer of callback (0) in %s on line 11 +Notice: ob_get_flush(): Failed to send buffer of callback (0) in %s on line 11 -Notice: ob_get_flush(): failed to delete buffer of callback (0) in %s on line 11 +Notice: ob_get_flush(): Failed to delete buffer of callback (0) in %s on line 11 string(65) "This call will obtain the content, but will not flush the buffer." diff --git a/tests/output/ob_start_basic_unerasable_005.phpt b/tests/output/ob_start_basic_unerasable_005.phpt index 2c52f00c24..7f99b72dd1 100644 --- a/tests/output/ob_start_basic_unerasable_005.phpt +++ b/tests/output/ob_start_basic_unerasable_005.phpt @@ -3,23 +3,23 @@ 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); -echo "Attempt to flush unerasable buffer - should fail... "; +echo "Attempt to flush unerasable buffer - should fail..."; var_dump(ob_flush()); // Check content of buffer after flush - if flush failed it should still contain the string above. var_dump(ob_get_contents()); ?> --EXPECTF-- -[callback:1]Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line 11 +[callback:1]Attempt to flush unerasable buffer - should fail... +Notice: ob_flush(): Failed to flush buffer of callback (0) in %s on line 11 bool(false) -string(%d) "Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line 11 +string(%d) "Attempt to flush unerasable buffer - should fail... +Notice: ob_flush(): Failed to flush buffer of callback (0) in %s on line 11 bool(false) " diff --git a/tests/output/ob_start_callbacks.phpt b/tests/output/ob_start_callbacks.phpt index 6815bccd63..4d56375895 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,12 +26,13 @@ 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); echo 'function via variable', "\n"; ob_end_flush(); +?> --EXPECT-- CLOSURE IN VARIABLE OBJECT IN VARIABLE diff --git a/tests/output/ob_start_error_001.phpt b/tests/output/ob_start_error_001.phpt index 29288e2028..98c348fe4a 100644 --- a/tests/output/ob_start_error_001.phpt +++ b/tests/output/ob_start_error_001.phpt @@ -3,12 +3,11 @@ Test wrong number of arguments and wrong arg types for ob_start() --FILE-- <?php /* - * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ function justPrint($str) { - return $str; + return $str; } $arg_1 = "justPrint"; @@ -16,38 +15,14 @@ $arg_2 = 0; $arg_3 = false; $extra_arg = 1; -echo "\n- Too many arguments\n"; -var_dump(ob_start($arg_1, $arg_2, $arg_3, $extra_arg)); - -echo "\n- Arg 1 wrong type\n"; +echo "\nArg 1 wrong type\n"; var_dump(ob_start(1.5)); -echo "\n- Arg 2 wrong type\n"; -var_dump(ob_start("justPrint", "this should be an int")); - -echo "\n- Arg 3 wrong type\n"; -var_dump(ob_start("justPrint", 0, "this should be a bool")); - ?> --EXPECTF-- -- Too many arguments - -Warning: ob_start() expects at most 3 parameters, 4 given in %s on line 17 -NULL - -- Arg 1 wrong type +Arg 1 wrong type -Warning: ob_start(): no array or string given in %s on line 20 +Warning: ob_start(): no array or string given in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 20 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) - -- Arg 2 wrong type - -Warning: ob_start() expects parameter 2 to be int, string given in %s on line 23 -NULL - -- Arg 3 wrong type - -Warning: ob_start() expects parameter 3 to be int, string given in %s on line 26 -NULL diff --git a/tests/output/ob_start_error_002.phpt b/tests/output/ob_start_error_002.phpt index 7cac3ee4b3..2366c8da34 100644 --- a/tests/output/ob_start_error_002.phpt +++ b/tests/output/ob_start_error_002.phpt @@ -3,14 +3,13 @@ Test wrong number of arguments and wrong arg types for ob_start() --FILE-- <?php /* - * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ Class C { - static function f($str) { - return $str; - } + static function f($str) { + return $str; + } } var_dump(ob_start(array("nonExistent","f"))); @@ -20,23 +19,23 @@ var_dump(ob_start("no")); echo "done" ?> --EXPECTF-- -Warning: ob_start(): class 'nonExistent' not found in %s on line 13 +Warning: ob_start(): class "nonExistent" not found in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 13 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) -Warning: ob_start(): class 'C' does not have a method 'nonExistent' in %s on line 14 +Warning: ob_start(): class C does not have a method "nonExistent" in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 14 +Notice: ob_start(): Failed to create buffer in %s on line 13 bool(false) -Warning: ob_start(): class 'C' does not have a method 'no' in %s on line 15 +Warning: ob_start(): class C does not have a method "no" in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 15 +Notice: ob_start(): Failed to create buffer in %s on line 14 bool(false) -Warning: ob_start(): function 'no' not found or invalid function name in %s on line 16 +Warning: ob_start(): function "no" not found or invalid function name in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 16 +Notice: ob_start(): Failed to create buffer in %s on line 15 bool(false) done diff --git a/tests/output/ob_start_error_003.phpt b/tests/output/ob_start_error_003.phpt index 3af56f7a2b..70e86e3728 100644 --- a/tests/output/ob_start_error_003.phpt +++ b/tests/output/ob_start_error_003.phpt @@ -3,7 +3,6 @@ Test ob_start() with object supplied but no method. --FILE-- <?php /* - * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ @@ -17,6 +16,6 @@ echo "done" --EXPECTF-- Warning: ob_start(): array must have exactly two members in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 11 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) done diff --git a/tests/output/ob_start_error_004.phpt b/tests/output/ob_start_error_004.phpt index 83f5dc8d1c..c549292e88 100644 --- a/tests/output/ob_start_error_004.phpt +++ b/tests/output/ob_start_error_004.phpt @@ -3,7 +3,6 @@ Test ob_start() with non existent callback method. --FILE-- <?php /* - * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ @@ -15,8 +14,8 @@ var_dump(ob_start(array($c, 'f'))); echo "done" ?> --EXPECTF-- -Warning: ob_start(): class 'C' does not have a method 'f' in %s on line %d +Warning: ob_start(): class C does not have a method "f" in %s on line %d -Notice: ob_start(): failed to create buffer in %s on line 11 +Notice: ob_start(): Failed to create buffer in %s on line %d bool(false) done diff --git a/tests/output/ob_start_error_005.phpt b/tests/output/ob_start_error_005.phpt index d6f9dc4c10..2930a04748 100644 --- a/tests/output/ob_start_error_005.phpt +++ b/tests/output/ob_start_error_005.phpt @@ -4,15 +4,14 @@ ob_start(): ensure buffers can't be added from within callback. <?php /* - * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ function f($str) { - ob_start(); - echo "hello"; - ob_end_flush(); - return $str; + ob_start(); + echo "hello"; + ob_end_flush(); + return $str; } @@ -20,4 +19,4 @@ var_dump(ob_start('f')); echo "done"; ?> --EXPECTF-- -Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line 9 +Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line %d diff --git a/tests/output/sapi_windows_vt100_support.inc b/tests/output/sapi_windows_vt100_support.inc index 9ac54cea61..a9c60a6be9 100644 --- a/tests/output/sapi_windows_vt100_support.inc +++ b/tests/output/sapi_windows_vt100_support.inc @@ -35,7 +35,6 @@ function testToStdOut() 'STDERR (constant)' => STDERR, 'STDERR (fopen)' => fopen('php://stderr', 'wb'), 'STDERR (php://fd/2)' => fopen('php://fd/2', 'wb'), - 'Not a stream' => 'foo', 'Invalid stream (php://temp)' => fopen('php://temp', 'wb'), 'Invalid stream (php://input)' => fopen('php://input', 'wb'), 'Invalid stream (php://memory)' => fopen('php://memory', 'wb'), diff --git a/tests/output/sapi_windows_vt100_support_winko_err.phpt b/tests/output/sapi_windows_vt100_support_winko_err.phpt index 07c6355dab..21be3b76a9 100644 --- a/tests/output/sapi_windows_vt100_support_winko_err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDERR --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) >= 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(false) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value :bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_in-err.phpt b/tests/output/sapi_windows_vt100_support_winko_in-err.phpt index ef2f573584..94e692d01f 100644 --- a/tests/output/sapi_windows_vt100_support_winko_in-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_in-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/ --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) >= 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(false) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt b/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt index 600c92e704..11caa432d1 100644 --- a/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/ --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) >= 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(false) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_in-out.phpt b/tests/output/sapi_windows_vt100_support_winko_in-out.phpt index 727d053579..fc0429c4b0 100644 --- a/tests/output/sapi_windows_vt100_support_winko_in-out.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_in-out.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/ --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) >= 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(true) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_out-err.phpt b/tests/output/sapi_windows_vt100_support_winko_out-err.phpt index 6448651f71..ee34be988b 100644 --- a/tests/output/sapi_windows_vt100_support_winko_out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_out-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDOUT --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) >= 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(false) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_out.phpt b/tests/output/sapi_windows_vt100_support_winko_out.phpt index ce111741c0..3241ba352a 100644 --- a/tests/output/sapi_windows_vt100_support_winko_out.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_out.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDOUT --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) >= 0) { - echo "skip Only for Windows systems < 10.0.10586"; + echo "skip Only for Windows systems < 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(true) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_err.phpt b/tests/output/sapi_windows_vt100_support_winok_err.phpt index 9354df4f94..4d7543fdda 100644 --- a/tests/output/sapi_windows_vt100_support_winok_err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDERR --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) < 0) { - echo "skip Only for Windows systems >= 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(false) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_in-err.phpt b/tests/output/sapi_windows_vt100_support_winok_in-err.phpt index 0be05527a9..e08d558e25 100644 --- a/tests/output/sapi_windows_vt100_support_winok_in-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_in-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/ --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) < 0) { - echo "skip Only for Windows systems >= 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(false) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt b/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt index e497c5f55a..285a72f936 100644 --- a/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/ --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) < 0) { - echo "skip Only for Windows systems >= 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(false) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_in-out.phpt b/tests/output/sapi_windows_vt100_support_winok_in-out.phpt index 363e3ae0fa..a84b365347 100644 --- a/tests/output/sapi_windows_vt100_support_winok_in-out.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_in-out.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/ --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) < 0) { - echo "skip Only for Windows systems >= 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(true) - disabling VT100: bool(true) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_out-err.phpt b/tests/output/sapi_windows_vt100_support_winok_out-err.phpt index 8bd6ee6bdd..f3f49aa618 100644 --- a/tests/output/sapi_windows_vt100_support_winok_out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_out-err.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDOUT --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) < 0) { - echo "skip Only for Windows systems >= 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(false) - disabling VT100: bool(false) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_out.phpt b/tests/output/sapi_windows_vt100_support_winok_out.phpt index c649764c4c..7fc5ae142b 100644 --- a/tests/output/sapi_windows_vt100_support_winok_out.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_out.phpt @@ -3,15 +3,15 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDOUT --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, - '10.0.10586' + '10.0.10586' ) < 0) { - echo "skip Only for Windows systems >= 10.0.10586"; + echo "skip Only for Windows systems >= 10.0.10586"; } ?> --CAPTURE_STDIO-- @@ -76,70 +76,36 @@ STDERR (php://fd/2): - current value : bool(true) - disabling VT100: bool(true) - current value : bool(false) -Not a stream: -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://input): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) Invalid stream (php://memory): -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) +- current value : bool(false) - enabling VT100 : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) - disabling VT100: -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +Warning: sapi_windows_vt100_support(): not able to analyze the specified stream in %s on line %d bool(false) +- current value : bool(false) File stream: - current value : bool(false) - enabling VT100 : bool(false) diff --git a/tests/output/stream_isatty.inc b/tests/output/stream_isatty.inc index 4b7f39986f..9700fd98f1 100644 --- a/tests/output/stream_isatty.inc +++ b/tests/output/stream_isatty.inc @@ -12,7 +12,6 @@ function testToStdOut() 'STDERR (constant)' => STDERR, 'STDERR (fopen)' => fopen('php://stderr', 'wb'), 'STDERR (php://fd/2)' => fopen('php://fd/2', 'wb'), - 'Not a stream' => 'foo', 'Invalid stream (php://temp)' => fopen('php://temp', 'wb'), 'Invalid stream (php://input)' => fopen('php://input', 'wb'), 'Invalid stream (php://memory)' => fopen('php://memory', 'wb'), diff --git a/tests/output/stream_isatty_err.phpt b/tests/output/stream_isatty_err.phpt index 5513781a09..c048739281 100644 --- a/tests/output/stream_isatty_err.phpt +++ b/tests/output/stream_isatty_err.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDERR --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } ?> --CAPTURE_STDIO-- @@ -13,7 +13,7 @@ STDERR require __DIR__.'/stream_isatty.inc'; testToStdErr(); ?> ---EXPECTF-- +--EXPECT-- STDIN (constant): bool(true) STDIN (fopen): bool(true) STDIN (php://fd/0): bool(true) @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(true) STDERR (constant): bool(false) STDERR (fopen): bool(false) STDERR (php://fd/2): bool(false) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_in-err.phpt b/tests/output/stream_isatty_in-err.phpt index de2348a5b5..8c10baae80 100644 --- a/tests/output/stream_isatty_in-err.phpt +++ b/tests/output/stream_isatty_in-err.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDIN/STDERR --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } ?> --CAPTURE_STDIO-- @@ -13,7 +13,7 @@ STDIN STDERR require __DIR__.'/stream_isatty.inc'; testToStdErr(); ?> ---EXPECTF-- +--EXPECT-- STDIN (constant): bool(false) STDIN (fopen): bool(false) STDIN (php://fd/0): bool(false) @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(true) STDERR (constant): bool(false) STDERR (fopen): bool(false) STDERR (php://fd/2): bool(false) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_in-out-err.phpt b/tests/output/stream_isatty_in-out-err.phpt index fea7bc64d7..851327ead8 100644 --- a/tests/output/stream_isatty_in-out-err.phpt +++ b/tests/output/stream_isatty_in-out-err.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDIN/STDOUT/STDERR --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } ?> --CAPTURE_STDIO-- @@ -13,7 +13,7 @@ STDIN STDOUT STDERR require __DIR__.'/stream_isatty.inc'; testToStdOut(); ?> ---EXPECTF-- +--EXPECT-- STDIN (constant): bool(false) STDIN (fopen): bool(false) STDIN (php://fd/0): bool(false) @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(false) STDERR (constant): bool(false) STDERR (fopen): bool(false) STDERR (php://fd/2): bool(false) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_in-out.phpt b/tests/output/stream_isatty_in-out.phpt index 6ad7a03fc3..19fa8552b8 100644 --- a/tests/output/stream_isatty_in-out.phpt +++ b/tests/output/stream_isatty_in-out.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDIN/STDOUT --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } ?> --CAPTURE_STDIO-- @@ -13,7 +13,7 @@ STDIN STDOUT require __DIR__.'/stream_isatty.inc'; testToStdOut(); ?> ---EXPECTF-- +--EXPECT-- STDIN (constant): bool(false) STDIN (fopen): bool(false) STDIN (php://fd/0): bool(false) @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(false) STDERR (constant): bool(true) STDERR (fopen): bool(true) STDERR (php://fd/2): bool(true) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_out-err.phpt b/tests/output/stream_isatty_out-err.phpt index ae3af3a300..e080810ae8 100644 --- a/tests/output/stream_isatty_out-err.phpt +++ b/tests/output/stream_isatty_out-err.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDOUT/STDERR --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } ?> --CAPTURE_STDIO-- @@ -13,7 +13,7 @@ STDOUT STDERR require __DIR__.'/stream_isatty.inc'; testToStdOut(); ?> ---EXPECTF-- +--EXPECT-- STDIN (constant): bool(true) STDIN (fopen): bool(true) STDIN (php://fd/0): bool(true) @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(false) STDERR (constant): bool(false) STDERR (fopen): bool(false) STDERR (php://fd/2): bool(false) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) diff --git a/tests/output/stream_isatty_out.phpt b/tests/output/stream_isatty_out.phpt index dc81577446..80db509510 100644 --- a/tests/output/stream_isatty_out.phpt +++ b/tests/output/stream_isatty_out.phpt @@ -3,7 +3,7 @@ Test stream_isatty with redirected STDOUT --SKIPIF-- <?php if (getenv("SKIP_IO_CAPTURE_TESTS")) { - die("skip I/O capture test"); + die("skip I/O capture test"); } ?> --CAPTURE_STDIO-- @@ -13,7 +13,7 @@ STDOUT require __DIR__.'/stream_isatty.inc'; testToStdOut(); ?> ---EXPECTF-- +--EXPECT-- STDIN (constant): bool(true) STDIN (fopen): bool(true) STDIN (php://fd/0): bool(true) @@ -23,9 +23,6 @@ STDOUT (php://fd/1): bool(false) STDERR (constant): bool(true) STDERR (fopen): bool(true) STDERR (php://fd/2): bool(true) -Not a stream: -Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d -bool(false) Invalid stream (php://temp): bool(false) Invalid stream (php://input): bool(false) Invalid stream (php://memory): bool(false) 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/run-test/bug75042-3.phpt b/tests/run-test/bug75042-3.phpt index dc2f5a0f55..5a30143be9 100644 --- a/tests/run-test/bug75042-3.phpt +++ b/tests/run-test/bug75042-3.phpt @@ -8,5 +8,6 @@ display_errors=1 nonexistentsharedmodule --FILE-- <?php +?> --EXPECTF-- -PHP Warning: PHP Startup: Unable to load dynamic library '%snonexistentsharedmodule.%s' %A +Warning: PHP Startup: Unable to load dynamic library '%snonexistentsharedmodule.%s' %A diff --git a/tests/run-test/bug75042.phpt b/tests/run-test/bug75042.phpt index 001e8f3e7d..a7979d6b5e 100644 --- a/tests/run-test/bug75042.phpt +++ b/tests/run-test/bug75042.phpt @@ -4,7 +4,7 @@ phpt EXTENSIONS directive with shared module <?php $php = getenv('TEST_PHP_EXECUTABLE'); if (false !== stripos(`$php -n -m`, 'openssl')) { - die('skip openssl is built static'); + die('skip openssl is built static'); } $ext_module = ini_get('extension_dir') . DIRECTORY_SEPARATOR . (substr(PHP_OS, 0, 3) === "WIN" ? "php_openssl." : "openssl.") . PHP_SHLIB_SUFFIX; if( !file_exists($ext_module) ) die('skip openssl shared extension not found'); @@ -13,5 +13,6 @@ openssl --FILE-- <?php var_dump(extension_loaded('openssl')); +?> --EXPECT-- bool(true) diff --git a/tests/run-test/test005.phpt b/tests/run-test/test005.phpt deleted file mode 100644 index a95281fc13..0000000000 --- a/tests/run-test/test005.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Error message handling (with ZendOpcache) ---SKIPIF-- -<?php -extension_loaded("Zend Opcache") or die("skip Zend Opcache is not loaded"); -?> ---INI-- -track_errors=1 ---FILE-- -<?php -// If this test fails ask the developers of run-test.php -// -// We check the general ini settings which affect error handling -// and than verify if a message is given by a division by zero. -// EXPECTF is used here since the error format may change but ut -// should always contain 'Division by zero'. -var_dump(ini_get('display_errors')); -var_dump(ini_get('error_reporting')); -var_dump(ini_get('log_errors')); -var_dump(ini_get('track_errors')); -ini_set('display_errors', 0); -var_dump(ini_get('display_errors')); -var_dump($php_errormsg); -$zero = 0; -$error = 1 / $zero; -var_dump($php_errormsg); -?> ---EXPECTF-- -Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0 -string(1) "1" -string(5) "32767" -string(1) "0" -string(1) "1" -string(1) "0" -NULL -string(%d) "%sivision by zer%s" diff --git a/tests/run-test/test008.phpt b/tests/run-test/test008.phpt deleted file mode 100644 index c289e7a696..0000000000 --- a/tests/run-test/test008.phpt +++ /dev/null @@ -1,33 +0,0 @@ ---TEST-- -Error message handling (without ZendOpcache) ---SKIPIF-- -<?php -!extension_loaded("Zend Opcache") or die("skip Zend Opcache is loaded"); -?> ---INI-- -track_errors=1 ---FILE-- -<?php -// If this test fails ask the developers of run-test.php -// -// We check the general ini settings which affect error handling -// and than verify if a message is given by a division by zero. -// EXPECTF is used here since the error format may change but ut -// should always contain 'Division by zero'. -var_dump(ini_get('display_errors')); -var_dump(ini_get('error_reporting')); -var_dump(ini_get('log_errors')); -var_dump(ini_get('track_errors')); -ini_set('display_errors', "0"); -var_dump(ini_get('display_errors')); -$error = 1 / 0; -var_dump($php_errormsg); -?> ---EXPECTF-- -Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0 -string(1) "1" -string(5) "32767" -string(1) "0" -string(1) "1" -string(1) "0" -string(%d) "%sivision by zer%s" diff --git a/tests/run-test/test008a.phpt b/tests/run-test/test008a.phpt deleted file mode 100644 index d247eb36c2..0000000000 --- a/tests/run-test/test008a.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -Error message handling (with ZendOpcache) ---SKIPIF-- -<?php -if (!extension_loaded("Zend Opcache")) die("skip Zend Opcache is not loaded"); -?> ---INI-- -track_errors=1 ---FILE-- -<?php -// If this test fails ask the developers of run-test.php -// -// We check the general ini settings which affect error handling -// and than verify if a message is given by a division by zero. -// EXPECTF is used here since the error format may change but ut -// should always contain 'Division by zero'. -var_dump(ini_get('display_errors')); -var_dump(ini_get('error_reporting')); -var_dump(ini_get('log_errors')); -var_dump(ini_get('track_errors')); -ini_set('display_errors', 0); -var_dump(ini_get('display_errors')); -var_dump($php_errormsg); -$zero = 0; -$error = 1 / $zero; -var_dump($php_errormsg); -?> ---EXPECTF-- -Deprecated: Directive 'track_errors' is deprecated in Unknown on line 0 -string(1) "1" -string(5) "32767" -string(1) "0" -string(1) "1" -string(1) "0" -NULL -string(%d) "%sivision by zer%s" diff --git a/tests/security/open_basedir.inc b/tests/security/open_basedir.inc index d30f2f8384..21338ef1cf 100644 --- a/tests/security/open_basedir.inc +++ b/tests/security/open_basedir.inc @@ -11,7 +11,7 @@ // // For this reason we set the open_basedir to . (current directory) and then // move around to various directories for testing using chdir(). This is NOT -// recommended for production use as . bypasses all semblence of security..! +// recommended for production use as . bypasses all semblances of security..! // // Although safe mode has been removed in php 6.0, open_basedir is still valid. // See http://www.php.net/features.safe-mode for more information @@ -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/security/open_basedir_001.phpt b/tests/security/open_basedir_001.phpt index e6068350a8..a68e9ac531 100644 --- a/tests/security/open_basedir_001.phpt +++ b/tests/security/open_basedir_001.phpt @@ -3,10 +3,10 @@ openbase_dir runtime tightning --SKIPIF-- <?php if(PHP_OS_FAMILY === "Windows") { - die('skip.. only for unix'); + die('skip.. only for unix'); } if (!is_dir("/usr/local/bin")) { - die('skip.. no /usr/local/bin on this machine'); + die('skip.. no /usr/local/bin on this machine'); } --INI-- open_basedir=/usr/local diff --git a/tests/security/open_basedir_copy.phpt b/tests/security/open_basedir_copy.phpt index 989570d640..82806b8fb8 100644 --- a/tests/security/open_basedir_copy.phpt +++ b/tests/security/open_basedir_copy.phpt @@ -35,42 +35,42 @@ bool(true) Warning: copy(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../bad): failed to open stream: %s in %s on line %d +Warning: copy(../bad): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: copy(../bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(..): failed to open stream: %s in %s on line %d +Warning: copy(..): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../): failed to open stream: %s in %s on line %d +Warning: copy(../): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(/): failed to open stream: %s in %s on line %d +Warning: copy(/): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../bad/.): failed to open stream: %s in %s on line %d +Warning: copy(../bad/.): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../bad/./bad.txt): failed to open stream: %s in %s on line %d +Warning: copy(../bad/./bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(./../.): failed to open stream: %s in %s on line %d +Warning: copy(./../.): Failed to open stream: %s in %s on line %d bool(false) bool(true) bool(true) diff --git a/tests/security/open_basedir_dir.phpt b/tests/security/open_basedir_dir.phpt index 90f55e5a95..10181c3efa 100644 --- a/tests/security/open_basedir_dir.phpt +++ b/tests/security/open_basedir_dir.phpt @@ -30,42 +30,42 @@ bool(true) Warning: dir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(../bad): failed to open dir: %s in %s on line %d +Warning: dir(../bad): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(../bad/bad.txt): failed to open dir: %s in %s on line %d +Warning: dir(../bad/bad.txt): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(..): failed to open dir: %s in %s on line %d +Warning: dir(..): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(../): failed to open dir: %s in %s on line %d +Warning: dir(../): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(/): failed to open dir: %s in %s on line %d +Warning: dir(/): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(../bad/.): failed to open dir: %s in %s on line %d +Warning: dir(../bad/.): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(%s/test/bad/bad.txt): failed to open dir: %s in %s on line %d +Warning: dir(%s/test/bad/bad.txt): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(%s/test/bad/../bad/bad.txt): failed to open dir: %s in %s on line %d +Warning: dir(%s/test/bad/../bad/bad.txt): Failed to open directory: %s in %s on line %d bool(false) object(Directory)#%d (2) { ["path"]=> diff --git a/tests/security/open_basedir_error_log_variation.phpt b/tests/security/open_basedir_error_log_variation.phpt index e3cb15d258..4a7b14b004 100644 --- a/tests/security/open_basedir_error_log_variation.phpt +++ b/tests/security/open_basedir_error_log_variation.phpt @@ -32,17 +32,17 @@ bool(true) Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: error_log(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: error_log(%s/test/bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: error_log(%s/test/bad.txt): failed to open stream: %s in %s on line %d +Warning: error_log(%s/test/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: error_log(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: error_log(%s/bad.txt): failed to open stream: %s in %s on line %d +Warning: error_log(%s/bad.txt): Failed to open stream: %s in %s on line %d bool(false) bool(true) *** Finished testing open_basedir configuration [error_log] *** diff --git a/tests/security/open_basedir_file.phpt b/tests/security/open_basedir_file.phpt index 3382ae865d..e3d2a5d8a6 100644 --- a/tests/security/open_basedir_file.phpt +++ b/tests/security/open_basedir_file.phpt @@ -31,42 +31,42 @@ bool(true) Warning: file(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: file(../bad): failed to open stream: %s in %s on line %d +Warning: file(../bad): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file(../bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file(../bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: file(..): failed to open stream: %s in %s on line %d +Warning: file(..): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: file(../): failed to open stream: %s in %s on line %d +Warning: file(../): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: file(/): failed to open stream: %s in %s on line %d +Warning: file(/): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: file(../bad/.): failed to open stream: %s in %s on line %d +Warning: file(../bad/.): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file(%s/test/bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file(%s/test/bad/../bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file(%s/test/bad/../bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) array(1) { [0]=> diff --git a/tests/security/open_basedir_file_get_contents.phpt b/tests/security/open_basedir_file_get_contents.phpt index b5a34de074..91a3eb0980 100644 --- a/tests/security/open_basedir_file_get_contents.phpt +++ b/tests/security/open_basedir_file_get_contents.phpt @@ -31,42 +31,42 @@ bool(true) Warning: file_get_contents(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(../bad): failed to open stream: %s in %s on line %d +Warning: file_get_contents(../bad): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(../bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file_get_contents(../bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(..): failed to open stream: %s in %s on line %d +Warning: file_get_contents(..): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(../): failed to open stream: %s in %s on line %d +Warning: file_get_contents(../): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(/): failed to open stream: %s in %s on line %d +Warning: file_get_contents(/): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(../bad/.): failed to open stream: %s in %s on line %d +Warning: file_get_contents(../bad/.): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file_get_contents(%s/test/bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(%s/test/bad/../bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file_get_contents(%s/test/bad/../bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) string(12) "Hello World!" string(12) "Hello World!" diff --git a/tests/security/open_basedir_file_put_contents.phpt b/tests/security/open_basedir_file_put_contents.phpt index 9f1f3bf13b..b7536d973a 100644 --- a/tests/security/open_basedir_file_put_contents.phpt +++ b/tests/security/open_basedir_file_put_contents.phpt @@ -31,26 +31,26 @@ bool(true) Warning: file_put_contents(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents(../bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file_put_contents(../bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: file_put_contents(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents(.././bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file_put_contents(.././bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: file_put_contents(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents(../bad/../bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file_put_contents(../bad/../bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: file_put_contents(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents(./.././bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file_put_contents(./.././bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: file_put_contents(): open_basedir restriction in effect. File%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: file_put_contents%s/test/bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) *** Finished testing open_basedir configuration [file_put_contents] *** diff --git a/tests/security/open_basedir_fopen.phpt b/tests/security/open_basedir_fopen.phpt index e0fee66f0c..cd4a644edc 100644 --- a/tests/security/open_basedir_fopen.phpt +++ b/tests/security/open_basedir_fopen.phpt @@ -40,42 +40,42 @@ bool(true) Warning: fopen(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../bad): failed to open stream: %s in %s on line %d +Warning: fopen(../bad): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../bad/bad.txt): failed to open stream: %s in %s on line %d +Warning: fopen(../bad/bad.txt): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(..): failed to open stream: %s in %s on line %d +Warning: fopen(..): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../): failed to open stream: %s in %s on line %d +Warning: fopen(../): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(/): failed to open stream: %s in %s on line %d +Warning: fopen(/): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../bad/.): failed to open stream: %s in %s on line %d +Warning: fopen(../bad/.): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../bad/./bad.txt): failed to open stream: %s in %s on line 12 +Warning: fopen(../bad/./bad.txt): Failed to open stream: %s in %s on line 12 bool(false) Warning: fopen(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(./../.): failed to open stream: %s in %s on line %d +Warning: fopen(./../.): Failed to open stream: %s in %s on line %d bool(false) resource(%d) of type (stream) resource(%d) of type (stream) diff --git a/tests/security/open_basedir_opendir.phpt b/tests/security/open_basedir_opendir.phpt index 6b88e13080..caf5a71bec 100644 --- a/tests/security/open_basedir_opendir.phpt +++ b/tests/security/open_basedir_opendir.phpt @@ -29,42 +29,42 @@ bool(true) Warning: opendir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(../bad): failed to open dir: %s in %s on line %d +Warning: opendir(../bad): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(../bad/bad.txt): failed to open dir: %s in %s on line %d +Warning: opendir(../bad/bad.txt): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(..): failed to open dir: %s in %s on line %d +Warning: opendir(..): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(../): failed to open dir: %s in %s on line %d +Warning: opendir(../): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(/): failed to open dir: %s in %s on line %d +Warning: opendir(/): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(../bad/.): failed to open dir: %s in %s on line %d +Warning: opendir(../bad/.): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(%s/test/bad/bad.txt): failed to open dir: %s in %s on line %d +Warning: opendir(%s/test/bad/bad.txt): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(%s/test/bad/../bad/bad.txt): failed to open dir: %s in %s on line %d +Warning: opendir(%s/test/bad/../bad/bad.txt): Failed to open directory: %s in %s on line %d bool(false) resource(%d) of type (stream) resource(%d) of type (stream) diff --git a/tests/security/open_basedir_parse_ini_file.phpt b/tests/security/open_basedir_parse_ini_file.phpt index 11db63fa50..7c9cbd8d12 100644 --- a/tests/security/open_basedir_parse_ini_file.phpt +++ b/tests/security/open_basedir_parse_ini_file.phpt @@ -39,36 +39,36 @@ bool(true) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 6 -Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 6 +Warning: parse_ini_file(%stest\bad): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 6 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 7 -Warning: parse_ini_file(%stest\bad\bad.txt): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 7 +Warning: parse_ini_file(%stest\bad\bad.txt): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 7 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 8 -Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 8 +Warning: parse_ini_file(%stest): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 8 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 9 -Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 9 +Warning: parse_ini_file(%stest): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 9 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 10 -Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 10 +Warning: parse_ini_file(%stest\bad): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 10 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 11 -Warning: parse_ini_file(%stest\bad\bad.txt): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 11 +Warning: parse_ini_file(%stest\bad\bad.txt): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 11 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 12 -Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 12 +Warning: parse_ini_file(%stest): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 12 bool(false) *** Finished testing open_basedir configuration [parse_ini_file] *** diff --git a/tests/security/open_basedir_scandir.phpt b/tests/security/open_basedir_scandir.phpt index 46ea790610..0a629cb9e7 100644 --- a/tests/security/open_basedir_scandir.phpt +++ b/tests/security/open_basedir_scandir.phpt @@ -29,56 +29,56 @@ bool(true) Warning: scandir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(../bad): failed to open dir: %s in %s on line %d +Warning: scandir(../bad): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(../bad/bad.txt): failed to open dir: %s in %s on line %d +Warning: scandir(../bad/bad.txt): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(..): failed to open dir: %s in %s on line %d +Warning: scandir(..): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(../): failed to open dir: %s in %s on line %d +Warning: scandir(../): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(/): failed to open dir: %s in %s on line %d +Warning: scandir(/): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(../bad/.): failed to open dir: %s in %s on line %d +Warning: scandir(../bad/.): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(%s/test/bad/bad.txt): failed to open dir: %s in %s on line %d +Warning: scandir(%s/test/bad/bad.txt): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(%s/test/bad/../bad/bad.txt): failed to open dir: %s in %s on line %d +Warning: scandir(%s/test/bad/../bad/bad.txt): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) diff --git a/tests/strings/001.phpt b/tests/strings/001.phpt index bf1fb67711..0f1f749459 100644 --- a/tests/strings/001.phpt +++ b/tests/strings/001.phpt @@ -3,8 +3,6 @@ String functions --FILE-- <?php -error_reporting(0); - echo "Testing strtok: "; $str = "testing 1/2\\3"; @@ -13,58 +11,58 @@ $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: "; $test = "This is a test"; -$found1 = strstr($test, 32); +$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: "; $test = "fola fola blakken"; $found1 = strrchr($test, "b"); -$found2 = strrchr($test, 102); +$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: "; @@ -81,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:;<=>?' @@ -98,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: "; @@ -118,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"); } @@ -185,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): "; @@ -199,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/002.phpt b/tests/strings/002.phpt index 5e82091088..a43a68c88b 100644 --- a/tests/strings/002.phpt +++ b/tests/strings/002.phpt @@ -2,7 +2,6 @@ Formatted print functions --FILE-- <?php -error_reporting(0); $fp = fopen("php://stdout", "w") or die("Arrggsgg!!"); $x = fprintf($fp, "fprintf test 1:%.5s", "abcdefghij"); @@ -40,7 +39,11 @@ printf("printf test 26:%2\$d %1\$d\n", 1, 2); printf("printf test 27:%3\$d %d %d\n", 1, 2, 3); printf("printf test 28:%2\$02d %1\$2d\n", 1, 2); printf("printf test 29:%2\$-2d %1\$2d\n", 1, 2); -print("printf test 30:"); printf("%0\$s", 1); print("x\n"); +try { + print("printf test 30:"); printf("%0\$s", 1); print("x\n"); +} catch(\ValueError $e) { + print('Error found: '.$e->getMessage()."\n"); +} vprintf("vprintf test 1:%2\$-2d %1\$2d\n", array(1, 2)); @@ -79,5 +82,5 @@ printf test 26:2 1 printf test 27:3 1 2 printf test 28:02 1 printf test 29:2 1 -printf test 30:x +printf test 30:Error found: Argument number must be greater than zero vprintf test 1:2 1 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"> diff --git a/tests/strings/offsets_chaining_1.phpt b/tests/strings/offsets_chaining_1.phpt index 0c3c0074b1..18b6fa2f9d 100644 --- a/tests/strings/offsets_chaining_1.phpt +++ b/tests/strings/offsets_chaining_1.phpt @@ -1,7 +1,5 @@ --TEST-- testing the behavior of string offset chaining ---INI-- -error_reporting=E_ALL | E_DEPRECATED --FILE-- <?php $string = "foobar"; diff --git a/tests/strings/offsets_chaining_2.phpt b/tests/strings/offsets_chaining_2.phpt deleted file mode 100644 index 0c3c0074b1..0000000000 --- a/tests/strings/offsets_chaining_2.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -testing the behavior of string offset chaining ---INI-- -error_reporting=E_ALL | E_DEPRECATED ---FILE-- -<?php -$string = "foobar"; -var_dump($string[0][0][0][0]); -?> ---EXPECT-- -string(1) "f" diff --git a/tests/strings/offsets_chaining_3.phpt b/tests/strings/offsets_chaining_3.phpt index fc11b8d797..12cac5917f 100644 --- a/tests/strings/offsets_chaining_3.phpt +++ b/tests/strings/offsets_chaining_3.phpt @@ -1,7 +1,5 @@ --TEST-- testing the behavior of string offset chaining ---INI-- -error_reporting=E_ALL | E_DEPRECATED --FILE-- <?php $string = "foobar"; diff --git a/tests/strings/offsets_chaining_4.phpt b/tests/strings/offsets_chaining_4.phpt deleted file mode 100644 index fc11b8d797..0000000000 --- a/tests/strings/offsets_chaining_4.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -testing the behavior of string offset chaining ---INI-- -error_reporting=E_ALL | E_DEPRECATED ---FILE-- -<?php -$string = "foobar"; -var_dump(isset($string[0][0][0][0])); -?> ---EXPECT-- -bool(true) diff --git a/tests/strings/offsets_chaining_5.phpt b/tests/strings/offsets_chaining_5.phpt index efcf2f3074..49f062463f 100644 --- a/tests/strings/offsets_chaining_5.phpt +++ b/tests/strings/offsets_chaining_5.phpt @@ -1,27 +1,25 @@ --TEST-- testing the behavior of string offset chaining ---INI-- -error_reporting=E_ALL | E_DEPRECATED --FILE-- <?php $array = array('expected_array' => "foobar"); var_dump(isset($array['expected_array'])); var_dump($array['expected_array']); var_dump(isset($array['expected_array']['foo'])); -var_dump($array['expected_array']['foo']); +var_dump($array['expected_array']['0foo']); var_dump(isset($array['expected_array']['foo']['bar'])); -var_dump($array['expected_array']['foo']['bar']); +var_dump($array['expected_array']['0foo']['0bar']); ?> --EXPECTF-- bool(true) string(6) "foobar" bool(false) -Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d +Warning: Illegal string offset "0foo" in %s on line %d string(1) "f" bool(false) -Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d +Warning: Illegal string offset "0foo" in %s on line %d -Warning: Illegal string offset 'bar' in %soffsets_chaining_5.php on line %d +Warning: Illegal string offset "0bar" in %s on line %d string(1) "f" diff --git a/tests/strings/offsets_general.phpt b/tests/strings/offsets_general.phpt index b2ceea088a..16960eac95 100644 --- a/tests/strings/offsets_general.phpt +++ b/tests/strings/offsets_general.phpt @@ -9,55 +9,19 @@ var_dump($string[0]); var_dump($string[1]); var_dump(isset($string[0])); var_dump(isset($string[0][0])); -var_dump($string["foo"]); +try { + var_dump($string["foo"]); +} catch (\TypeError $e) { + echo $e->getMessage() . \PHP_EOL; +} var_dump(isset($string["foo"]["bar"])); -const FOO_DEPRECATED = "BAR"{0}; -var_dump(FOO_DEPRECATED); -var_dump([$string{0}]); // 1 notice -var_dump($string{1}); -var_dump(isset($string{0})); -var_dump(isset($string{0}{0})); // 2 notices -var_dump($string{"foo"}); -var_dump(isset($string{"foo"}{"bar"})); // 2 notices ?> ---EXPECTF-- - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d - -Deprecated: Array and string offset access syntax with curly braces is deprecated in %s line %d +--EXPECT-- string(1) "B" string(1) "f" string(1) "o" bool(true) bool(true) - -Warning: Illegal string offset 'foo' in %s line %d -string(1) "f" -bool(false) -string(1) "B" -array(1) { - [0]=> - string(1) "f" -} -string(1) "o" -bool(true) -bool(true) - -Warning: Illegal string offset 'foo' in %s line %d -string(1) "f" +Cannot access offset of type string on string bool(false) |