From 45f7b2bcc8f95e793c1a9bb60da0848860c060fb Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 20 Nov 2016 21:24:51 +0100 Subject: [PATCH] Fix CRLF line-endings in tests Also fix a single instance of CRLF in ibase_query.c. --- Zend/tests/bug55509.phpt | 142 +-- Zend/tests/bug64979.phpt | 60 +- Zend/tests/bug71474.phpt | 46 +- Zend/tests/bug72918.phpt | 44 +- Zend/tests/str_offset_002.phpt | 24 +- Zend/tests/traits/bugs/case-sensitive.phpt | 46 +- Zend/tests/traits/static_001.phpt | 42 +- Zend/tests/traits/static_002.phpt | 44 +- Zend/tests/traits/static_003.phpt | 52 +- Zend/tests/traits/static_004.phpt | 42 +- .../traits/static_forward_static_call.phpt | 54 +- .../tests/traits/static_get_called_class.phpt | 46 +- Zend/tests/traits/trait_constant_001.phpt | 72 +- Zend/tests/traits/trait_constant_002.phpt | 52 +- ext/curl/tests/check_win_config.phpt | 106 +- ext/curl/tests/curl_version_error.phpt | 56 +- ext/curl/tests/curl_version_variation1.phpt | 318 ++--- ext/filter/tests/bug47435.phpt | 72 +- ext/filter/tests/bug49274.phpt | 20 +- ext/gd/tests/bug42434.phpt | 50 +- ext/gd/tests/bug53156.phpt | 120 +- ext/gd/tests/bug72494.phpt | 30 +- ext/gd/tests/bug73272.phpt | 48 +- ext/gd/tests/bug73279.phpt | 40 +- ext/gd/tests/bug73279_old.phpt | 44 +- ext/gd/tests/func.inc | 296 ++--- ext/gd/tests/imagecrop_auto-ext.phpt | 170 +-- ext/gd/tests/imagecrop_auto.phpt | 170 +-- ext/gd/tests/imageellipse_error8.phpt | 40 +- ext/gd/tests/imagefilltoborder_error7.phpt | 50 +- ext/gd/tests/imageflip.phpt | 58 +- .../tests/imagegammacorrect_variation2.phpt | 144 +-- ext/gd/tests/imagegd_truecolor.phpt | 68 +- ext/gd/tests/imageopenpolygon_basic.phpt | 58 +- ext/gd/tests/imagepolygon_aa.phpt | 48 +- ext/gd/tests/imagerectangle_basic.phpt | 44 +- ext/gd/tests/imagerectangle_error1.phpt | 36 +- ext/gd/tests/imagerectangle_error2.phpt | 36 +- ext/gd/tests/imagerectangle_error3.phpt | 36 +- ext/gd/tests/imagerectangle_error4.phpt | 36 +- ext/gd/tests/imagerectangle_error5.phpt | 36 +- ext/gd/tests/imagerectangle_error6.phpt | 36 +- ext/gd/tests/imagerectangle_error7.phpt | 36 +- ext/gd/tests/imagerectangle_error8.phpt | 36 +- .../tests/test_image_equals_file_palette.phpt | 84 +- ext/gd/tests/webp_basic.phpt | 76 +- ext/interbase/ibase_query.c | 2 +- .../calendar_getDayOfWeekType_basic.phpt | 2 +- ext/intl/tests/calendar_getNow_basic.phpt | 2 +- ...endar_setMinimalDaysInFirstWeek_basic.phpt | 2 +- .../dateformat_formatObject_calendar.phpt | 82 +- ...format_formatObject_calendar_variant2.phpt | 14 +- .../dateformat_formatObject_datetime.phpt | 68 +- ...format_formatObject_datetime_variant2.phpt | 14 +- .../tests/dateformat_formatObject_error.phpt | 20 +- .../tests/timezone_createDefault_basic.phpt | 2 +- .../timezone_getCanonicalID_variant1.phpt | 2 +- .../timezone_getDisplayName_variant4.phpt | 2 +- ext/mbstring/tests/bug52981.phpt | 46 +- ext/mcrypt/tests/bug55169.phpt | 116 +- ext/mysqli/tests/bug53503.phpt | 130 +- ext/mysqli/tests/bug55653.phpt | 70 +- ext/mysqli/tests/bug55859.phpt | 40 +- ext/mysqli/tests/bug62046.phpt | 78 +- ext/mysqli/tests/bug62885.phpt | 52 +- ext/oci8/tests/bug72524.phpt | 192 +-- ext/openssl/tests/bug61124.phpt | 24 +- ext/openssl/tests/bug66501.phpt | 44 +- ext/pcre/tests/bug69864.phpt | 84 +- .../tests/pdo_mysql_connect_charset.phpt | 66 +- ext/pgsql/tests/30nb_async_query_params.phpt | 156 +-- ext/phar/tests/bug53872.phpt | 56 +- ext/phar/tests/phar_gobyebye-win32.phpt | 96 +- ...eflectionParameter_canBePassedByValue.phpt | 152 +-- .../tests/ReflectionParameter_isDefault.phpt | 68 +- ext/session/tests/bug36459.phpt | 84 +- ext/sockets/tests/bug51958.phpt | 44 +- ext/sockets/tests/mcast_ipv4_recv.phpt | 394 +++--- ext/sockets/tests/mcast_ipv6_recv.phpt | 452 +++---- .../tests/mcast_ipv6_recv_limited.phpt | 262 ++-- ext/sockets/tests/mcast_ipv6_send.phpt | 140 +-- .../DirectoryIterator_getInode_basic.phpt | 24 +- .../DirectoryIterator_getInode_error.phpt | 22 +- ext/spl/tests/SplFileInfo_getGroup_error.phpt | 22 +- ext/spl/tests/SplFileInfo_getInode_basic.phpt | 24 +- ext/spl/tests/SplFileInfo_getInode_error.phpt | 22 +- ext/spl/tests/SplFileInfo_getOwner_error.phpt | 22 +- ext/spl/tests/SplFileInfo_getPerms_basic.phpt | 24 +- ext/spl/tests/SplFileInfo_getPerms_error.phpt | 22 +- ext/spl/tests/iterator_069.phpt | 34 +- ext/spl/tests/iterator_070.phpt | 38 +- ext/spl/tests/iterator_071.phpt | 62 +- ...eIteratorIterator_beginchildren_error.phpt | 72 +- ...teratorIterator_callHasChildren_error.phpt | 72 +- ...iveIteratorIterator_endchildren_error.phpt | 84 +- ...iveIteratorIterator_nextelement_error.phpt | 72 +- ext/sqlite3/tests/bug73333.phpt | 52 +- ext/standard/tests/file/bug43353-win32.phpt | 50 +- ext/standard/tests/file/bug49047.phpt | 34 +- ext/standard/tests/file/bug53241.phpt | 46 +- ext/standard/tests/file/bug55124.phpt | 36 +- ext/standard/tests/file/bug60120.phpt | 148 +-- .../tests/file/rename_variation8-win32.phpt | 140 +-- ext/standard/tests/file/stream_enclosed.phpt | 40 +- .../tests/file/windows_links/bug48746.phpt | 116 +- .../tests/file/windows_links/bug48746_1.phpt | 118 +- .../tests/file/windows_links/bug48746_2.phpt | 138 +-- .../tests/file/windows_links/bug48746_3.phpt | 100 +- .../tests/general_functions/bug50690.phpt | 28 +- .../get_defined_constants_basic.phpt | 76 +- .../get_loaded_extensions_basic.phpt | 44 +- .../tests/general_functions/uniqid_error.phpt | 90 +- ext/standard/tests/mail/bug73203.phpt | 48 +- .../tests/network/gethostbyname_basic003.phpt | 34 +- .../tests/network/gethostbynamel_basic1.phpt | 36 +- .../password/password_get_info_argon2.phpt | 56 +- .../tests/password/password_hash_argon2.phpt | 34 +- .../password/password_hash_error_argon2.phpt | 40 +- .../password_needs_rehash_argon2.phpt | 44 +- .../password/password_verify_argon2.phpt | 34 +- .../tests/streams/bug49936_win32.phpt | 60 +- ext/standard/tests/strings/bug49687.phpt | 38 +- ext/standard/tests/strings/bug50052.phpt | 24 +- ext/standard/tests/strings/bug53021.phpt | 80 +- .../get_html_translation_table_basic1.phpt | 1098 ++++++++--------- .../tests/strings/htmlentities-utf-3.phpt | 166 +-- ext/standard/tests/strings/md5_basic1.phpt | 34 +- ext/standard/tests/strings/md5_basic2.phpt | 58 +- ext/standard/tests/strings/md5_error.phpt | 68 +- ext/standard/tests/strings/soundex_basic.phpt | 92 +- ext/standard/tests/strings/soundex_error.phpt | 66 +- .../tests/strings/str_rot13_basic.phpt | 108 +- .../tests/strings/str_rot13_error.phpt | 62 +- .../tests/strings/strnatcasecmp_error.phpt | 64 +- .../tests/strings/strnatcmp_basic.phpt | 158 +-- .../tests/strings/strnatcmp_error.phpt | 68 +- tests/basic/bug53180.phpt | 38 +- tests/basic/req44164.phpt | 34 +- .../rfc1867_max_file_uploads_empty_files.phpt | 196 +-- tests/lang/foreachLoop.001.phpt | 126 +- tests/lang/foreachLoop.002.phpt | 344 +++--- tests/lang/foreachLoop.003.phpt | 92 +- tests/lang/foreachLoop.004.phpt | 150 +-- tests/lang/foreachLoop.005.phpt | 46 +- tests/lang/foreachLoop.006.phpt | 20 +- tests/lang/foreachLoop.009.phpt | 156 +-- tests/lang/foreachLoop.010.phpt | 78 +- tests/lang/foreachLoop.011.phpt | 66 +- tests/lang/foreachLoop.012.phpt | 988 +++++++-------- tests/lang/foreachLoop.013.phpt | 1070 ++++++++-------- tests/lang/foreachLoop.014.phpt | 990 +++++++-------- tests/lang/foreachLoop.015.phpt | 1074 ++++++++-------- tests/lang/foreachLoop.016.phpt | 412 +++---- tests/lang/foreachLoop.017.phpt | 20 +- tests/lang/operators/add_basiclong_64bit.phpt | 86 +- tests/lang/operators/add_variationStr.phpt | 50 +- .../operators/bitwiseAnd_variationStr.phpt | 50 +- .../operators/bitwiseNot_variationStr.phpt | 42 +- .../operators/bitwiseOr_variationStr.phpt | 50 +- .../bitwiseShiftLeft_variationStr_64bit.phpt | 848 ++++++------- .../operators/bitwiseXor_variationStr.phpt | 50 +- .../operators/divide_basiclong_64bit.phpt | 86 +- tests/lang/operators/divide_variationStr.phpt | 50 +- .../lang/operators/modulus_variationStr.phpt | 840 ++++++------- .../operators/multiply_basiclong_64bit.phpt | 86 +- .../lang/operators/multiply_variationStr.phpt | 50 +- .../operators/negate_basiclong_64bit.phpt | 62 +- tests/lang/operators/negate_variationStr.phpt | 42 +- .../lang/operators/operator_equals_basic.phpt | 128 +- .../operators/operator_equals_variation.phpt | 124 +- .../operator_equals_variation_64bit.phpt | 128 +- tests/lang/operators/operator_gt_basic.phpt | 128 +- .../operators/operator_gt_or_equal_basic.phpt | 128 +- .../operator_gt_or_equal_variation.phpt | 124 +- .../operator_gt_or_equal_variation_64bit.phpt | 124 +- .../lang/operators/operator_gt_variation.phpt | 122 +- .../operator_gt_variation_64bit.phpt | 122 +- .../operators/operator_identical_basic.phpt | 128 +- .../operator_identical_variation.phpt | 124 +- .../operator_identical_variation_64bit.phpt | 128 +- tests/lang/operators/operator_lt_basic.phpt | 122 +- .../operators/operator_lt_or_equal_basic.phpt | 126 +- .../operator_lt_or_equal_variation.phpt | 124 +- .../operator_lt_or_equal_variation_64bit.phpt | 124 +- .../lang/operators/operator_lt_variation.phpt | 118 +- .../operator_lt_variation_64bit.phpt | 118 +- .../operators/operator_notequals_basic.phpt | 128 +- .../operator_notequals_variation.phpt | 124 +- .../operator_notequals_variation_64bit.phpt | 128 +- .../operator_notidentical_basic.phpt | 128 +- .../operator_notidentical_variation.phpt | 126 +- ...operator_notidentical_variation_64bit.phpt | 128 +- .../operators/operator_spaceship_basic.phpt | 186 +-- .../operators/postdec_basiclong_64bit.phpt | 122 +- .../lang/operators/postdec_variationStr.phpt | 98 +- .../operators/postinc_basiclong_64bit.phpt | 122 +- .../lang/operators/postinc_variationStr.phpt | 98 +- .../operators/predec_basiclong_64bit.phpt | 62 +- tests/lang/operators/predec_variationStr.phpt | 42 +- .../operators/preinc_basiclong_64bit.phpt | 62 +- .../operators/subtract_basiclong_64bit.phpt | 86 +- .../lang/operators/subtract_variationStr.phpt | 50 +- tests/lang/returnByReference.001.phpt | 38 +- tests/lang/returnByReference.002.phpt | 58 +- tests/lang/returnByReference.003.phpt | 110 +- tests/lang/returnByReference.004.phpt | 114 +- tests/lang/returnByReference.005.phpt | 116 +- tests/lang/returnByReference.006.phpt | 120 +- tests/lang/returnByReference.007.phpt | 124 +- tests/lang/returnByReference.008.phpt | 126 +- tests/lang/returnByReference.009.phpt | 78 +- 211 files changed, 11935 insertions(+), 11935 deletions(-) diff --git a/Zend/tests/bug55509.phpt b/Zend/tests/bug55509.phpt index 5268789df67..4fc32996200 100644 --- a/Zend/tests/bug55509.phpt +++ b/Zend/tests/bug55509.phpt @@ -1,71 +1,71 @@ ---TEST-- -Bug #55509 (segfault on x86_64 using more than 2G memory) ---SKIPIF-- - ---INI-- -memory_limit=2100M ---FILE-- - ---EXPECTF-- -1 -2 -3 -4 - -Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d +--TEST-- +Bug #55509 (segfault on x86_64 using more than 2G memory) +--SKIPIF-- + +--INI-- +memory_limit=2100M +--FILE-- + +--EXPECTF-- +1 +2 +3 +4 + +Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d diff --git a/Zend/tests/bug64979.phpt b/Zend/tests/bug64979.phpt index 5bc8e5a6ab2..6122ccf2707 100644 --- a/Zend/tests/bug64979.phpt +++ b/Zend/tests/bug64979.phpt @@ -1,30 +1,30 @@ ---TEST-- -Bug #64979 (Wrong behavior of static variables in closure generators) ---FILE-- - ---EXPECT-- -int(1) -int(2) -int(1) +--TEST-- +Bug #64979 (Wrong behavior of static variables in closure generators) +--FILE-- + +--EXPECT-- +int(1) +int(2) +int(1) diff --git a/Zend/tests/bug71474.phpt b/Zend/tests/bug71474.phpt index e67bb9b2405..72b0db91a1a 100644 --- a/Zend/tests/bug71474.phpt +++ b/Zend/tests/bug71474.phpt @@ -1,23 +1,23 @@ ---TEST-- -Bug #71474: Crash because of VM stack corruption on Magento2 ---FILE-- - 0) { - $x->bug(); - test($n - 1, $x); - } -} - -test(3000, new foo()); -echo "OK\n"; -?> ---EXPECT-- -OK +--TEST-- +Bug #71474: Crash because of VM stack corruption on Magento2 +--FILE-- + 0) { + $x->bug(); + test($n - 1, $x); + } +} + +test(3000, new foo()); +echo "OK\n"; +?> +--EXPECT-- +OK diff --git a/Zend/tests/bug72918.phpt b/Zend/tests/bug72918.phpt index f3dc1d29186..403d4e69c50 100644 --- a/Zend/tests/bug72918.phpt +++ b/Zend/tests/bug72918.phpt @@ -1,22 +1,22 @@ ---TEST-- -Bug #72918 (negative offset inside a quoted string leads to parse error) ---FILE-- - 'foo']; -$string = 'abcde'; - -echo "$array[-3]\n"; -echo "$string[-3]\n"; -echo << -===DONE=== ---EXPECT-- -foo -c -foo -c -===DONE=== +--TEST-- +Bug #72918 (negative offset inside a quoted string leads to parse error) +--FILE-- + 'foo']; +$string = 'abcde'; + +echo "$array[-3]\n"; +echo "$string[-3]\n"; +echo << +===DONE=== +--EXPECT-- +foo +c +foo +c +===DONE=== diff --git a/Zend/tests/str_offset_002.phpt b/Zend/tests/str_offset_002.phpt index 2f5e4ee8909..d3a9152905f 100644 --- a/Zend/tests/str_offset_002.phpt +++ b/Zend/tests/str_offset_002.phpt @@ -1,12 +1,12 @@ ---TEST-- -string offset 002 ---FILE-- - ---EXPECTF-- -Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sstr_offset_002.php:3 -Stack trace: -#0 {main} - thrown in %sstr_offset_002.php on line 3 +--TEST-- +string offset 002 +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught Error: Cannot create references to/from string offsets in %sstr_offset_002.php:3 +Stack trace: +#0 {main} + thrown in %sstr_offset_002.php on line 3 diff --git a/Zend/tests/traits/bugs/case-sensitive.phpt b/Zend/tests/traits/bugs/case-sensitive.phpt index 13d4188f2f4..6a65ccff03c 100644 --- a/Zend/tests/traits/bugs/case-sensitive.phpt +++ b/Zend/tests/traits/bugs/case-sensitive.phpt @@ -1,23 +1,23 @@ ---TEST-- -Check for problems with case sensitivity in compositions ---FILE-- - ---EXPECTF-- -Fatal error: Trait method M1 has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d +--TEST-- +Check for problems with case sensitivity in compositions +--FILE-- + +--EXPECTF-- +Fatal error: Trait method M1 has not been applied, because there are collisions with other trait methods on MyClass in %s on line %d diff --git a/Zend/tests/traits/static_001.phpt b/Zend/tests/traits/static_001.phpt index d86cb851b9d..5953c008d58 100644 --- a/Zend/tests/traits/static_001.phpt +++ b/Zend/tests/traits/static_001.phpt @@ -1,22 +1,22 @@ ---TEST-- -Traits with static methods. ---CREDITS-- -Simas Toleikis simast@gmail.com ---FILE-- - ---EXPECT-- +--TEST-- +Traits with static methods. +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- + +--EXPECT-- Test \ No newline at end of file diff --git a/Zend/tests/traits/static_002.phpt b/Zend/tests/traits/static_002.phpt index c076085519b..64ebf6bf14d 100644 --- a/Zend/tests/traits/static_002.phpt +++ b/Zend/tests/traits/static_002.phpt @@ -1,23 +1,23 @@ ---TEST-- -Traits with static methods referenced using variable. ---CREDITS-- -Simas Toleikis simast@gmail.com ---FILE-- - ---EXPECT-- +--TEST-- +Traits with static methods referenced using variable. +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- + +--EXPECT-- Test \ No newline at end of file diff --git a/Zend/tests/traits/static_003.phpt b/Zend/tests/traits/static_003.phpt index fbe5421c71c..01953cf7243 100644 --- a/Zend/tests/traits/static_003.phpt +++ b/Zend/tests/traits/static_003.phpt @@ -1,27 +1,27 @@ ---TEST-- -Traits with late static bindings. ---CREDITS-- -Simas Toleikis simast@gmail.com ---FILE-- - ---EXPECT-- +--TEST-- +Traits with late static bindings. +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- + +--EXPECT-- Test B \ No newline at end of file diff --git a/Zend/tests/traits/static_004.phpt b/Zend/tests/traits/static_004.phpt index c360f457f0c..3c3f3809088 100644 --- a/Zend/tests/traits/static_004.phpt +++ b/Zend/tests/traits/static_004.phpt @@ -1,22 +1,22 @@ ---TEST-- -Traits with __callStatic magic method. ---CREDITS-- -Simas Toleikis simast@gmail.com ---FILE-- - ---EXPECT-- +--TEST-- +Traits with __callStatic magic method. +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- + +--EXPECT-- Test \ No newline at end of file diff --git a/Zend/tests/traits/static_forward_static_call.phpt b/Zend/tests/traits/static_forward_static_call.phpt index 878cf1fcc14..9cda8aee1d1 100644 --- a/Zend/tests/traits/static_forward_static_call.phpt +++ b/Zend/tests/traits/static_forward_static_call.phpt @@ -1,28 +1,28 @@ ---TEST-- -Traits and forward_static_call(). ---CREDITS-- -Simas Toleikis simast@gmail.com ---FILE-- - ---EXPECT-- +--TEST-- +Traits and forward_static_call(). +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- + +--EXPECT-- Forwarded Test A \ No newline at end of file diff --git a/Zend/tests/traits/static_get_called_class.phpt b/Zend/tests/traits/static_get_called_class.phpt index dc29ecefa24..bd7a6037124 100644 --- a/Zend/tests/traits/static_get_called_class.phpt +++ b/Zend/tests/traits/static_get_called_class.phpt @@ -1,24 +1,24 @@ ---TEST-- -Traits and get_called_class(). ---CREDITS-- -Simas Toleikis simast@gmail.com ---FILE-- - ---EXPECT-- +--TEST-- +Traits and get_called_class(). +--CREDITS-- +Simas Toleikis simast@gmail.com +--FILE-- + +--EXPECT-- B \ No newline at end of file diff --git a/Zend/tests/traits/trait_constant_001.phpt b/Zend/tests/traits/trait_constant_001.phpt index 0fd8ff921b2..590949c2f6b 100644 --- a/Zend/tests/traits/trait_constant_001.phpt +++ b/Zend/tests/traits/trait_constant_001.phpt @@ -1,36 +1,36 @@ ---TEST-- -__TRAIT__: Basics, a constant denoiting the trait of definition. ---FILE-- - ---EXPECT-- -TestTrait -TestTrait -TestTrait +--TEST-- +__TRAIT__: Basics, a constant denoiting the trait of definition. +--FILE-- + +--EXPECT-- +TestTrait +TestTrait +TestTrait diff --git a/Zend/tests/traits/trait_constant_002.phpt b/Zend/tests/traits/trait_constant_002.phpt index 327dd44a64d..bbafbf210ef 100644 --- a/Zend/tests/traits/trait_constant_002.phpt +++ b/Zend/tests/traits/trait_constant_002.phpt @@ -1,27 +1,27 @@ ---TEST-- -__TRAIT__: Use outside of traits. ---FILE-- - ---EXPECT-- -string(0) "" -string(0) "" +--TEST-- +__TRAIT__: Use outside of traits. +--FILE-- + +--EXPECT-- +string(0) "" +string(0) "" string(0) "" \ No newline at end of file diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt index fc1c66609aa..2c7c3990095 100644 --- a/ext/curl/tests/check_win_config.phpt +++ b/ext/curl/tests/check_win_config.phpt @@ -1,53 +1,53 @@ ---TEST-- -Check libcurl config on windows ---SKIPIF-- - ---FILE-- - -DONE ---EXPECTF-- -cURL support => enabled -cURL Information => %s -Age => %d -Features -AsynchDNS => Yes -CharConv => No -Debug => No -GSS-Negotiate => No -IDN => Yes -IPv6 => Yes -krb4 => No -Largefile => Yes -libz => Yes -NTLM => Yes -NTLMWB => No -SPNEGO => Yes -SSL => Yes -SSPI => Yes -TLS-SRP => No -HTTP2 => No -GSSAPI => No -KERBEROS5 => Yes -UNIX_SOCKETS => No -PSL => No -Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp -Host => %s-pc-win32 -SSL Version => OpenSSL/%s -ZLib Version => %s -libSSH Version => libssh2/%s -DONE +--TEST-- +Check libcurl config on windows +--SKIPIF-- + +--FILE-- + +DONE +--EXPECTF-- +cURL support => enabled +cURL Information => %s +Age => %d +Features +AsynchDNS => Yes +CharConv => No +Debug => No +GSS-Negotiate => No +IDN => Yes +IPv6 => Yes +krb4 => No +Largefile => Yes +libz => Yes +NTLM => Yes +NTLMWB => No +SPNEGO => Yes +SSL => Yes +SSPI => Yes +TLS-SRP => No +HTTP2 => No +GSSAPI => No +KERBEROS5 => Yes +UNIX_SOCKETS => No +PSL => No +Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp +Host => %s-pc-win32 +SSL Version => OpenSSL/%s +ZLib Version => %s +libSSH Version => libssh2/%s +DONE diff --git a/ext/curl/tests/curl_version_error.phpt b/ext/curl/tests/curl_version_error.phpt index a9b80c55be8..39f99a0fad4 100644 --- a/ext/curl/tests/curl_version_error.phpt +++ b/ext/curl/tests/curl_version_error.phpt @@ -1,28 +1,28 @@ ---TEST-- -Test curl_version() function : error conditions ---SKIPIF-- - ---FILE-- - -===Done=== ---EXPECTF-- -*** Testing curl_version() : error conditions *** - --- Testing curl_version() function with more than expected no. of arguments -- - -Warning: curl_version() expects at most 1 parameter, 2 given in %s on line %d -NULL -===Done=== +--TEST-- +Test curl_version() function : error conditions +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing curl_version() : error conditions *** + +-- Testing curl_version() function with more than expected no. of arguments -- + +Warning: curl_version() expects at most 1 parameter, 2 given in %s on line %d +NULL +===Done=== diff --git a/ext/curl/tests/curl_version_variation1.phpt b/ext/curl/tests/curl_version_variation1.phpt index 65f5e69acbc..7c0106cb6a4 100644 --- a/ext/curl/tests/curl_version_variation1.phpt +++ b/ext/curl/tests/curl_version_variation1.phpt @@ -1,159 +1,159 @@ ---TEST-- -Test curl_version() function : usage variations - test values for $ascii argument ---SKIPIF-- - ---FILE-- - -===Done=== ---EXPECTF-- -*** Testing curl_version() function: with unexpected inputs for 'age' argument *** --- Iteration 1 -- -bool(true) --- Iteration 2 -- -bool(true) --- Iteration 3 -- -bool(true) --- Iteration 4 -- -bool(true) --- Iteration 5 -- -bool(true) --- Iteration 6 -- -bool(true) --- Iteration 7 -- -bool(true) --- Iteration 8 -- -bool(true) --- Iteration 9 -- -bool(true) --- Iteration 10 -- - -Warning: curl_version() expects parameter 1 to be integer, array given in %s on line %d -bool(false) --- Iteration 11 -- - -Warning: curl_version() expects parameter 1 to be integer, array given in %s on line %d -bool(false) --- Iteration 12 -- - -Warning: curl_version() expects parameter 1 to be integer, array given in %s on line %d -bool(false) --- Iteration 13 -- - -Warning: curl_version() expects parameter 1 to be integer, string given in %s on line %d -bool(false) --- Iteration 14 -- - -Warning: curl_version() expects parameter 1 to be integer, string given in %s on line %d -bool(false) --- Iteration 15 -- - -Notice: A non well formed numeric value encountered in %s on line %d -bool(true) --- Iteration 16 -- -bool(true) --- Iteration 17 -- -bool(true) --- Iteration 18 -- -bool(true) --- Iteration 19 -- -bool(true) --- Iteration 20 -- -bool(true) --- Iteration 21 -- -bool(true) --- Iteration 22 -- - -Warning: curl_version() expects parameter 1 to be integer, object given in %s on line %d -bool(false) --- Iteration 23 -- - -Warning: curl_version() expects parameter 1 to be integer, resource given in %s on line %d -bool(false) --- Iteration 24 -- -bool(true) --- Iteration 25 -- -bool(true) -===Done=== +--TEST-- +Test curl_version() function : usage variations - test values for $ascii argument +--SKIPIF-- + +--FILE-- + +===Done=== +--EXPECTF-- +*** Testing curl_version() function: with unexpected inputs for 'age' argument *** +-- Iteration 1 -- +bool(true) +-- Iteration 2 -- +bool(true) +-- Iteration 3 -- +bool(true) +-- Iteration 4 -- +bool(true) +-- Iteration 5 -- +bool(true) +-- Iteration 6 -- +bool(true) +-- Iteration 7 -- +bool(true) +-- Iteration 8 -- +bool(true) +-- Iteration 9 -- +bool(true) +-- Iteration 10 -- + +Warning: curl_version() expects parameter 1 to be integer, array given in %s on line %d +bool(false) +-- Iteration 11 -- + +Warning: curl_version() expects parameter 1 to be integer, array given in %s on line %d +bool(false) +-- Iteration 12 -- + +Warning: curl_version() expects parameter 1 to be integer, array given in %s on line %d +bool(false) +-- Iteration 13 -- + +Warning: curl_version() expects parameter 1 to be integer, string given in %s on line %d +bool(false) +-- Iteration 14 -- + +Warning: curl_version() expects parameter 1 to be integer, string given in %s on line %d +bool(false) +-- Iteration 15 -- + +Notice: A non well formed numeric value encountered in %s on line %d +bool(true) +-- Iteration 16 -- +bool(true) +-- Iteration 17 -- +bool(true) +-- Iteration 18 -- +bool(true) +-- Iteration 19 -- +bool(true) +-- Iteration 20 -- +bool(true) +-- Iteration 21 -- +bool(true) +-- Iteration 22 -- + +Warning: curl_version() expects parameter 1 to be integer, object given in %s on line %d +bool(false) +-- Iteration 23 -- + +Warning: curl_version() expects parameter 1 to be integer, resource given in %s on line %d +bool(false) +-- Iteration 24 -- +bool(true) +-- Iteration 25 -- +bool(true) +===Done=== diff --git a/ext/filter/tests/bug47435.phpt b/ext/filter/tests/bug47435.phpt index 957a00194ad..9388679ebb4 100644 --- a/ext/filter/tests/bug47435.phpt +++ b/ext/filter/tests/bug47435.phpt @@ -1,36 +1,36 @@ ---TEST-- -Bug #47435 (FILTER_FLAG_NO_PRIV_RANGE and FILTER_FLAG_NO_RES_RANGE don't work with ipv6) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(7) "FC00::1" -bool(false) -string(2) "::" -bool(false) -string(3) "::1" -bool(false) -string(10) "fe8:5:6::1" -bool(false) -string(12) "2001:0db8::1" -bool(false) -string(5) "5f::1" -bool(false) -string(7) "3ff3::1" -bool(false) +--TEST-- +Bug #47435 (FILTER_FLAG_NO_PRIV_RANGE and FILTER_FLAG_NO_RES_RANGE don't work with ipv6) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(7) "FC00::1" +bool(false) +string(2) "::" +bool(false) +string(3) "::1" +bool(false) +string(10) "fe8:5:6::1" +bool(false) +string(12) "2001:0db8::1" +bool(false) +string(5) "5f::1" +bool(false) +string(7) "3ff3::1" +bool(false) diff --git a/ext/filter/tests/bug49274.phpt b/ext/filter/tests/bug49274.phpt index c87e6be1c72..2adc6ed9772 100644 --- a/ext/filter/tests/bug49274.phpt +++ b/ext/filter/tests/bug49274.phpt @@ -1,10 +1,10 @@ ---TEST-- -#49274, fatal error when an object does not implement toString ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -bool(false) +--TEST-- +#49274, fatal error when an object does not implement toString +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(false) diff --git a/ext/gd/tests/bug42434.phpt b/ext/gd/tests/bug42434.phpt index cede1ac17fe..7e492c38dae 100644 --- a/ext/gd/tests/bug42434.phpt +++ b/ext/gd/tests/bug42434.phpt @@ -1,26 +1,26 @@ ---TEST-- -Bug #42434 (ImageLine w/ antialias = 1px shorter) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Bug #42434 (ImageLine w/ antialias = 1px shorter) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- DONE \ No newline at end of file diff --git a/ext/gd/tests/bug53156.phpt b/ext/gd/tests/bug53156.phpt index 9e1fec8798f..ceb37c13c49 100644 --- a/ext/gd/tests/bug53156.phpt +++ b/ext/gd/tests/bug53156.phpt @@ -1,60 +1,60 @@ ---TEST-- -Bug #53156 (imagerectangle problem with point ordering) ---SKIPIF-- - ---FILE-- - ---EXPECT-- -Rectangle: ++++ -Rectangle: ++++ -Rectangle: ++++ -Rectangle: ++++ -Rectangle: ++++ -Rectangle: ++++ -Rectangle: ++++ -Rectangle: ++++ +--TEST-- +Bug #53156 (imagerectangle problem with point ordering) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Rectangle: ++++ +Rectangle: ++++ +Rectangle: ++++ +Rectangle: ++++ +Rectangle: ++++ +Rectangle: ++++ +Rectangle: ++++ +Rectangle: ++++ diff --git a/ext/gd/tests/bug72494.phpt b/ext/gd/tests/bug72494.phpt index f21de6ca3b8..4cca9aec8e5 100644 --- a/ext/gd/tests/bug72494.phpt +++ b/ext/gd/tests/bug72494.phpt @@ -1,15 +1,15 @@ ---TEST-- -Bug #72494 (imagecropauto out-of-bounds access) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -Warning: imagecropauto(): Color argument missing with threshold mode in %s on line %d -===DONE=== +--TEST-- +Bug #72494 (imagecropauto out-of-bounds access) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +Warning: imagecropauto(): Color argument missing with threshold mode in %s on line %d +===DONE=== diff --git a/ext/gd/tests/bug73272.phpt b/ext/gd/tests/bug73272.phpt index 3bb710cdc7d..ccee8d6e67e 100644 --- a/ext/gd/tests/bug73272.phpt +++ b/ext/gd/tests/bug73272.phpt @@ -1,24 +1,24 @@ ---TEST-- -Bug #73272 (imagescale() is not affected by, but affects imagesetinterpolation()) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -The images are equal. -===DONE=== +--TEST-- +Bug #73272 (imagescale() is not affected by, but affects imagesetinterpolation()) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +The images are equal. +===DONE=== diff --git a/ext/gd/tests/bug73279.phpt b/ext/gd/tests/bug73279.phpt index e6c67090396..aba91f0d3af 100644 --- a/ext/gd/tests/bug73279.phpt +++ b/ext/gd/tests/bug73279.phpt @@ -1,20 +1,20 @@ ---TEST-- -Bug #73279 (Integer overflow in gdImageScaleBilinearPalette()) ---SKIPIF-- -= 2.2.4'); -} -?> ---FILE-- - -===DONE=== ---EXPECT-- -color: ffffff -===DONE=== +--TEST-- +Bug #73279 (Integer overflow in gdImageScaleBilinearPalette()) +--SKIPIF-- += 2.2.4'); +} +?> +--FILE-- + +===DONE=== +--EXPECT-- +color: ffffff +===DONE=== diff --git a/ext/gd/tests/bug73279_old.phpt b/ext/gd/tests/bug73279_old.phpt index 0cbbec34f2e..810b15201fa 100644 --- a/ext/gd/tests/bug73279_old.phpt +++ b/ext/gd/tests/bug73279_old.phpt @@ -1,22 +1,22 @@ ---TEST-- -Bug #73279 (Integer overflow in gdImageScaleBilinearPalette()) ---SKIPIF-- -=')) { - die('skip only for external libgd < 2.2.4'); -} -?> ---FILE-- - -===DONE=== ---XFAIL-- -Bug #330 has not yet been fixed ---EXPECT-- -color: ffffff -===DONE=== +--TEST-- +Bug #73279 (Integer overflow in gdImageScaleBilinearPalette()) +--SKIPIF-- +=')) { + die('skip only for external libgd < 2.2.4'); +} +?> +--FILE-- + +===DONE=== +--XFAIL-- +Bug #330 has not yet been fixed +--EXPECT-- +color: ffffff +===DONE=== diff --git a/ext/gd/tests/func.inc b/ext/gd/tests/func.inc index 708fccd3d11..1928ff696ac 100644 --- a/ext/gd/tests/func.inc +++ b/ext/gd/tests/func.inc @@ -1,148 +1,148 @@ - (\d+\.\d+\.\d+),s', get_php_info(), $match)) { - $version = $match[1]; - } - - return $version; -} - -function get_libjpeg_version() -{ - $version = 0; - - if (preg_match(',libJPEG Version => ([a-z0-9]+),s', get_php_info(), $match)) { - $version = $match[1]; - } - - return $version; -} - -function get_libpng_version() -{ - $version = 0; - - if (preg_match(',libPNG Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) { - $version = $match[1]; - } - - return $version; -} - -function get_libxpm_version() -{ - $version = 0; - - if (preg_match(',libXpm Version => (\d+),s', get_php_info(), $match)) { - $version = $match[1]; - } - - return $version; -} - -/** - * Tests that an in-memory image equals a PNG file. - * - * It checks for equal image sizes, and whether any pixels are different. - * The textual result is printed, so the EXPECT section should contain the line - * "The images are equal." - * - * If the PNG file does not exists, or the images are not equal, a diagnostic - * message is printed, and the actual file is stored right beside the temporary - * .php test file with the extension .out.png, to be able to manually inspect - * the result. - * - * @param string $filename - * @param resource $actual - * @return void - */ -function test_image_equals_file($filename, $actual) -{ - if (!file_exists($filename)) { - echo "The expected image does not exist.\n"; - save_actual_image($actual); - return; - } - $actual = test_to_truecolor($actual); - $expected = imagecreatefrompng($filename); - $expected = test_to_truecolor($expected); - $exp_x = imagesx($expected); - $exp_y = imagesy($expected); - $act_x = imagesx($actual); - $act_y = imagesy($actual); - if ($exp_x != $act_x || $exp_y != $act_y) { - echo "The image size differs: expected {$exp_x}x{$exp_y}, got {$act_x}x{$act_y}.\n"; - save_actual_image($actual); - return; - } - $pixels_changed = 0; - for ($y = 0; $y < $exp_y; $y++) { - for ($x = 0; $x < $exp_x; $x ++) { - $exp_c = imagecolorat($expected, $x, $y); - $act_c = imagecolorat($actual, $x, $y); - if ($exp_c != $act_c) { - $pixels_changed++; - } - } - } - if (!$pixels_changed) { - echo "The images are equal.\n"; - } else { - echo "The images differ in {$pixels_changed} pixels.\n"; - save_actual_image($actual); - } -} - -/** - * Returns the truecolor version of an image. - * - * @param resource $image - * @return resource - */ -function test_to_truecolor($image) -{ - if (imageistruecolor($image)) { - return $image; - } else { - $width = imagesx($image); - $height = imagesy($image); - $result = imagecreatetruecolor($width, $height); - imagecopy($result, $image, 0,0, 0,0, $width, $height); - return $result; - } -} - -/** - * Saves an actual image to disk. - * - * The image is saved right beside the temporary .php test file with the - * extension .out.png. - * - * @param resource $image - * @return void - */ -function save_actual_image($image) -{ - $pathinfo = pathinfo($_SERVER['SCRIPT_FILENAME']); - $filename = "{$pathinfo['dirname']}/{$pathinfo['filename']}.out.png"; - imagepng($image, $filename); -} + (\d+\.\d+\.\d+),s', get_php_info(), $match)) { + $version = $match[1]; + } + + return $version; +} + +function get_libjpeg_version() +{ + $version = 0; + + if (preg_match(',libJPEG Version => ([a-z0-9]+),s', get_php_info(), $match)) { + $version = $match[1]; + } + + return $version; +} + +function get_libpng_version() +{ + $version = 0; + + if (preg_match(',libPNG Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) { + $version = $match[1]; + } + + return $version; +} + +function get_libxpm_version() +{ + $version = 0; + + if (preg_match(',libXpm Version => (\d+),s', get_php_info(), $match)) { + $version = $match[1]; + } + + return $version; +} + +/** + * Tests that an in-memory image equals a PNG file. + * + * It checks for equal image sizes, and whether any pixels are different. + * The textual result is printed, so the EXPECT section should contain the line + * "The images are equal." + * + * If the PNG file does not exists, or the images are not equal, a diagnostic + * message is printed, and the actual file is stored right beside the temporary + * .php test file with the extension .out.png, to be able to manually inspect + * the result. + * + * @param string $filename + * @param resource $actual + * @return void + */ +function test_image_equals_file($filename, $actual) +{ + if (!file_exists($filename)) { + echo "The expected image does not exist.\n"; + save_actual_image($actual); + return; + } + $actual = test_to_truecolor($actual); + $expected = imagecreatefrompng($filename); + $expected = test_to_truecolor($expected); + $exp_x = imagesx($expected); + $exp_y = imagesy($expected); + $act_x = imagesx($actual); + $act_y = imagesy($actual); + if ($exp_x != $act_x || $exp_y != $act_y) { + echo "The image size differs: expected {$exp_x}x{$exp_y}, got {$act_x}x{$act_y}.\n"; + save_actual_image($actual); + return; + } + $pixels_changed = 0; + for ($y = 0; $y < $exp_y; $y++) { + for ($x = 0; $x < $exp_x; $x ++) { + $exp_c = imagecolorat($expected, $x, $y); + $act_c = imagecolorat($actual, $x, $y); + if ($exp_c != $act_c) { + $pixels_changed++; + } + } + } + if (!$pixels_changed) { + echo "The images are equal.\n"; + } else { + echo "The images differ in {$pixels_changed} pixels.\n"; + save_actual_image($actual); + } +} + +/** + * Returns the truecolor version of an image. + * + * @param resource $image + * @return resource + */ +function test_to_truecolor($image) +{ + if (imageistruecolor($image)) { + return $image; + } else { + $width = imagesx($image); + $height = imagesy($image); + $result = imagecreatetruecolor($width, $height); + imagecopy($result, $image, 0,0, 0,0, $width, $height); + return $result; + } +} + +/** + * Saves an actual image to disk. + * + * The image is saved right beside the temporary .php test file with the + * extension .out.png. + * + * @param resource $image + * @return void + */ +function save_actual_image($image) +{ + $pathinfo = pathinfo($_SERVER['SCRIPT_FILENAME']); + $filename = "{$pathinfo['dirname']}/{$pathinfo['filename']}.out.png"; + imagepng($image, $filename); +} diff --git a/ext/gd/tests/imagecrop_auto-ext.phpt b/ext/gd/tests/imagecrop_auto-ext.phpt index 60291a69c01..f37b3ca8e21 100644 --- a/ext/gd/tests/imagecrop_auto-ext.phpt +++ b/ext/gd/tests/imagecrop_auto-ext.phpt @@ -1,85 +1,85 @@ ---TEST-- -Testing imagecropauto() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -TC IMG_CROP_DEFAULT -int(99) -int(99) -Palette IMG_CROP_DEFAULT -int(99) -int(99) -TC IMG_CROP_SIDES -int(11) -int(11) -Palette IMG_CROP_SIDES -int(11) -int(11) -TC IMG_CROP_BLACK -int(11) -int(11) -Palette IMG_CROP_BLACK -int(11) -int(11) -IMG_CROP_THRESHOLD -int(240) -int(134) +--TEST-- +Testing imagecropauto() +--SKIPIF-- + +--FILE-- + +--EXPECT-- +TC IMG_CROP_DEFAULT +int(99) +int(99) +Palette IMG_CROP_DEFAULT +int(99) +int(99) +TC IMG_CROP_SIDES +int(11) +int(11) +Palette IMG_CROP_SIDES +int(11) +int(11) +TC IMG_CROP_BLACK +int(11) +int(11) +Palette IMG_CROP_BLACK +int(11) +int(11) +IMG_CROP_THRESHOLD +int(240) +int(134) diff --git a/ext/gd/tests/imagecrop_auto.phpt b/ext/gd/tests/imagecrop_auto.phpt index 8a0f79d3245..07f6b8ae4c1 100644 --- a/ext/gd/tests/imagecrop_auto.phpt +++ b/ext/gd/tests/imagecrop_auto.phpt @@ -1,85 +1,85 @@ ---TEST-- -Testing imagecropauto() ---SKIPIF-- - ---FILE-- - ---EXPECT-- -TC IMG_CROP_DEFAULT -int(11) -int(11) -Palette IMG_CROP_DEFAULT -int(11) -int(11) -TC IMG_CROP_SIDES -int(11) -int(11) -Palette IMG_CROP_SIDES -int(11) -int(11) -TC IMG_CROP_BLACK -int(11) -int(11) -Palette IMG_CROP_BLACK -int(11) -int(11) -IMG_CROP_THRESHOLD -int(240) -int(134) +--TEST-- +Testing imagecropauto() +--SKIPIF-- + +--FILE-- + +--EXPECT-- +TC IMG_CROP_DEFAULT +int(11) +int(11) +Palette IMG_CROP_DEFAULT +int(11) +int(11) +TC IMG_CROP_SIDES +int(11) +int(11) +Palette IMG_CROP_SIDES +int(11) +int(11) +TC IMG_CROP_BLACK +int(11) +int(11) +Palette IMG_CROP_BLACK +int(11) +int(11) +IMG_CROP_THRESHOLD +int(240) +int(134) diff --git a/ext/gd/tests/imageellipse_error8.phpt b/ext/gd/tests/imageellipse_error8.phpt index 3fefb56bde1..d02b97eec36 100644 --- a/ext/gd/tests/imageellipse_error8.phpt +++ b/ext/gd/tests/imageellipse_error8.phpt @@ -1,21 +1,21 @@ ---TEST-- -Testing wrong param passing imageellipse() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-20 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imageellipse() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-20 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imageellipse() expects exactly 6 parameters, %d given in %s on line %d diff --git a/ext/gd/tests/imagefilltoborder_error7.phpt b/ext/gd/tests/imagefilltoborder_error7.phpt index aeb7d82620c..f3313e11f42 100644 --- a/ext/gd/tests/imagefilltoborder_error7.phpt +++ b/ext/gd/tests/imagefilltoborder_error7.phpt @@ -1,26 +1,26 @@ ---TEST-- -Testing wrong param passing imagefilltoborder() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imagefilltoborder() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imagefilltoborder() expects exactly 5 parameters, %d given in %s on line %d diff --git a/ext/gd/tests/imageflip.phpt b/ext/gd/tests/imageflip.phpt index a326e0a2ba4..f4660940a2f 100644 --- a/ext/gd/tests/imageflip.phpt +++ b/ext/gd/tests/imageflip.phpt @@ -1,30 +1,30 @@ ---TEST-- -Testing imageflip() of GD library ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(2) "ff" -string(4) "ff00" -string(6) "ff0000" +--TEST-- +Testing imageflip() of GD library +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(2) "ff" +string(4) "ff00" +string(6) "ff0000" string(2) "ff" \ No newline at end of file diff --git a/ext/gd/tests/imagegammacorrect_variation2.phpt b/ext/gd/tests/imagegammacorrect_variation2.phpt index 4a317b5d906..d314df6c4c9 100644 --- a/ext/gd/tests/imagegammacorrect_variation2.phpt +++ b/ext/gd/tests/imagegammacorrect_variation2.phpt @@ -1,72 +1,72 @@ ---TEST-- -Apply imagegammacorrect() to a step wedge ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -palette gamma (1, 2): The images are equal. -truecolor gamma (1, 2): The images are equal. -palette gamma (1, 1): The images are equal. -truecolor gamma (1, 1): The images are equal. -palette gamma (2, 1): The images are equal. -truecolor gamma (2, 1): The images are equal. -===DONE=== +--TEST-- +Apply imagegammacorrect() to a step wedge +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +palette gamma (1, 2): The images are equal. +truecolor gamma (1, 2): The images are equal. +palette gamma (1, 1): The images are equal. +truecolor gamma (1, 1): The images are equal. +palette gamma (2, 1): The images are equal. +truecolor gamma (2, 1): The images are equal. +===DONE=== diff --git a/ext/gd/tests/imagegd_truecolor.phpt b/ext/gd/tests/imagegd_truecolor.phpt index 1eedae484f3..6787ad30298 100644 --- a/ext/gd/tests/imagegd_truecolor.phpt +++ b/ext/gd/tests/imagegd_truecolor.phpt @@ -1,34 +1,34 @@ ---TEST-- -imagegd() writes truecolor images without palette conversion ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -signature: 65534 -truecolor: 1 -size: 411 -The images are equal. -===DONE=== +--TEST-- +imagegd() writes truecolor images without palette conversion +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +signature: 65534 +truecolor: 1 +size: 411 +The images are equal. +===DONE=== diff --git a/ext/gd/tests/imageopenpolygon_basic.phpt b/ext/gd/tests/imageopenpolygon_basic.phpt index 569cb305b6c..0109cf015ec 100644 --- a/ext/gd/tests/imageopenpolygon_basic.phpt +++ b/ext/gd/tests/imageopenpolygon_basic.phpt @@ -1,29 +1,29 @@ ---TEST-- -imageopenpolygon(): basic test ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -The images are equal. -===DONE=== +--TEST-- +imageopenpolygon(): basic test +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +The images are equal. +===DONE=== diff --git a/ext/gd/tests/imagepolygon_aa.phpt b/ext/gd/tests/imagepolygon_aa.phpt index e868f0c366f..9725bdabe80 100644 --- a/ext/gd/tests/imagepolygon_aa.phpt +++ b/ext/gd/tests/imagepolygon_aa.phpt @@ -1,24 +1,24 @@ ---TEST-- -antialiased imagepolygon() ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -The images are equal. -===DONE=== +--TEST-- +antialiased imagepolygon() +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +The images are equal. +===DONE=== diff --git a/ext/gd/tests/imagerectangle_basic.phpt b/ext/gd/tests/imagerectangle_basic.phpt index 507d7153266..d23cbdfe79b 100644 --- a/ext/gd/tests/imagerectangle_basic.phpt +++ b/ext/gd/tests/imagerectangle_basic.phpt @@ -1,22 +1,22 @@ ---TEST-- -Testing imagerectangle() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -The images are equal. +--TEST-- +Testing imagerectangle() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECT-- +The images are equal. diff --git a/ext/gd/tests/imagerectangle_error1.phpt b/ext/gd/tests/imagerectangle_error1.phpt index 2b4235e8544..3b9e8d3f0ce 100644 --- a/ext/gd/tests/imagerectangle_error1.phpt +++ b/ext/gd/tests/imagerectangle_error1.phpt @@ -1,19 +1,19 @@ ---TEST-- -Testing wrong param passing imagerectangle() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imagerectangle() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imagerectangle() expects parameter 1 to be resource, %s given in %s on line %d diff --git a/ext/gd/tests/imagerectangle_error2.phpt b/ext/gd/tests/imagerectangle_error2.phpt index 5fc1914ad03..63525d2cb78 100644 --- a/ext/gd/tests/imagerectangle_error2.phpt +++ b/ext/gd/tests/imagerectangle_error2.phpt @@ -1,19 +1,19 @@ ---TEST-- -Testing wrong param passing imagerectangle() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imagerectangle() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imagerectangle(): supplied resource is not a valid Image resource in %s on line %d \ No newline at end of file diff --git a/ext/gd/tests/imagerectangle_error3.phpt b/ext/gd/tests/imagerectangle_error3.phpt index eceab1e99ba..350ee1bf826 100644 --- a/ext/gd/tests/imagerectangle_error3.phpt +++ b/ext/gd/tests/imagerectangle_error3.phpt @@ -1,19 +1,19 @@ ---TEST-- -Testing wrong param passing imagerectangle() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imagerectangle() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imagerectangle() expects parameter 2 to be integer, %s given in %s on line %d diff --git a/ext/gd/tests/imagerectangle_error4.phpt b/ext/gd/tests/imagerectangle_error4.phpt index 5d8e1cecac3..4c448dc0272 100644 --- a/ext/gd/tests/imagerectangle_error4.phpt +++ b/ext/gd/tests/imagerectangle_error4.phpt @@ -1,19 +1,19 @@ ---TEST-- -Testing wrong param passing imagerectangle() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imagerectangle() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imagerectangle() expects parameter 3 to be integer, %s given in %s on line %d diff --git a/ext/gd/tests/imagerectangle_error5.phpt b/ext/gd/tests/imagerectangle_error5.phpt index df9c457d6f2..fa9486e3de9 100644 --- a/ext/gd/tests/imagerectangle_error5.phpt +++ b/ext/gd/tests/imagerectangle_error5.phpt @@ -1,19 +1,19 @@ ---TEST-- -Testing wrong param passing imagerectangle() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imagerectangle() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imagerectangle() expects parameter 4 to be integer, %s given in %s on line %d diff --git a/ext/gd/tests/imagerectangle_error6.phpt b/ext/gd/tests/imagerectangle_error6.phpt index a91c6bbc0c7..1523a9ec575 100644 --- a/ext/gd/tests/imagerectangle_error6.phpt +++ b/ext/gd/tests/imagerectangle_error6.phpt @@ -1,19 +1,19 @@ ---TEST-- -Testing wrong param passing imagerectangle() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imagerectangle() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imagerectangle() expects parameter 5 to be integer, %s given in %s on line %d diff --git a/ext/gd/tests/imagerectangle_error7.phpt b/ext/gd/tests/imagerectangle_error7.phpt index f819da6e6ca..ee6326feffb 100644 --- a/ext/gd/tests/imagerectangle_error7.phpt +++ b/ext/gd/tests/imagerectangle_error7.phpt @@ -1,19 +1,19 @@ ---TEST-- -Testing wrong param passing imagerectangle() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imagerectangle() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imagerectangle() expects parameter 6 to be integer, %s given in %s on line %d diff --git a/ext/gd/tests/imagerectangle_error8.phpt b/ext/gd/tests/imagerectangle_error8.phpt index 361de69cde5..cb0746e4923 100644 --- a/ext/gd/tests/imagerectangle_error8.phpt +++ b/ext/gd/tests/imagerectangle_error8.phpt @@ -1,19 +1,19 @@ ---TEST-- -Testing wrong param passing imagerectangle() of GD library ---CREDITS-- -Ivan Rosolen -#testfest PHPSP on 2009-06-30 ---SKIPIF-- - ---FILE-- - ---EXPECTF-- +--TEST-- +Testing wrong param passing imagerectangle() of GD library +--CREDITS-- +Ivan Rosolen +#testfest PHPSP on 2009-06-30 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- Warning: imagerectangle() expects exactly 6 parameters, %d given in %s on line %d diff --git a/ext/gd/tests/test_image_equals_file_palette.phpt b/ext/gd/tests/test_image_equals_file_palette.phpt index 130fa432024..0cfea7f415e 100644 --- a/ext/gd/tests/test_image_equals_file_palette.phpt +++ b/ext/gd/tests/test_image_equals_file_palette.phpt @@ -1,42 +1,42 @@ ---TEST-- -test_image_equals_file(): comparing palette images ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -The images differ in 25 pixels. -The images are equal. -===DONE=== ---CLEAN-- - +--TEST-- +test_image_equals_file(): comparing palette images +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +The images differ in 25 pixels. +The images are equal. +===DONE=== +--CLEAN-- + diff --git a/ext/gd/tests/webp_basic.phpt b/ext/gd/tests/webp_basic.phpt index 55436741dbd..593e43c8070 100644 --- a/ext/gd/tests/webp_basic.phpt +++ b/ext/gd/tests/webp_basic.phpt @@ -1,38 +1,38 @@ ---TEST-- -imagewebp() and imagecreatefromwebp() - basic test ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECT-- -bool(true) +--TEST-- +imagewebp() and imagecreatefromwebp() - basic test +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +bool(true) diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c index 8923a8c55da..527cb99045e 100644 --- a/ext/interbase/ibase_query.c +++ b/ext/interbase/ibase_query.c @@ -1887,7 +1887,7 @@ PHP_FUNCTION(ibase_num_fields) if (type == le_query) { ibase_query *ib_query; - + ib_query = (ibase_query *)zend_fetch_resource_ex(result, LE_QUERY, le_query); sqlda = ib_query->out_sqlda; } else { diff --git a/ext/intl/tests/calendar_getDayOfWeekType_basic.phpt b/ext/intl/tests/calendar_getDayOfWeekType_basic.phpt index 324e229de5c..618fcdb0d47 100644 --- a/ext/intl/tests/calendar_getDayOfWeekType_basic.phpt +++ b/ext/intl/tests/calendar_getDayOfWeekType_basic.phpt @@ -31,4 +31,4 @@ int(0) int(0) int(0) int(1) -==DONE== +==DONE== diff --git a/ext/intl/tests/calendar_getNow_basic.phpt b/ext/intl/tests/calendar_getNow_basic.phpt index 2df112d7b23..3f1c2488b37 100644 --- a/ext/intl/tests/calendar_getNow_basic.phpt +++ b/ext/intl/tests/calendar_getNow_basic.phpt @@ -20,4 +20,4 @@ var_dump(abs($time * 1000 - $proc_now) < 2000); --EXPECT-- bool(true) bool(true) -==DONE== +==DONE== diff --git a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_basic.phpt b/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_basic.phpt index 998e74bc01d..ac437f962b9 100644 --- a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_basic.phpt +++ b/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_basic.phpt @@ -23,4 +23,4 @@ bool(true) int(6) bool(true) int(5) -==DONE== +==DONE== diff --git a/ext/intl/tests/dateformat_formatObject_calendar.phpt b/ext/intl/tests/dateformat_formatObject_calendar.phpt index 9365387ce68..b2b08f362d4 100644 --- a/ext/intl/tests/dateformat_formatObject_calendar.phpt +++ b/ext/intl/tests/dateformat_formatObject_calendar.phpt @@ -1,41 +1,41 @@ ---TEST-- -IntlDateFormatter::formatObject(): IntlCalendar tests ---SKIPIF-- - -= 0) die('skip for ICU < 50.1.2'); ?> ---FILE-- -setTime(strtotime('2012-01-01 00:00:00')*1000.); -echo IntlDateFormatter::formatObject($cal), "\n"; -echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n"; - -?> -==DONE== - ---EXPECTF-- -01/01/2012 00:00:00 -Domingo, 1 de Janeiro de 2012 0:00:00 Hora %Sda Europa Ocidental -Jan 1, 2012 12:00:00 AM -1/1/12 12:00:00 AM Western European %STime -Sun 2012-01-1 00,00,00.000 Portugal Time (Lisbon) -Domingo, 1 de Janeiro de 2012 5:00:00 GMT+03:00 -06/02/1433 00:00:00 -Sunday, Safar 6, 1433 12:00:00 AM Western European %STime -==DONE== - +--TEST-- +IntlDateFormatter::formatObject(): IntlCalendar tests +--SKIPIF-- + += 0) die('skip for ICU < 50.1.2'); ?> +--FILE-- +setTime(strtotime('2012-01-01 00:00:00')*1000.); +echo IntlDateFormatter::formatObject($cal), "\n"; +echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n"; + +?> +==DONE== + +--EXPECTF-- +01/01/2012 00:00:00 +Domingo, 1 de Janeiro de 2012 0:00:00 Hora %Sda Europa Ocidental +Jan 1, 2012 12:00:00 AM +1/1/12 12:00:00 AM Western European %STime +Sun 2012-01-1 00,00,00.000 Portugal Time (Lisbon) +Domingo, 1 de Janeiro de 2012 5:00:00 GMT+03:00 +06/02/1433 00:00:00 +Sunday, Safar 6, 1433 12:00:00 AM Western European %STime +==DONE== + diff --git a/ext/intl/tests/dateformat_formatObject_calendar_variant2.phpt b/ext/intl/tests/dateformat_formatObject_calendar_variant2.phpt index d59c635a7df..688ccc31bfc 100644 --- a/ext/intl/tests/dateformat_formatObject_calendar_variant2.phpt +++ b/ext/intl/tests/dateformat_formatObject_calendar_variant2.phpt @@ -1,10 +1,10 @@ ---TEST-- -IntlDateFormatter::formatObject(): IntlCalendar tests ---SKIPIF-- - = 0) die('skip for ICU >= 51.2 and < 52.1'); ?> ---FILE-- +--FILE-- ==DONE== - ---EXPECTF-- + +--EXPECTF-- 01/01/2012, 00:00:00 Domingo, 1 de Janeiro de 2012 às 00:00:00 Hora %Sda Europa Ocidental Jan 1, 2012, 12:00:00 AM diff --git a/ext/intl/tests/dateformat_formatObject_datetime.phpt b/ext/intl/tests/dateformat_formatObject_datetime.phpt index 2c9e1e33be6..a2cba4c76bc 100644 --- a/ext/intl/tests/dateformat_formatObject_datetime.phpt +++ b/ext/intl/tests/dateformat_formatObject_datetime.phpt @@ -1,34 +1,34 @@ ---TEST-- -IntlDateFormatter::formatObject(): DateTime tests ---SKIPIF-- - -= 0) die('skip for ICU < 50.1.2'); ?> ---FILE-- - -==DONE== - ---EXPECTF-- -01/01/2012 00:00:00 -Domingo, 1 de Janeiro de 2012 0:00:00 Hora %Sda Europa Ocidental -Jan 1, 2012 12:00:00 AM -1/1/12 12:00:00 AM Western European %STime -Sun 2012-01-1 00,00,00.000 Portugal Time (Lisbon) -Domingo, 1 de Janeiro de 2012 5:00:00 GMT+03:00 -==DONE== - +--TEST-- +IntlDateFormatter::formatObject(): DateTime tests +--SKIPIF-- + += 0) die('skip for ICU < 50.1.2'); ?> +--FILE-- + +==DONE== + +--EXPECTF-- +01/01/2012 00:00:00 +Domingo, 1 de Janeiro de 2012 0:00:00 Hora %Sda Europa Ocidental +Jan 1, 2012 12:00:00 AM +1/1/12 12:00:00 AM Western European %STime +Sun 2012-01-1 00,00,00.000 Portugal Time (Lisbon) +Domingo, 1 de Janeiro de 2012 5:00:00 GMT+03:00 +==DONE== + diff --git a/ext/intl/tests/dateformat_formatObject_datetime_variant2.phpt b/ext/intl/tests/dateformat_formatObject_datetime_variant2.phpt index b4e59f5b7ee..567a7eb8497 100644 --- a/ext/intl/tests/dateformat_formatObject_datetime_variant2.phpt +++ b/ext/intl/tests/dateformat_formatObject_datetime_variant2.phpt @@ -1,10 +1,10 @@ ---TEST-- -IntlDateFormatter::formatObject(): DateTime tests ---SKIPIF-- - = 0) die('skip for ICU >= 51.2 and < 52.1'); ?> ---FILE-- +--FILE-- ==DONE== - ---EXPECTF-- + +--EXPECTF-- 01/01/2012, 00:00:00 Domingo, 1 de Janeiro de 2012 às 00:00:00 Hora %Sda Europa Ocidental Jan 1, 2012, 12:00:00 AM diff --git a/ext/intl/tests/dateformat_formatObject_error.phpt b/ext/intl/tests/dateformat_formatObject_error.phpt index 7aaf69e54e6..221602d1359 100644 --- a/ext/intl/tests/dateformat_formatObject_error.phpt +++ b/ext/intl/tests/dateformat_formatObject_error.phpt @@ -1,10 +1,10 @@ ---TEST-- -IntlDateFormatter::formatObject(): error conditions ---SKIPIF-- - ==DONE== - ---EXPECTF-- + +--EXPECTF-- Warning: IntlDateFormatter::formatObject() expects at least 1 parameter, 0 given in %s on line %d bool(false) @@ -71,4 +71,4 @@ bool(false) Warning: IntlDateFormatter::formatObject() expects parameter 3 to be string, array given in %s on line %d bool(false) ==DONE== - + diff --git a/ext/intl/tests/timezone_createDefault_basic.phpt b/ext/intl/tests/timezone_createDefault_basic.phpt index 1988d3b9e54..f8e3158cec8 100644 --- a/ext/intl/tests/timezone_createDefault_basic.phpt +++ b/ext/intl/tests/timezone_createDefault_basic.phpt @@ -28,4 +28,4 @@ IntlTimeZone Object [rawOffset] => %i [currentOffset] => %i ) -==DONE== +==DONE== diff --git a/ext/intl/tests/timezone_getCanonicalID_variant1.phpt b/ext/intl/tests/timezone_getCanonicalID_variant1.phpt index d600792d7cf..182fe15b608 100644 --- a/ext/intl/tests/timezone_getCanonicalID_variant1.phpt +++ b/ext/intl/tests/timezone_getCanonicalID_variant1.phpt @@ -20,4 +20,4 @@ string(13) "Europe/Lisbon" bool(true) string(0) "" bool(false) -==DONE== +==DONE== diff --git a/ext/intl/tests/timezone_getDisplayName_variant4.phpt b/ext/intl/tests/timezone_getDisplayName_variant4.phpt index 39e28892a44..c8379d34a03 100644 --- a/ext/intl/tests/timezone_getDisplayName_variant4.phpt +++ b/ext/intl/tests/timezone_getDisplayName_variant4.phpt @@ -32,4 +32,4 @@ string(5) "+0000" string(3) "GMT" string(3) "GMT" string(13) "Portugal Time" -==DONE== +==DONE== diff --git a/ext/mbstring/tests/bug52981.phpt b/ext/mbstring/tests/bug52981.phpt index fe96a56f083..7dce14a7adf 100644 --- a/ext/mbstring/tests/bug52981.phpt +++ b/ext/mbstring/tests/bug52981.phpt @@ -1,23 +1,23 @@ ---TEST-- -Bug #52981 (Unicode properties are outdated (from Unicode 3.2)) ---SKIPIF-- - ---FILE-- - +--FILE-- + ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Input: 1 - -Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 - Length: 1 - Hex: %x - -Input: 2 - -Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 - Length: 2 - Hex: %x - -Input: 4 - -Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 - Length: 4 - Hex: %x - -Input: 8 - -Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 - Length: 8 - Hex: %x - -Input: 16 - -Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 - Length: 16 - Hex: %x - -Input: 32 - -Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 - Length: 32 - Hex: %x - -Input: 64 - -Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 - Length: 64 - Hex: %x +--TEST-- +mcrypt_create_iv https://bugs.php.net/bug.php?id=55169 +--CREDIT-- +Ryan Biesemeyer +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Input: 1 + +Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 + Length: 1 + Hex: %x + +Input: 2 + +Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 + Length: 2 + Hex: %x + +Input: 4 + +Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 + Length: 4 + Hex: %x + +Input: 8 + +Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 + Length: 8 + Hex: %x + +Input: 16 + +Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 + Length: 16 + Hex: %x + +Input: 32 + +Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 + Length: 32 + Hex: %x + +Input: 64 + +Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 + Length: 64 + Hex: %x diff --git a/ext/mysqli/tests/bug53503.phpt b/ext/mysqli/tests/bug53503.phpt index 339fce7a8e6..a34b7a3416d 100644 --- a/ext/mysqli/tests/bug53503.phpt +++ b/ext/mysqli/tests/bug53503.phpt @@ -1,66 +1,66 @@ ---TEST-- -Bug #53503 (mysqli::query returns false after successful LOAD DATA query) ---SKIPIF-- -errno, $link->error)); - -mysqli_close($link); - -?> ---FILE-- -query("DROP TABLE IF EXISTS test")) { - printf("[002] [%d] %s\n", $link->errno, $link->error); - } - - if (!$link->query("CREATE TABLE test (dump1 INT UNSIGNED NOT NULL PRIMARY KEY) ENGINE=" . $engine)) { - printf("[003] [%d] %s\n", $link->errno, $link->error); - } - - if (FALSE == file_put_contents('bug53503.data', "1\n2\n3\n")) - printf("[004] Failed to create CVS file\n"); - - if (!$link->query("SELECT 1 FROM DUAL")) - printf("[005] [%d] %s\n", $link->errno, $link->error); - - if (!$link->query("LOAD DATA LOCAL INFILE 'bug53503.data' INTO TABLE test")) { - printf("[006] [%d] %s\n", $link->errno, $link->error); - echo "bug"; - } else { - echo "done"; - } - $link->close(); -?> ---CLEAN-- -query($link, 'DROP TABLE IF EXISTS test')) { - printf("[clean] Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); -} - -$link->close(); - -unlink('bug53503.data'); -?> ---EXPECT-- +--TEST-- +Bug #53503 (mysqli::query returns false after successful LOAD DATA query) +--SKIPIF-- +errno, $link->error)); + +mysqli_close($link); + +?> +--FILE-- +query("DROP TABLE IF EXISTS test")) { + printf("[002] [%d] %s\n", $link->errno, $link->error); + } + + if (!$link->query("CREATE TABLE test (dump1 INT UNSIGNED NOT NULL PRIMARY KEY) ENGINE=" . $engine)) { + printf("[003] [%d] %s\n", $link->errno, $link->error); + } + + if (FALSE == file_put_contents('bug53503.data', "1\n2\n3\n")) + printf("[004] Failed to create CVS file\n"); + + if (!$link->query("SELECT 1 FROM DUAL")) + printf("[005] [%d] %s\n", $link->errno, $link->error); + + if (!$link->query("LOAD DATA LOCAL INFILE 'bug53503.data' INTO TABLE test")) { + printf("[006] [%d] %s\n", $link->errno, $link->error); + echo "bug"; + } else { + echo "done"; + } + $link->close(); +?> +--CLEAN-- +query($link, 'DROP TABLE IF EXISTS test')) { + printf("[clean] Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link)); +} + +$link->close(); + +unlink('bug53503.data'); +?> +--EXPECT-- done \ No newline at end of file diff --git a/ext/mysqli/tests/bug55653.phpt b/ext/mysqli/tests/bug55653.phpt index f9cd297eba3..1caff1a27a8 100644 --- a/ext/mysqli/tests/bug55653.phpt +++ b/ext/mysqli/tests/bug55653.phpt @@ -1,36 +1,36 @@ ---TEST-- -Bug #55653 PS crash with libmysql when binding same variable as param and out ---SKIPIF-- - ---FILE-- -stmt_init())) - printf("[002] [%d] %s\n", $link->errno, $link->error); - - if (!($stmt->prepare("SELECT ?")) || - !($stmt->bind_param("s", $in_and_out)) || - !($stmt->execute()) || - !($stmt->bind_result($in_and_out))) - printf("[003] [%d] %s\n", $stmt->errno, $stmt->error); - - if (!$stmt->fetch()) - printf("[004] [%d] %s\n", $stmt->errno, $stmt->error); - - if ("a" !== $in_and_out) - printf("[005] Wrong result: '%s'\n", $in_and_out); - - echo "done!"; -?> ---EXPECT-- +--TEST-- +Bug #55653 PS crash with libmysql when binding same variable as param and out +--SKIPIF-- + +--FILE-- +stmt_init())) + printf("[002] [%d] %s\n", $link->errno, $link->error); + + if (!($stmt->prepare("SELECT ?")) || + !($stmt->bind_param("s", $in_and_out)) || + !($stmt->execute()) || + !($stmt->bind_result($in_and_out))) + printf("[003] [%d] %s\n", $stmt->errno, $stmt->error); + + if (!$stmt->fetch()) + printf("[004] [%d] %s\n", $stmt->errno, $stmt->error); + + if ("a" !== $in_and_out) + printf("[005] Wrong result: '%s'\n", $in_and_out); + + echo "done!"; +?> +--EXPECT-- done! \ No newline at end of file diff --git a/ext/mysqli/tests/bug55859.phpt b/ext/mysqli/tests/bug55859.phpt index ba6e9902b34..04467bce24e 100644 --- a/ext/mysqli/tests/bug55859.phpt +++ b/ext/mysqli/tests/bug55859.phpt @@ -1,20 +1,20 @@ ---TEST-- -Bug #55859 mysqli->stat property access gives error ---SKIPIF-- - ---FILE-- -stat)); - echo "done!"; -?> ---EXPECT-- -bool(true) -done! +--TEST-- +Bug #55859 mysqli->stat property access gives error +--SKIPIF-- + +--FILE-- +stat)); + echo "done!"; +?> +--EXPECT-- +bool(true) +done! diff --git a/ext/mysqli/tests/bug62046.phpt b/ext/mysqli/tests/bug62046.phpt index 31a7328b701..c8ad3c36754 100644 --- a/ext/mysqli/tests/bug62046.phpt +++ b/ext/mysqli/tests/bug62046.phpt @@ -1,40 +1,40 @@ ---TEST-- -Bug #62046 mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset() ---SKIPIF-- - ---FILE-- -prepare('SELECT 42'))) { - printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - } - if (FALSE === $stmt->execute()) { - printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error); - } - if (FALSE === $stmt->store_result()) { - printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); - } - $one = NULL; - if (FALSE === $stmt->bind_result($one)) { - printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); - } - if (FALSE === $stmt->reset()) { - printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); - } - while ($stmt->fetch()) { - var_dump($one); - } - $stmt->close(); - $link->close(); - echo "done!"; -?> ---EXPECT-- -int(42) +--TEST-- +Bug #62046 mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset() +--SKIPIF-- + +--FILE-- +prepare('SELECT 42'))) { + printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); + } + if (FALSE === $stmt->execute()) { + printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + if (FALSE === $stmt->store_result()) { + printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + $one = NULL; + if (FALSE === $stmt->bind_result($one)) { + printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + if (FALSE === $stmt->reset()) { + printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error); + } + while ($stmt->fetch()) { + var_dump($one); + } + $stmt->close(); + $link->close(); + echo "done!"; +?> +--EXPECT-- +int(42) done! \ No newline at end of file diff --git a/ext/mysqli/tests/bug62885.phpt b/ext/mysqli/tests/bug62885.phpt index 9fb0aa0f030..4d024755708 100644 --- a/ext/mysqli/tests/bug62885.phpt +++ b/ext/mysqli/tests/bug62885.phpt @@ -1,26 +1,26 @@ ---TEST-- -Bug #62885 (mysqli_poll - Segmentation fault) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d - -Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d -okey +--TEST-- +Bug #62885 (mysqli_poll - Segmentation fault) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d + +Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d +okey diff --git a/ext/oci8/tests/bug72524.phpt b/ext/oci8/tests/bug72524.phpt index dde99b000c1..45ce8c7d5b5 100644 --- a/ext/oci8/tests/bug72524.phpt +++ b/ext/oci8/tests/bug72524.phpt @@ -1,96 +1,96 @@ ---TEST-- -Bug #72524 (Binding null values triggers ORA-24816 error) ---SKIPIF-- - true, 'timesten' => true); // test runs on these DBs -require(dirname(__FILE__).'/skipif.inc'); -?> ---FILE-- - - -===DONE=== - ---EXPECTF-- -Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default -bool(true) -Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default -bool(true) -Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default -bool(true) -Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default - -Warning: oci_execute(): ORA-24816: %s in %s on line %d -bool(false) -Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default - -Warning: oci_execute(): ORA-24816: %s in %s on line %d -bool(false) -===DONE=== +--TEST-- +Bug #72524 (Binding null values triggers ORA-24816 error) +--SKIPIF-- + true, 'timesten' => true); // test runs on these DBs +require(dirname(__FILE__).'/skipif.inc'); +?> +--FILE-- + + +===DONE=== + +--EXPECTF-- +Test 1 - P1 Value: NULL P1 Length: Default P1 Type: Default P2 Value: NULL P2 Length: Default P2 Type: Default +bool(true) +Test 2 - P1 Value: '' P1 Length: Default P1 Type: Default P2 Value: '' P2 Length: Default P2 Type: Default +bool(true) +Test 3 - P1 Value: 'abc' P1 Length: 0 P1 Type: Default P2 Value: '' P2 Length: 0 P2 Type: Default +bool(true) +Test 4 - P1 Value: NULL P1 Length: -1 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: -1 P2 Type:Default + +Warning: oci_execute(): ORA-24816: %s in %s on line %d +bool(false) +Test 5 - P1 Value: NULL P1 Length: 0 P1 Type: SQLT_LNG P2 Value: NULL P2 Length: 0 P2 Type:Default + +Warning: oci_execute(): ORA-24816: %s in %s on line %d +bool(false) +===DONE=== diff --git a/ext/openssl/tests/bug61124.phpt b/ext/openssl/tests/bug61124.phpt index 9b21da50484..4b6194bdb4d 100644 --- a/ext/openssl/tests/bug61124.phpt +++ b/ext/openssl/tests/bug61124.phpt @@ -1,12 +1,12 @@ ---TEST-- -Bug #61124: Segmentation fault with openssl_decrypt ---SKIPIF-- - ---FILE-- -= the resp. constant in php_pcre.c - -var_dump(preg_replace_callback('/a/', function($m) { - for ($i = 0; $i < PREG_CACHE_SIZE; $i++) { - preg_match('/foo' . $i . 'bar/', '???foo' . $i . 'bar???'); - } - return 'b'; -}, 'aa')); -var_dump(preg_replace_callback('/a/', function($m) { - for ($i = 0; $i < PREG_CACHE_SIZE; $i++) { - preg_replace('/foo' . $i . 'bar/', 'baz', '???foo' . $i . 'bar???'); - } - return 'b'; -}, 'aa')); -var_dump(preg_replace_callback('/a/', function($m) { - for ($i = 0; $i < PREG_CACHE_SIZE; $i++) { - preg_split('/foo' . $i . 'bar/', '???foo' . $i . 'bar???'); - } - return 'b'; -}, 'aa')); -var_dump(preg_replace_callback('/a/', function($m) { - for ($i = 0; $i < PREG_CACHE_SIZE; $i++) { - preg_grep('/foo' . $i . 'bar/', ['???foo' . $i . 'bar???']); - } - return 'b'; -}, 'aa')); -?> ---EXPECT-- -string(2) "bb" -string(2) "bb" -string(2) "bb" -string(2) "bb" +--TEST-- +Bug #69864 (Segfault in preg_replace_callback) +--SKIPIF-- + +--FILE-- += the resp. constant in php_pcre.c + +var_dump(preg_replace_callback('/a/', function($m) { + for ($i = 0; $i < PREG_CACHE_SIZE; $i++) { + preg_match('/foo' . $i . 'bar/', '???foo' . $i . 'bar???'); + } + return 'b'; +}, 'aa')); +var_dump(preg_replace_callback('/a/', function($m) { + for ($i = 0; $i < PREG_CACHE_SIZE; $i++) { + preg_replace('/foo' . $i . 'bar/', 'baz', '???foo' . $i . 'bar???'); + } + return 'b'; +}, 'aa')); +var_dump(preg_replace_callback('/a/', function($m) { + for ($i = 0; $i < PREG_CACHE_SIZE; $i++) { + preg_split('/foo' . $i . 'bar/', '???foo' . $i . 'bar???'); + } + return 'b'; +}, 'aa')); +var_dump(preg_replace_callback('/a/', function($m) { + for ($i = 0; $i < PREG_CACHE_SIZE; $i++) { + preg_grep('/foo' . $i . 'bar/', ['???foo' . $i . 'bar???']); + } + return 'b'; +}, 'aa')); +?> +--EXPECT-- +string(2) "bb" +string(2) "bb" +string(2) "bb" +string(2) "bb" diff --git a/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt b/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt index fb7e9a9d0a4..4528213f11e 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_connect_charset.phpt @@ -1,33 +1,33 @@ ---TEST-- -PDO_MYSQL: Defining a connection charset in the DSN ---SKIPIF-- - ---FILE-- -query("SHOW VARIABLES LIKE 'character_set_connection'")->fetchObject()->value; - - /* Make sure that we don't attempt to set the current character set to make this case useful */ - $new_charset = ($charset == 'latin1' ? 'ascii' : 'latin1'); - - /* Done with the original connection, create a second link to test the character set being defined */ - unset($link); - - $link = MySQLPDOTest::factory('PDO', false, null, Array('charset' => $new_charset)); - $conn_charset = $link->query("SHOW VARIABLES LIKE 'character_set_connection'")->fetchObject()->value; - - if ($charset !== $conn_charset) { - echo "done!\n"; - } else { - echo "failed!\n"; - } -?> ---EXPECTF-- -done! +--TEST-- +PDO_MYSQL: Defining a connection charset in the DSN +--SKIPIF-- + +--FILE-- +query("SHOW VARIABLES LIKE 'character_set_connection'")->fetchObject()->value; + + /* Make sure that we don't attempt to set the current character set to make this case useful */ + $new_charset = ($charset == 'latin1' ? 'ascii' : 'latin1'); + + /* Done with the original connection, create a second link to test the character set being defined */ + unset($link); + + $link = MySQLPDOTest::factory('PDO', false, null, Array('charset' => $new_charset)); + $conn_charset = $link->query("SHOW VARIABLES LIKE 'character_set_connection'")->fetchObject()->value; + + if ($charset !== $conn_charset) { + echo "done!\n"; + } else { + echo "failed!\n"; + } +?> +--EXPECTF-- +done! diff --git a/ext/pgsql/tests/30nb_async_query_params.phpt b/ext/pgsql/tests/30nb_async_query_params.phpt index a88769b0381..1c8a1eed8f0 100755 --- a/ext/pgsql/tests/30nb_async_query_params.phpt +++ b/ext/pgsql/tests/30nb_async_query_params.phpt @@ -1,78 +1,78 @@ ---TEST-- -PostgreSQL non-blocking async query params ---SKIPIF-- - ---FILE-- - \$1;", array(100)); -if ($sent === FALSE) { - echo "pg_send_query_params() error\n"; -} elseif ($sent === 0) { - nb_flush($db, $db_socket); -} - -nb_consume($db, $db_socket); - -if (!($result = pg_get_result($db))) { - echo "pg_get_result() error\n"; -} -if (!($rows = pg_num_rows($result))) { - echo "pg_num_rows() error\n"; -} -for ($i=0; $i < $rows; $i++) { - pg_fetch_array($result, $i, PGSQL_NUM); -} -for ($i=0; $i < $rows; $i++) { - pg_fetch_object($result); -} -for ($i=0; $i < $rows; $i++) { - pg_fetch_row($result, $i); -} -for ($i=0; $i < $rows; $i++) { - pg_fetch_result($result, $i, 0); -} - -pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); -pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); -pg_field_name($result, 0); -pg_field_num($result, $field_name); -pg_field_size($result, 0); -pg_field_type($result, 0); -pg_field_prtlen($result, 0); -pg_field_is_null($result, 0); - -$sent = pg_send_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC")); - -if ($sent === FALSE) { - echo "pg_send_query_params() error\n"; -} elseif ($sent === 0) { - nb_flush($db, $db_socket); -} - -pg_last_oid($result); -pg_free_result($result); - -pg_close($db); - -echo "OK"; -?> ---EXPECT-- -OK +--TEST-- +PostgreSQL non-blocking async query params +--SKIPIF-- + +--FILE-- + \$1;", array(100)); +if ($sent === FALSE) { + echo "pg_send_query_params() error\n"; +} elseif ($sent === 0) { + nb_flush($db, $db_socket); +} + +nb_consume($db, $db_socket); + +if (!($result = pg_get_result($db))) { + echo "pg_get_result() error\n"; +} +if (!($rows = pg_num_rows($result))) { + echo "pg_num_rows() error\n"; +} +for ($i=0; $i < $rows; $i++) { + pg_fetch_array($result, $i, PGSQL_NUM); +} +for ($i=0; $i < $rows; $i++) { + pg_fetch_object($result); +} +for ($i=0; $i < $rows; $i++) { + pg_fetch_row($result, $i); +} +for ($i=0; $i < $rows; $i++) { + pg_fetch_result($result, $i, 0); +} + +pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); +pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))); +pg_field_name($result, 0); +pg_field_num($result, $field_name); +pg_field_size($result, 0); +pg_field_type($result, 0); +pg_field_prtlen($result, 0); +pg_field_is_null($result, 0); + +$sent = pg_send_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC")); + +if ($sent === FALSE) { + echo "pg_send_query_params() error\n"; +} elseif ($sent === 0) { + nb_flush($db, $db_socket); +} + +pg_last_oid($result); +pg_free_result($result); + +pg_close($db); + +echo "OK"; +?> +--EXPECT-- +OK diff --git a/ext/phar/tests/bug53872.phpt b/ext/phar/tests/bug53872.phpt index fd332fdf027..2fc55d9155a 100644 --- a/ext/phar/tests/bug53872.phpt +++ b/ext/phar/tests/bug53872.phpt @@ -1,28 +1,28 @@ ---TEST-- -bug#53872 (internal corruption of phar) ---SKIPIF-- - ---INI-- -phar.readonly=0 ---FILE-- -buildFromDirectory(__DIR__ . "/bug53872/"); -$p->setStub(''); -$p->compressFiles(Phar::GZ); - -print(file_get_contents('phar://bug53872-phar.phar/first.txt')); -print(file_get_contents('phar://bug53872-phar.phar/second.txt')); -print(file_get_contents('phar://bug53872-phar.phar/third.txt')); -?> ---CLEAN-- - ---EXPECT-- -content of first.txt -content of third.txt - +--TEST-- +bug#53872 (internal corruption of phar) +--SKIPIF-- + +--INI-- +phar.readonly=0 +--FILE-- +buildFromDirectory(__DIR__ . "/bug53872/"); +$p->setStub(''); +$p->compressFiles(Phar::GZ); + +print(file_get_contents('phar://bug53872-phar.phar/first.txt')); +print(file_get_contents('phar://bug53872-phar.phar/second.txt')); +print(file_get_contents('phar://bug53872-phar.phar/third.txt')); +?> +--CLEAN-- + +--EXPECT-- +content of first.txt +content of third.txt + diff --git a/ext/phar/tests/phar_gobyebye-win32.phpt b/ext/phar/tests/phar_gobyebye-win32.phpt index 43c8c77823b..526a8cbf915 100644 --- a/ext/phar/tests/phar_gobyebye-win32.phpt +++ b/ext/phar/tests/phar_gobyebye-win32.phpt @@ -1,48 +1,48 @@ ---TEST-- -Phar: test edge cases of intercepted functions when the underlying phar archive has been unlinkArchive()d ---SKIPIF-- - ---INI-- -phar.readonly=0 ---FILE-- - -'); -include $pname . '/foo/hi'; -?> -===DONE=== ---CLEAN-- - - ---EXPECTF-- -Warning: readfile(foo/hi): failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d - -Warning: fopen(foo/hi): failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d - -Warning: file_get_contents(foo/hi): failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d - -Warning: stat(): stat failed for foo/hi in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d -bool(false) -bool(false) -bool(false) -bool(false) -bool(false) - -Warning: opendir(foo/hi,foo/hi): The system cannot find the path specified. (code: 3) in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d - -Warning: opendir(foo/hi): failed to open dir: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d -===DONE=== +--TEST-- +Phar: test edge cases of intercepted functions when the underlying phar archive has been unlinkArchive()d +--SKIPIF-- + +--INI-- +phar.readonly=0 +--FILE-- + +'); +include $pname . '/foo/hi'; +?> +===DONE=== +--CLEAN-- + + +--EXPECTF-- +Warning: readfile(foo/hi): failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d + +Warning: fopen(foo/hi): failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d + +Warning: file_get_contents(foo/hi): failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d + +Warning: stat(): stat failed for foo/hi in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) + +Warning: opendir(foo/hi,foo/hi): The system cannot find the path specified. (code: 3) in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d + +Warning: opendir(foo/hi): failed to open dir: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d +===DONE=== diff --git a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt index 5655d19972a..942bea2dc23 100644 --- a/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt +++ b/ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt @@ -1,76 +1,76 @@ ---TEST-- -ReflectionParameter class - canBePassedByValue() method. ---FILE-- -getParameters(); - foreach($parameters as $parameter) { - echo "Name: ", $parameter->getName(), "\n"; - echo "Is passed by reference: ", $parameter->isPassedByReference()?"yes":"no", "\n"; - echo "Can be passed by value: ", $parameter->canBePassedByValue()?"yes":"no", "\n"; - echo "\n"; - } - -} - -echo "=> array_multisort:\n\n"; - -aux('array_multisort'); - - -echo "=> sort:\n\n"; - -aux('sort'); - -echo "=> user function:\n\n"; - -function ufunc(&$arg1, $arg2) {} - -aux('ufunc'); - -echo "Done.\n"; - -?> ---EXPECTF-- -=> array_multisort: - -Name: arr1 -Is passed by reference: yes -Can be passed by value: yes - -Name: sort_order -Is passed by reference: yes -Can be passed by value: yes - -Name: sort_flags -Is passed by reference: yes -Can be passed by value: yes - -Name: arr2 -Is passed by reference: yes -Can be passed by value: yes - -=> sort: - -Name: arg -Is passed by reference: yes -Can be passed by value: no - -Name: sort_flags -Is passed by reference: no -Can be passed by value: yes - -=> user function: - -Name: arg1 -Is passed by reference: yes -Can be passed by value: no - -Name: arg2 -Is passed by reference: no -Can be passed by value: yes - -Done. +--TEST-- +ReflectionParameter class - canBePassedByValue() method. +--FILE-- +getParameters(); + foreach($parameters as $parameter) { + echo "Name: ", $parameter->getName(), "\n"; + echo "Is passed by reference: ", $parameter->isPassedByReference()?"yes":"no", "\n"; + echo "Can be passed by value: ", $parameter->canBePassedByValue()?"yes":"no", "\n"; + echo "\n"; + } + +} + +echo "=> array_multisort:\n\n"; + +aux('array_multisort'); + + +echo "=> sort:\n\n"; + +aux('sort'); + +echo "=> user function:\n\n"; + +function ufunc(&$arg1, $arg2) {} + +aux('ufunc'); + +echo "Done.\n"; + +?> +--EXPECTF-- +=> array_multisort: + +Name: arr1 +Is passed by reference: yes +Can be passed by value: yes + +Name: sort_order +Is passed by reference: yes +Can be passed by value: yes + +Name: sort_flags +Is passed by reference: yes +Can be passed by value: yes + +Name: arr2 +Is passed by reference: yes +Can be passed by value: yes + +=> sort: + +Name: arg +Is passed by reference: yes +Can be passed by value: no + +Name: sort_flags +Is passed by reference: no +Can be passed by value: yes + +=> user function: + +Name: arg1 +Is passed by reference: yes +Can be passed by value: no + +Name: arg2 +Is passed by reference: no +Can be passed by value: yes + +Done. diff --git a/ext/reflection/tests/ReflectionParameter_isDefault.phpt b/ext/reflection/tests/ReflectionParameter_isDefault.phpt index 657077093b7..d8b4f0edc0c 100644 --- a/ext/reflection/tests/ReflectionParameter_isDefault.phpt +++ b/ext/reflection/tests/ReflectionParameter_isDefault.phpt @@ -1,34 +1,34 @@ ---TEST-- -ReflectionParameter::isDefault() ---FILE-- -myprop = null; - -$ro = new ReflectionObject($a); -$props = $ro->getProperties(); -$prop1 = $props[0]; -var_dump($prop1->isDefault()); -$prop2 = $props[1]; -var_dump($prop2->isDefault()); - -var_dump($ro->getProperty('defprop')->isDefault()); -var_dump($ro->getProperty('myprop')->isDefault()); - -$prop1 = new ReflectionProperty($a, 'defprop'); -$prop2 = new ReflectionProperty($a, 'myprop'); -var_dump($prop1->isDefault()); -var_dump($prop2->isDefault()); -?> -==DONE== ---EXPECT-- -bool(true) -bool(false) -bool(true) -bool(false) -bool(true) -bool(false) -==DONE== +--TEST-- +ReflectionParameter::isDefault() +--FILE-- +myprop = null; + +$ro = new ReflectionObject($a); +$props = $ro->getProperties(); +$prop1 = $props[0]; +var_dump($prop1->isDefault()); +$prop2 = $props[1]; +var_dump($prop2->isDefault()); + +var_dump($ro->getProperty('defprop')->isDefault()); +var_dump($ro->getProperty('myprop')->isDefault()); + +$prop1 = new ReflectionProperty($a, 'defprop'); +$prop2 = new ReflectionProperty($a, 'myprop'); +var_dump($prop1->isDefault()); +var_dump($prop2->isDefault()); +?> +==DONE== +--EXPECT-- +bool(true) +bool(false) +bool(true) +bool(false) +bool(true) +bool(false) +==DONE== diff --git a/ext/session/tests/bug36459.phpt b/ext/session/tests/bug36459.phpt index 66a4ac1cbc3..c1b64561745 100644 --- a/ext/session/tests/bug36459.phpt +++ b/ext/session/tests/bug36459.phpt @@ -1,42 +1,42 @@ ---TEST-- -Bug #31454 (Incorrect adding PHPSESSID to links, which contains \r\n) ---SKIPIF-- - ---INI-- -session.use_trans_sid=1 -session.use_cookies=0 -session.use_only_cookies=0 -session.name=sid ---FILE-- - - - - Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n - - -

See source html code

- incorrect link
-
- correct link - - ---EXPECTF-- - - - Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n - - -

See source html code

- incorrect link
-
- correct link - - +--TEST-- +Bug #31454 (Incorrect adding PHPSESSID to links, which contains \r\n) +--SKIPIF-- + +--INI-- +session.use_trans_sid=1 +session.use_cookies=0 +session.use_only_cookies=0 +session.name=sid +--FILE-- + + + + Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n + + +

See source html code

+ incorrect link
+
+ correct link + + +--EXPECTF-- + + + Bug #36459 Incorrect adding PHPSESSID to links, which contains \r\n + + +

See source html code

+ incorrect link
+
+ correct link + + diff --git a/ext/sockets/tests/bug51958.phpt b/ext/sockets/tests/bug51958.phpt index afccd6ce23d..b4d75cec488 100644 --- a/ext/sockets/tests/bug51958.phpt +++ b/ext/sockets/tests/bug51958.phpt @@ -1,22 +1,22 @@ ---TEST-- -Bug #51958: socket_accept() fails on IPv6 server sockets ---SKIPIF-- - '224.0.0.23', - "interface" => 'lo', -)); -if ($so === false) { - die('skip interface \'lo\' is unavailable.'); -} -if (!defined("MCAST_BLOCK_SOURCE")) { - die('skip source operations are unavailable'); -} ---FILE-- - $mcastaddr, - "interface" => $interface, -)); -var_dump($so); - -$r = socket_sendto($sends1, $m = "initial packet", strlen($m), 0, $mcastaddr, 3000); -var_dump($r); - -$i = 0; -checktimeout($s, 500); -while (($str = socket_read($s, 3000)) !== FALSE) { - $i++; - echo "$i> ", $str, "\n"; - -if ($i == 1) { - echo "leaving group\n"; - $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "127.0.0.1", 3000); - var_dump($r); -} -if ($i == 2) { - echo "re-joining group\n"; - $so = socket_set_option($s, $level, MCAST_JOIN_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - )); - var_dump($so); - $r = socket_sendto($sends2, $m = "ignored mcast packet (different interface)", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); -} -if ($i == 3) { - echo "blocking source\n"; - $so = socket_set_option($s, $level, MCAST_BLOCK_SOURCE, array( - "group" => $mcastaddr, - "interface" => $interface, - "source" => $sblock, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "ignored packet (blocked source)", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "127.0.0.1", 3000); - var_dump($r); -} -if ($i == 4) { - echo "unblocking source\n"; - $so = socket_set_option($s, $level, MCAST_UNBLOCK_SOURCE, array( - "group" => $mcastaddr, - "interface" => $interface, - "source" => $sblock, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "mcast packet from 127.0.0.1", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); -} -if ($i == 5) { - echo "leaving group\n"; - $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "127.0.0.1", 3000); - var_dump($r); -} -if ($i == 6) { - echo "joining source group\n"; - $so = socket_set_option($s, $level, MCAST_JOIN_SOURCE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - "source" => $sblock, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "mcast packet from 127.0.0.1", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); -} -if ($i == 7) { - echo "leaving source group\n"; - $so = socket_set_option($s, $level, MCAST_LEAVE_SOURCE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - "source" => $sblock, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "127.0.0.1", 3000); - var_dump($r); -} -if ($i == 8) { -/* echo "rjsg\n"; - $so = socket_set_option($s, $level, MCAST_JOIN_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - )); - var_dump($so);*/ - break; -} - -} ---EXPECTF-- -creating send socket bound to 127.0.0.1 -bool(true) -creating unbound socket and hoping the routing table causes an interface other than lo to be used for sending messages to 224.0.0.23 -bool(true) -creating receive socket -resource(%d) of type (Socket) -bool(true) -bool(true) -int(14) -1> initial packet -leaving group -bool(true) -int(20) -int(14) -2> unicast packet -re-joining group -bool(true) -int(42) -int(12) -3> mcast packet -blocking source -bool(true) -int(31) -int(14) -4> unicast packet -unblocking source -bool(true) -int(27) -5> mcast packet from 127.0.0.1 -leaving group -bool(true) -int(20) -int(14) -6> unicast packet -joining source group -bool(true) -int(27) -7> mcast packet from 127.0.0.1 -leaving source group -bool(true) -int(20) -int(14) -8> unicast packet +--TEST-- +Multicast support: IPv4 receive options +--SKIPIF-- + '224.0.0.23', + "interface" => 'lo', +)); +if ($so === false) { + die('skip interface \'lo\' is unavailable.'); +} +if (!defined("MCAST_BLOCK_SOURCE")) { + die('skip source operations are unavailable'); +} +--FILE-- + $mcastaddr, + "interface" => $interface, +)); +var_dump($so); + +$r = socket_sendto($sends1, $m = "initial packet", strlen($m), 0, $mcastaddr, 3000); +var_dump($r); + +$i = 0; +checktimeout($s, 500); +while (($str = socket_read($s, 3000)) !== FALSE) { + $i++; + echo "$i> ", $str, "\n"; + +if ($i == 1) { + echo "leaving group\n"; + $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "127.0.0.1", 3000); + var_dump($r); +} +if ($i == 2) { + echo "re-joining group\n"; + $so = socket_set_option($s, $level, MCAST_JOIN_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + )); + var_dump($so); + $r = socket_sendto($sends2, $m = "ignored mcast packet (different interface)", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); +} +if ($i == 3) { + echo "blocking source\n"; + $so = socket_set_option($s, $level, MCAST_BLOCK_SOURCE, array( + "group" => $mcastaddr, + "interface" => $interface, + "source" => $sblock, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "ignored packet (blocked source)", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "127.0.0.1", 3000); + var_dump($r); +} +if ($i == 4) { + echo "unblocking source\n"; + $so = socket_set_option($s, $level, MCAST_UNBLOCK_SOURCE, array( + "group" => $mcastaddr, + "interface" => $interface, + "source" => $sblock, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "mcast packet from 127.0.0.1", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); +} +if ($i == 5) { + echo "leaving group\n"; + $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "127.0.0.1", 3000); + var_dump($r); +} +if ($i == 6) { + echo "joining source group\n"; + $so = socket_set_option($s, $level, MCAST_JOIN_SOURCE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + "source" => $sblock, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "mcast packet from 127.0.0.1", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); +} +if ($i == 7) { + echo "leaving source group\n"; + $so = socket_set_option($s, $level, MCAST_LEAVE_SOURCE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + "source" => $sblock, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "127.0.0.1", 3000); + var_dump($r); +} +if ($i == 8) { +/* echo "rjsg\n"; + $so = socket_set_option($s, $level, MCAST_JOIN_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + )); + var_dump($so);*/ + break; +} + +} +--EXPECTF-- +creating send socket bound to 127.0.0.1 +bool(true) +creating unbound socket and hoping the routing table causes an interface other than lo to be used for sending messages to 224.0.0.23 +bool(true) +creating receive socket +resource(%d) of type (Socket) +bool(true) +bool(true) +int(14) +1> initial packet +leaving group +bool(true) +int(20) +int(14) +2> unicast packet +re-joining group +bool(true) +int(42) +int(12) +3> mcast packet +blocking source +bool(true) +int(31) +int(14) +4> unicast packet +unblocking source +bool(true) +int(27) +5> mcast packet from 127.0.0.1 +leaving group +bool(true) +int(20) +int(14) +6> unicast packet +joining source group +bool(true) +int(27) +7> mcast packet from 127.0.0.1 +leaving source group +bool(true) +int(20) +int(14) +8> unicast packet diff --git a/ext/sockets/tests/mcast_ipv6_recv.phpt b/ext/sockets/tests/mcast_ipv6_recv.phpt index 61d1e8458f1..6ff97b60d51 100644 --- a/ext/sockets/tests/mcast_ipv6_recv.phpt +++ b/ext/sockets/tests/mcast_ipv6_recv.phpt @@ -1,226 +1,226 @@ ---TEST-- -Multicast support: IPv6 receive options ---SKIPIF-- - 'ff01::114', - "interface" => 0, -)); -if ($so === false) { - die('skip unable to join multicast group on any interface.'); -} -$r = socket_sendto($s, $m = "testing packet", strlen($m), 0, 'ff01::114', 3000); -if ($r === false) { - die('skip unable to send multicast packet.'); -} - -if (!defined("MCAST_JOIN_SOURCE_GROUP")) - die('skip source operations are unavailable'); - -$so = socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( - "group" => 'ff01::114', - "interface" => 0, -)); -$so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( - "group" => 'ff01::114', - "interface" => 0, - "source" => '2001::dead:beef', -)); -if ($so === false) { - die('skip protocol independent multicast API is unavailable.'); -} - ---FILE-- - $mcastaddr, - "interface" => $interface, -)) or die("err"); -var_dump($so); - -$r = socket_sendto($sends1, $m = "testing packet", strlen($m), 0, $mcastaddr, 3000); -var_dump($r); -checktimeout($s, 500); -$r = socket_recvfrom($s, $str, 2000, 0, $from, $fromPort); -var_dump($r, $str, $from); -$sblock = $from; - -$r = socket_sendto($sends1, $m = "initial packet", strlen($m), 0, $mcastaddr, 3000); -var_dump($r); - -$i = 0; -checktimeout($s, 500); -while (($str = socket_read($s, 3000)) !== FALSE) { - $i++; - echo "$i> ", $str, "\n"; - -if ($i == 1) { - echo "leaving group\n"; - $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); - var_dump($r); -} -if ($i == 2) { - echo "re-joining group\n"; - $so = socket_set_option($s, $level, MCAST_JOIN_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); -} -if ($i == 3) { - echo "blocking source\n"; - $so = socket_set_option($s, $level, MCAST_BLOCK_SOURCE, array( - "group" => $mcastaddr, - "interface" => $interface, - "source" => $sblock, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "ignored packet (blocked source)", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); - var_dump($r); -} -if ($i == 4) { - echo "unblocking source\n"; - $so = socket_set_option($s, $level, MCAST_UNBLOCK_SOURCE, array( - "group" => $mcastaddr, - "interface" => $interface, - "source" => $sblock, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); -} -if ($i == 5) { - echo "leaving group\n"; - $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); - var_dump($r); -} -if ($i == 6) { - echo "joining source group\n"; - $so = socket_set_option($s, $level, MCAST_JOIN_SOURCE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - "source" => $sblock, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "mcast packet from desired source", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); -} -if ($i == 7) { - echo "leaving source group\n"; - $so = socket_set_option($s, $level, MCAST_LEAVE_SOURCE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - "source" => $sblock, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); - var_dump($r); -} -if ($i == 8) { - /*echo "joining source group\n"; - $so = socket_set_option($s, $level, MCAST_JOIN_SOURCE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - "source" => $sblock, - )); - var_dump($so);*/ - break; -} - -} ---EXPECTF-- -creating send socket -resource(%d) of type (Socket) -creating receive socket -resource(%d) of type (Socket) -bool(true) -bool(true) -int(14) -int(14) -string(14) "testing packet" -string(%d) "%s" -int(14) -1> initial packet -leaving group -bool(true) -int(20) -int(14) -2> unicast packet -re-joining group -bool(true) -int(12) -3> mcast packet -blocking source -bool(true) -int(31) -int(14) -4> unicast packet -unblocking source -bool(true) -int(12) -5> mcast packet -leaving group -bool(true) -int(20) -int(14) -6> unicast packet -joining source group -bool(true) -int(32) -7> mcast packet from desired source -leaving source group -bool(true) -int(20) -int(14) -8> unicast packet +--TEST-- +Multicast support: IPv6 receive options +--SKIPIF-- + 'ff01::114', + "interface" => 0, +)); +if ($so === false) { + die('skip unable to join multicast group on any interface.'); +} +$r = socket_sendto($s, $m = "testing packet", strlen($m), 0, 'ff01::114', 3000); +if ($r === false) { + die('skip unable to send multicast packet.'); +} + +if (!defined("MCAST_JOIN_SOURCE_GROUP")) + die('skip source operations are unavailable'); + +$so = socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( + "group" => 'ff01::114', + "interface" => 0, +)); +$so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( + "group" => 'ff01::114', + "interface" => 0, + "source" => '2001::dead:beef', +)); +if ($so === false) { + die('skip protocol independent multicast API is unavailable.'); +} + +--FILE-- + $mcastaddr, + "interface" => $interface, +)) or die("err"); +var_dump($so); + +$r = socket_sendto($sends1, $m = "testing packet", strlen($m), 0, $mcastaddr, 3000); +var_dump($r); +checktimeout($s, 500); +$r = socket_recvfrom($s, $str, 2000, 0, $from, $fromPort); +var_dump($r, $str, $from); +$sblock = $from; + +$r = socket_sendto($sends1, $m = "initial packet", strlen($m), 0, $mcastaddr, 3000); +var_dump($r); + +$i = 0; +checktimeout($s, 500); +while (($str = socket_read($s, 3000)) !== FALSE) { + $i++; + echo "$i> ", $str, "\n"; + +if ($i == 1) { + echo "leaving group\n"; + $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); + var_dump($r); +} +if ($i == 2) { + echo "re-joining group\n"; + $so = socket_set_option($s, $level, MCAST_JOIN_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); +} +if ($i == 3) { + echo "blocking source\n"; + $so = socket_set_option($s, $level, MCAST_BLOCK_SOURCE, array( + "group" => $mcastaddr, + "interface" => $interface, + "source" => $sblock, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "ignored packet (blocked source)", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); + var_dump($r); +} +if ($i == 4) { + echo "unblocking source\n"; + $so = socket_set_option($s, $level, MCAST_UNBLOCK_SOURCE, array( + "group" => $mcastaddr, + "interface" => $interface, + "source" => $sblock, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); +} +if ($i == 5) { + echo "leaving group\n"; + $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); + var_dump($r); +} +if ($i == 6) { + echo "joining source group\n"; + $so = socket_set_option($s, $level, MCAST_JOIN_SOURCE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + "source" => $sblock, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "mcast packet from desired source", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); +} +if ($i == 7) { + echo "leaving source group\n"; + $so = socket_set_option($s, $level, MCAST_LEAVE_SOURCE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + "source" => $sblock, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); + var_dump($r); +} +if ($i == 8) { + /*echo "joining source group\n"; + $so = socket_set_option($s, $level, MCAST_JOIN_SOURCE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + "source" => $sblock, + )); + var_dump($so);*/ + break; +} + +} +--EXPECTF-- +creating send socket +resource(%d) of type (Socket) +creating receive socket +resource(%d) of type (Socket) +bool(true) +bool(true) +int(14) +int(14) +string(14) "testing packet" +string(%d) "%s" +int(14) +1> initial packet +leaving group +bool(true) +int(20) +int(14) +2> unicast packet +re-joining group +bool(true) +int(12) +3> mcast packet +blocking source +bool(true) +int(31) +int(14) +4> unicast packet +unblocking source +bool(true) +int(12) +5> mcast packet +leaving group +bool(true) +int(20) +int(14) +6> unicast packet +joining source group +bool(true) +int(32) +7> mcast packet from desired source +leaving source group +bool(true) +int(20) +int(14) +8> unicast packet diff --git a/ext/sockets/tests/mcast_ipv6_recv_limited.phpt b/ext/sockets/tests/mcast_ipv6_recv_limited.phpt index fda099877d6..9fd54599506 100644 --- a/ext/sockets/tests/mcast_ipv6_recv_limited.phpt +++ b/ext/sockets/tests/mcast_ipv6_recv_limited.phpt @@ -1,131 +1,131 @@ ---TEST-- -Multicast support: IPv6 receive options (limited) ---SKIPIF-- - 'ff01::114', - "interface" => 0, -)); -if ($so === false) { - die('skip unable to join multicast group on any interface.'); -} -$r = socket_sendto($s, $m = "testing packet", strlen($m), 0, 'ff01::114', 3000); -if ($r === false) { - die('skip unable to send multicast packet.'); -} -$so = socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( - "group" => 'ff01::114', - "interface" => 0, -)); -if (defined("MCAST_JOIN_SOURCE_GROUP")) { - $so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( - "group" => 'ff01::114', - "interface" => 0, - "source" => '2001::dead:beef', - )); - if ($so !== false) { - die('skip protocol independent multicast API is available.'); - } -} - ---FILE-- - $mcastaddr, - "interface" => $interface, -)) or die("err"); -var_dump($so); - -$r = socket_sendto($sends1, $m = "testing packet", strlen($m), 0, $mcastaddr, 3000); -var_dump($r); -checktimeout($s, 500); -$r = socket_recvfrom($s, $str, 2000, 0, $from, $fromPort); -var_dump($r, $str, $from); -$sblock = $from; - -$r = socket_sendto($sends1, $m = "initial packet", strlen($m), 0, $mcastaddr, 3000); -var_dump($r); - -$i = 0; -checktimeout($s, 500); -while (($str = socket_read($s, 3000, 500)) !== FALSE) { - $i++; - echo "$i> ", $str, "\n"; - -if ($i == 1) { - echo "leaving group\n"; - $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); - $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); - var_dump($r); -} -if ($i == 2) { - echo "re-joining group\n"; - $so = socket_set_option($s, $level, MCAST_JOIN_GROUP, array( - "group" => $mcastaddr, - "interface" => $interface, - )); - var_dump($so); - $r = socket_sendto($sends1, $m = "mcast packet", strlen($m), 0, $mcastaddr, 3000); - var_dump($r); -} -if ($i == 3) { - break; -} - -} ---EXPECTF-- -creating send socket -resource(%d) of type (Socket) -creating receive socket -resource(%d) of type (Socket) -bool(true) -bool(true) -int(14) -int(14) -string(14) "testing packet" -string(%d) "%s" -int(14) -1> initial packet -leaving group -bool(true) -int(20) -int(14) -2> unicast packet -re-joining group -bool(true) -int(12) -3> mcast packet +--TEST-- +Multicast support: IPv6 receive options (limited) +--SKIPIF-- + 'ff01::114', + "interface" => 0, +)); +if ($so === false) { + die('skip unable to join multicast group on any interface.'); +} +$r = socket_sendto($s, $m = "testing packet", strlen($m), 0, 'ff01::114', 3000); +if ($r === false) { + die('skip unable to send multicast packet.'); +} +$so = socket_set_option($s, IPPROTO_IPV6, MCAST_LEAVE_GROUP, array( + "group" => 'ff01::114', + "interface" => 0, +)); +if (defined("MCAST_JOIN_SOURCE_GROUP")) { + $so = socket_set_option($s, IPPROTO_IPV6, MCAST_JOIN_SOURCE_GROUP, array( + "group" => 'ff01::114', + "interface" => 0, + "source" => '2001::dead:beef', + )); + if ($so !== false) { + die('skip protocol independent multicast API is available.'); + } +} + +--FILE-- + $mcastaddr, + "interface" => $interface, +)) or die("err"); +var_dump($so); + +$r = socket_sendto($sends1, $m = "testing packet", strlen($m), 0, $mcastaddr, 3000); +var_dump($r); +checktimeout($s, 500); +$r = socket_recvfrom($s, $str, 2000, 0, $from, $fromPort); +var_dump($r, $str, $from); +$sblock = $from; + +$r = socket_sendto($sends1, $m = "initial packet", strlen($m), 0, $mcastaddr, 3000); +var_dump($r); + +$i = 0; +checktimeout($s, 500); +while (($str = socket_read($s, 3000, 500)) !== FALSE) { + $i++; + echo "$i> ", $str, "\n"; + +if ($i == 1) { + echo "leaving group\n"; + $so = socket_set_option($s, $level, MCAST_LEAVE_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "ignored mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); + $r = socket_sendto($sends1, $m = "unicast packet", strlen($m), 0, "::1", 3000); + var_dump($r); +} +if ($i == 2) { + echo "re-joining group\n"; + $so = socket_set_option($s, $level, MCAST_JOIN_GROUP, array( + "group" => $mcastaddr, + "interface" => $interface, + )); + var_dump($so); + $r = socket_sendto($sends1, $m = "mcast packet", strlen($m), 0, $mcastaddr, 3000); + var_dump($r); +} +if ($i == 3) { + break; +} + +} +--EXPECTF-- +creating send socket +resource(%d) of type (Socket) +creating receive socket +resource(%d) of type (Socket) +bool(true) +bool(true) +int(14) +int(14) +string(14) "testing packet" +string(%d) "%s" +int(14) +1> initial packet +leaving group +bool(true) +int(20) +int(14) +2> unicast packet +re-joining group +bool(true) +int(12) +3> mcast packet diff --git a/ext/sockets/tests/mcast_ipv6_send.phpt b/ext/sockets/tests/mcast_ipv6_send.phpt index f75bb09903c..a9d6293fc9d 100644 --- a/ext/sockets/tests/mcast_ipv6_send.phpt +++ b/ext/sockets/tests/mcast_ipv6_send.phpt @@ -1,70 +1,70 @@ ---TEST-- -Multicast support: IPv6 send options ---SKIPIF-- - Andrea Giorgini Filippo De Santis Daniel Londero Francesco Trucchia Jacopo Romei -#Test Fest Cesena (Italy) on 2009-06-20 ---SKIPIF-- - ---FILE-- - +--FILE-- +getInode())); --CLEAN-- ---EXPECTF-- +?> +--EXPECTF-- string(%d) "%d" diff --git a/ext/spl/tests/DirectoryIterator_getInode_error.phpt b/ext/spl/tests/DirectoryIterator_getInode_error.phpt index ba9014c690d..570bb21fda1 100644 --- a/ext/spl/tests/DirectoryIterator_getInode_error.phpt +++ b/ext/spl/tests/DirectoryIterator_getInode_error.phpt @@ -1,25 +1,25 @@ ---TEST-- -SPL: Spl File Info test getInode ---CREDITS-- +--TEST-- +SPL: Spl File Info test getInode +--CREDITS-- Cesare D'Amico Andrea Giorgini Filippo De Santis Daniel Londero Francesco Trucchia Jacopo Romei -#Test Fest Cesena (Italy) on 2009-06-20 ---SKIPIF-- - ---FILE-- - +--FILE-- +getInode()); ?> - + --EXPECTF-- Fatal error: Uncaught RuntimeException: SplFileInfo::getInode(): stat failed for %s in %s Stack trace: diff --git a/ext/spl/tests/SplFileInfo_getGroup_error.phpt b/ext/spl/tests/SplFileInfo_getGroup_error.phpt index acfa6b99c53..79492e0e9c2 100644 --- a/ext/spl/tests/SplFileInfo_getGroup_error.phpt +++ b/ext/spl/tests/SplFileInfo_getGroup_error.phpt @@ -1,25 +1,25 @@ ---TEST-- -SPL: Spl File Info test getGroup ---CREDITS-- +--TEST-- +SPL: Spl File Info test getGroup +--CREDITS-- Cesare D'Amico Andrea Giorgini Filippo De Santis Daniel Londero Francesco Trucchia Jacopo Romei -#Test Fest Cesena (Italy) on 2009-06-20 ---SKIPIF-- - ---FILE-- - +--FILE-- +getGroup()); ?> - + --EXPECTF-- Fatal error: Uncaught RuntimeException: SplFileInfo::getGroup(): stat failed for not_existing in %s Stack trace: diff --git a/ext/spl/tests/SplFileInfo_getInode_basic.phpt b/ext/spl/tests/SplFileInfo_getInode_basic.phpt index 380b865cd2a..9ee2c6ee519 100644 --- a/ext/spl/tests/SplFileInfo_getInode_basic.phpt +++ b/ext/spl/tests/SplFileInfo_getInode_basic.phpt @@ -1,19 +1,19 @@ ---TEST-- -SPL: Spl File Info test getInode ---CREDITS-- +--TEST-- +SPL: Spl File Info test getInode +--CREDITS-- Cesare D'Amico Andrea Giorgini Filippo De Santis Daniel Londero Francesco Trucchia Jacopo Romei -#Test Fest Cesena (Italy) on 2009-06-20 ---SKIPIF-- - ---FILE-- - +--FILE-- +getInode() == $result); --CLEAN-- ---EXPECTF-- +?> +--EXPECTF-- bool(true) diff --git a/ext/spl/tests/SplFileInfo_getInode_error.phpt b/ext/spl/tests/SplFileInfo_getInode_error.phpt index 31b53823365..c2b98037354 100644 --- a/ext/spl/tests/SplFileInfo_getInode_error.phpt +++ b/ext/spl/tests/SplFileInfo_getInode_error.phpt @@ -1,25 +1,25 @@ ---TEST-- -SPL: Spl File Info test getPerms ---CREDITS-- +--TEST-- +SPL: Spl File Info test getPerms +--CREDITS-- Cesare D'Amico Andrea Giorgini Filippo De Santis Daniel Londero Francesco Trucchia Jacopo Romei -#Test Fest Cesena (Italy) on 2009-06-20 ---SKIPIF-- - ---FILE-- - +--FILE-- +getInode()); ?> - + --EXPECTF-- Fatal error: Uncaught RuntimeException: SplFileInfo::getInode(): stat failed for not_existing in %s Stack trace: diff --git a/ext/spl/tests/SplFileInfo_getOwner_error.phpt b/ext/spl/tests/SplFileInfo_getOwner_error.phpt index f6b4b29195f..073744aa004 100644 --- a/ext/spl/tests/SplFileInfo_getOwner_error.phpt +++ b/ext/spl/tests/SplFileInfo_getOwner_error.phpt @@ -1,25 +1,25 @@ ---TEST-- -SPL: Spl File Info test getOwner ---CREDITS-- +--TEST-- +SPL: Spl File Info test getOwner +--CREDITS-- Cesare D'Amico Andrea Giorgini Filippo De Santis Daniel Londero Francesco Trucchia Jacopo Romei -#Test Fest Cesena (Italy) on 2009-06-20 ---SKIPIF-- - ---FILE-- - +--FILE-- +getOwner()); ?> - + --EXPECTF-- Fatal error: Uncaught RuntimeException: SplFileInfo::getOwner(): stat failed for not_existing in %s Stack trace: diff --git a/ext/spl/tests/SplFileInfo_getPerms_basic.phpt b/ext/spl/tests/SplFileInfo_getPerms_basic.phpt index 53591f34177..af099076055 100644 --- a/ext/spl/tests/SplFileInfo_getPerms_basic.phpt +++ b/ext/spl/tests/SplFileInfo_getPerms_basic.phpt @@ -1,19 +1,19 @@ ---TEST-- -SPL: Spl File Info test getPerms ---CREDITS-- +--TEST-- +SPL: Spl File Info test getPerms +--CREDITS-- Cesare D'Amico Andrea Giorgini Filippo De Santis Daniel Londero Francesco Trucchia Jacopo Romei -#Test Fest Cesena (Italy) on 2009-06-20 ---SKIPIF-- - ---FILE-- - +--FILE-- +getPerms() == 0100557); --CLEAN-- ---EXPECTF-- +?> +--EXPECTF-- bool(true) diff --git a/ext/spl/tests/SplFileInfo_getPerms_error.phpt b/ext/spl/tests/SplFileInfo_getPerms_error.phpt index 23b48de9767..4b70c2635b7 100644 --- a/ext/spl/tests/SplFileInfo_getPerms_error.phpt +++ b/ext/spl/tests/SplFileInfo_getPerms_error.phpt @@ -1,25 +1,25 @@ ---TEST-- -SPL: Spl File Info test getPerms ---CREDITS-- +--TEST-- +SPL: Spl File Info test getPerms +--CREDITS-- Cesare D'Amico Andrea Giorgini Filippo De Santis Daniel Londero Francesco Trucchia Jacopo Romei -#Test Fest Cesena (Italy) on 2009-06-20 ---SKIPIF-- - ---FILE-- - +--FILE-- +getPerms() == 0100557); ?> - + --EXPECTF-- Fatal error: Uncaught RuntimeException: SplFileInfo::getPerms(): stat failed for %s in %s Stack trace: diff --git a/ext/spl/tests/iterator_069.phpt b/ext/spl/tests/iterator_069.phpt index e9b3177ed6f..1ee44785b3c 100644 --- a/ext/spl/tests/iterator_069.phpt +++ b/ext/spl/tests/iterator_069.phpt @@ -1,17 +1,17 @@ ---TEST-- -SPL: RecursiveIteratorIterator cannot be used with foreach by reference ---FILE-- -getIterator()); - -$recItIt = new RecursiveIteratorIterator($recArrIt); - -foreach ($recItIt as &$val) echo "$val\n"; - -?> ---EXPECTF-- -Fatal error: An iterator cannot be used with foreach by reference in %s on line %d +--TEST-- +SPL: RecursiveIteratorIterator cannot be used with foreach by reference +--FILE-- +getIterator()); + +$recItIt = new RecursiveIteratorIterator($recArrIt); + +foreach ($recItIt as &$val) echo "$val\n"; + +?> +--EXPECTF-- +Fatal error: An iterator cannot be used with foreach by reference in %s on line %d diff --git a/ext/spl/tests/iterator_070.phpt b/ext/spl/tests/iterator_070.phpt index c45f08ec458..bbb518e0741 100644 --- a/ext/spl/tests/iterator_070.phpt +++ b/ext/spl/tests/iterator_070.phpt @@ -1,20 +1,20 @@ ---TEST-- -SPL: RecursiveIteratorIterator - Ensure that non-overriden methods execute problem free. ---FILE-- -beginIteration()); -var_dump($recItIt->endIteration()); -var_dump($recItIt->nextElement()); - -?> - ---EXPECTF-- -NULL -NULL +--TEST-- +SPL: RecursiveIteratorIterator - Ensure that non-overriden methods execute problem free. +--FILE-- +beginIteration()); +var_dump($recItIt->endIteration()); +var_dump($recItIt->nextElement()); + +?> + +--EXPECTF-- +NULL +NULL NULL \ No newline at end of file diff --git a/ext/spl/tests/iterator_071.phpt b/ext/spl/tests/iterator_071.phpt index 21ec7980ad6..8370906abb4 100644 --- a/ext/spl/tests/iterator_071.phpt +++ b/ext/spl/tests/iterator_071.phpt @@ -1,32 +1,32 @@ ---TEST-- -SPL: RecursiveIteratorIterator - Test where the case is RS_SELF and mode is CHILD_FIRST ---FILE-- -getIterator()); - -class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { - - function nextelement() { - echo __METHOD__."\n"; - } -} - - -$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::CHILD_FIRST); - -foreach ($recItIt as $key => $val) echo "$key\n"; - -?> ---EXPECTF-- -MyRecursiveIteratorIterator::nextelement -0 -MyRecursiveIteratorIterator::nextelement -1 -MyRecursiveIteratorIterator::nextelement -0 -MyRecursiveIteratorIterator::nextelement +--TEST-- +SPL: RecursiveIteratorIterator - Test where the case is RS_SELF and mode is CHILD_FIRST +--FILE-- +getIterator()); + +class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { + + function nextelement() { + echo __METHOD__."\n"; + } +} + + +$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::CHILD_FIRST); + +foreach ($recItIt as $key => $val) echo "$key\n"; + +?> +--EXPECTF-- +MyRecursiveIteratorIterator::nextelement +0 +MyRecursiveIteratorIterator::nextelement +1 +MyRecursiveIteratorIterator::nextelement +0 +MyRecursiveIteratorIterator::nextelement 1 \ No newline at end of file diff --git a/ext/spl/tests/recursiveIteratorIterator_beginchildren_error.phpt b/ext/spl/tests/recursiveIteratorIterator_beginchildren_error.phpt index c9e21b260e4..7ed3b6eb342 100644 --- a/ext/spl/tests/recursiveIteratorIterator_beginchildren_error.phpt +++ b/ext/spl/tests/recursiveIteratorIterator_beginchildren_error.phpt @@ -1,36 +1,36 @@ ---TEST-- -SPL: RecursiveIteratorIterator - Exception thrown in beginchildren which should be handled in next() ---FILE-- -getIterator()); - -class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { - - function beginchildren() { - throw new Exception; - } -} - - -$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); - -var_dump($recItIt->next()); - -$recItIt2 = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY); - -var_dump($recItIt2->next()); - -?> ---EXPECTF-- -NULL - -Fatal error: Uncaught Exception in %s -Stack trace: -#0 [internal function]: MyRecursiveIteratorIterator->beginchildren() -#1 %s: RecursiveIteratorIterator->next() -#2 {main} - thrown in %s on line %d +--TEST-- +SPL: RecursiveIteratorIterator - Exception thrown in beginchildren which should be handled in next() +--FILE-- +getIterator()); + +class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { + + function beginchildren() { + throw new Exception; + } +} + + +$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); + +var_dump($recItIt->next()); + +$recItIt2 = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY); + +var_dump($recItIt2->next()); + +?> +--EXPECTF-- +NULL + +Fatal error: Uncaught Exception in %s +Stack trace: +#0 [internal function]: MyRecursiveIteratorIterator->beginchildren() +#1 %s: RecursiveIteratorIterator->next() +#2 {main} + thrown in %s on line %d diff --git a/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt b/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt index cbf8136ab64..0e3c1c1439b 100644 --- a/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt +++ b/ext/spl/tests/recursiveIteratorIterator_callHasChildren_error.phpt @@ -1,36 +1,36 @@ ---TEST-- -SPL: RecursiveIteratorIterator - Exception thrown in callHasChildren which should be handled in next() ---FILE-- -getIterator()); - -class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { - - function callHasChildren() { - throw new Exception; - } -} - - -$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); - -var_dump($recItIt->next()); - -$recItIt2 = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY); - -var_dump($recItIt2->next()); - -?> ---EXPECTF-- -NULL - -Fatal error: Uncaught Exception in %s -Stack trace: -#0 [internal function]: MyRecursiveIteratorIterator->callHasChildren() -#1 %s: RecursiveIteratorIterator->next() -#2 {main} - thrown in %s on line %d +--TEST-- +SPL: RecursiveIteratorIterator - Exception thrown in callHasChildren which should be handled in next() +--FILE-- +getIterator()); + +class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { + + function callHasChildren() { + throw new Exception; + } +} + + +$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); + +var_dump($recItIt->next()); + +$recItIt2 = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY); + +var_dump($recItIt2->next()); + +?> +--EXPECTF-- +NULL + +Fatal error: Uncaught Exception in %s +Stack trace: +#0 [internal function]: MyRecursiveIteratorIterator->callHasChildren() +#1 %s: RecursiveIteratorIterator->next() +#2 {main} + thrown in %s on line %d diff --git a/ext/spl/tests/recursiveIteratorIterator_endchildren_error.phpt b/ext/spl/tests/recursiveIteratorIterator_endchildren_error.phpt index 82d55cf0ce5..32617bf1086 100644 --- a/ext/spl/tests/recursiveIteratorIterator_endchildren_error.phpt +++ b/ext/spl/tests/recursiveIteratorIterator_endchildren_error.phpt @@ -1,42 +1,42 @@ ---TEST-- -SPL: RecursiveIteratorIterator - Exception thrown in endchildren which should be handled in next() ---FILE-- -getIterator()); - -class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { - - function endchildren() { - throw new Exception; - } -} - - -$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); - -foreach ($recItIt as $val) echo "$val\n"; - -$recItIt2 = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY); - -echo "===NEXT LOOP===\n"; - -foreach ($recItIt2 as $val) echo "$val\n"; - -?> ---EXPECTF-- -1 -2 -===NEXT LOOP=== -1 -2 - -Fatal error: Uncaught Exception in %s -Stack trace: -#0 [internal function]: MyRecursiveIteratorIterator->endchildren() -#1 %s: RecursiveIteratorIterator->next() -#2 {main} - thrown in %s on line %d +--TEST-- +SPL: RecursiveIteratorIterator - Exception thrown in endchildren which should be handled in next() +--FILE-- +getIterator()); + +class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { + + function endchildren() { + throw new Exception; + } +} + + +$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); + +foreach ($recItIt as $val) echo "$val\n"; + +$recItIt2 = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY); + +echo "===NEXT LOOP===\n"; + +foreach ($recItIt2 as $val) echo "$val\n"; + +?> +--EXPECTF-- +1 +2 +===NEXT LOOP=== +1 +2 + +Fatal error: Uncaught Exception in %s +Stack trace: +#0 [internal function]: MyRecursiveIteratorIterator->endchildren() +#1 %s: RecursiveIteratorIterator->next() +#2 {main} + thrown in %s on line %d diff --git a/ext/spl/tests/recursiveIteratorIterator_nextelement_error.phpt b/ext/spl/tests/recursiveIteratorIterator_nextelement_error.phpt index bb020fdff0d..a2c0d2ea1b8 100644 --- a/ext/spl/tests/recursiveIteratorIterator_nextelement_error.phpt +++ b/ext/spl/tests/recursiveIteratorIterator_nextelement_error.phpt @@ -1,36 +1,36 @@ ---TEST-- -SPL: RecursiveIteratorIterator - Exception thrown in nextelement which should be handled in next() ---FILE-- -getIterator()); - -class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { - - function nextelement() { - throw new Exception; - } -} - - -$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); - -var_dump($recItIt->next()); - -$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY); - -var_dump($recItIt->next()); - -?> ---EXPECTF-- -NULL - -Fatal error: Uncaught Exception in %s -Stack trace: -#0 [internal function]: MyRecursiveIteratorIterator->nextelement() -#1 %s: RecursiveIteratorIterator->next() -#2 {main} - thrown in %s on line %d +--TEST-- +SPL: RecursiveIteratorIterator - Exception thrown in nextelement which should be handled in next() +--FILE-- +getIterator()); + +class MyRecursiveIteratorIterator extends RecursiveIteratorIterator { + + function nextelement() { + throw new Exception; + } +} + + +$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD); + +var_dump($recItIt->next()); + +$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::LEAVES_ONLY); + +var_dump($recItIt->next()); + +?> +--EXPECTF-- +NULL + +Fatal error: Uncaught Exception in %s +Stack trace: +#0 [internal function]: MyRecursiveIteratorIterator->nextelement() +#1 %s: RecursiveIteratorIterator->next() +#2 {main} + thrown in %s on line %d diff --git a/ext/sqlite3/tests/bug73333.phpt b/ext/sqlite3/tests/bug73333.phpt index 7315751810c..8634b67f769 100644 --- a/ext/sqlite3/tests/bug73333.phpt +++ b/ext/sqlite3/tests/bug73333.phpt @@ -1,26 +1,26 @@ ---TEST-- -Bug #73333 (2147483647 is fetched as string) ---SKIPIF-- - ---FILE-- -exec('CREATE TABLE foo (bar INT)'); -foreach ([PHP_INT_MIN, PHP_INT_MAX] as $value) { - $db->exec("INSERT INTO foo VALUES ($value)"); -} - -$res = $db->query('SELECT bar FROM foo'); -while (($row = $res->fetchArray(SQLITE3_NUM)) !== false) { - echo gettype($row[0]), PHP_EOL; -} -?> -===DONE=== ---EXPECT-- -integer -integer -===DONE=== +--TEST-- +Bug #73333 (2147483647 is fetched as string) +--SKIPIF-- + +--FILE-- +exec('CREATE TABLE foo (bar INT)'); +foreach ([PHP_INT_MIN, PHP_INT_MAX] as $value) { + $db->exec("INSERT INTO foo VALUES ($value)"); +} + +$res = $db->query('SELECT bar FROM foo'); +while (($row = $res->fetchArray(SQLITE3_NUM)) !== false) { + echo gettype($row[0]), PHP_EOL; +} +?> +===DONE=== +--EXPECT-- +integer +integer +===DONE=== diff --git a/ext/standard/tests/file/bug43353-win32.phpt b/ext/standard/tests/file/bug43353-win32.phpt index 2faabb92c03..76605d97a82 100644 --- a/ext/standard/tests/file/bug43353-win32.phpt +++ b/ext/standard/tests/file/bug43353-win32.phpt @@ -1,25 +1,25 @@ ---TEST-- -Bug #43353 wrong detection of 'data' wrapper ---SKIPIF-- - ---INI-- -allow_url_fopen=1 ---FILE-- - ---EXPECTF-- -bool(false) -bool(false) -string(3) "foo" - -Warning: file_get_contents(datafoo:text/plain,foo): failed to open stream: No such file or directory in %s -bool(false) +--TEST-- +Bug #43353 wrong detection of 'data' wrapper +--SKIPIF-- + +--INI-- +allow_url_fopen=1 +--FILE-- + +--EXPECTF-- +bool(false) +bool(false) +string(3) "foo" + +Warning: file_get_contents(datafoo:text/plain,foo): failed to open stream: No such file or directory in %s +bool(false) diff --git a/ext/standard/tests/file/bug49047.phpt b/ext/standard/tests/file/bug49047.phpt index 1ccc94e2875..d0805a16fdd 100644 --- a/ext/standard/tests/file/bug49047.phpt +++ b/ext/standard/tests/file/bug49047.phpt @@ -1,17 +1,17 @@ ---TEST-- -Test fopen() function : variation: interesting paths, no use include path ---FILE-- - ---EXPECTF-- -Ok. +--TEST-- +Test fopen() function : variation: interesting paths, no use include path +--FILE-- + +--EXPECTF-- +Ok. diff --git a/ext/standard/tests/file/bug53241.phpt b/ext/standard/tests/file/bug53241.phpt index 685bf146204..7ccf2be1099 100644 --- a/ext/standard/tests/file/bug53241.phpt +++ b/ext/standard/tests/file/bug53241.phpt @@ -1,23 +1,23 @@ ---TEST-- -Bug #53241 (stream casting that relies on fdopen/fopencookie fails with 'xb' mode) ---SKIPIF-- - ---EXPECT-- -bool(true) -Done. +--TEST-- +Bug #53241 (stream casting that relies on fdopen/fopencookie fails with 'xb' mode) +--SKIPIF-- + +--EXPECT-- +bool(true) +Done. diff --git a/ext/standard/tests/file/bug55124.phpt b/ext/standard/tests/file/bug55124.phpt index 1915b7f2097..7938196dbcd 100644 --- a/ext/standard/tests/file/bug55124.phpt +++ b/ext/standard/tests/file/bug55124.phpt @@ -1,18 +1,18 @@ ---TEST-- -Bug #55124 (recursive mkdir fails with current (dot) directory in path) ---FILE-- - ---EXPECT-- -OK +--TEST-- +Bug #55124 (recursive mkdir fails with current (dot) directory in path) +--FILE-- + +--EXPECT-- +OK diff --git a/ext/standard/tests/file/bug60120.phpt b/ext/standard/tests/file/bug60120.phpt index 776a6d44c86..92172b91126 100644 --- a/ext/standard/tests/file/bug60120.phpt +++ b/ext/standard/tests/file/bug60120.phpt @@ -1,74 +1,74 @@ ---TEST-- -Bug #60120 (proc_open hangs when data in stdin/out/err is getting larger or equal to 2048) ---SKIPIF-- - ---FILE-- - true, 'binary_pipes' => true, 'bypass_shell' => false)); -$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); - -foreach ($pipes as $pipe) { - stream_set_blocking($pipe, false); -} -$writePipes = array($pipes[0]); -$stdinLen = strlen($stdin); -$stdinOffset = 0; - -unset($pipes[0]); - -while ($pipes || $writePipes) { - $r = $pipes; - $w = $writePipes; - $e = null; - $n = stream_select($r, $w, $e, 60); - - if (false === $n) { - break; - } elseif ($n === 0) { - proc_terminate($process); - - } - if ($w) { - $written = fwrite($writePipes[0], substr($stdin, $stdinOffset), 8192); - if (false !== $written) { - $stdinOffset += $written; - } - if ($stdinOffset >= $stdinLen) { - fclose($writePipes[0]); - $writePipes = null; - } - } - - foreach ($r as $pipe) { - $type = array_search($pipe, $pipes); - $data = fread($pipe, 8192); - if (false === $data || feof($pipe)) { - fclose($pipe); - unset($pipes[$type]); - } - } -} -echo "OK."; -?> ---EXPECT-- -OK. +--TEST-- +Bug #60120 (proc_open hangs when data in stdin/out/err is getting larger or equal to 2048) +--SKIPIF-- + +--FILE-- + true, 'binary_pipes' => true, 'bypass_shell' => false)); +$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); + +foreach ($pipes as $pipe) { + stream_set_blocking($pipe, false); +} +$writePipes = array($pipes[0]); +$stdinLen = strlen($stdin); +$stdinOffset = 0; + +unset($pipes[0]); + +while ($pipes || $writePipes) { + $r = $pipes; + $w = $writePipes; + $e = null; + $n = stream_select($r, $w, $e, 60); + + if (false === $n) { + break; + } elseif ($n === 0) { + proc_terminate($process); + + } + if ($w) { + $written = fwrite($writePipes[0], substr($stdin, $stdinOffset), 8192); + if (false !== $written) { + $stdinOffset += $written; + } + if ($stdinOffset >= $stdinLen) { + fclose($writePipes[0]); + $writePipes = null; + } + } + + foreach ($r as $pipe) { + $type = array_search($pipe, $pipes); + $data = fread($pipe, 8192); + if (false === $data || feof($pipe)) { + fclose($pipe); + unset($pipes[$type]); + } + } +} +echo "OK."; +?> +--EXPECT-- +OK. diff --git a/ext/standard/tests/file/rename_variation8-win32.phpt b/ext/standard/tests/file/rename_variation8-win32.phpt index 1d25a12e049..7be25949f60 100644 --- a/ext/standard/tests/file/rename_variation8-win32.phpt +++ b/ext/standard/tests/file/rename_variation8-win32.phpt @@ -1,70 +1,70 @@ ---TEST-- -Test rename() function: variation ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing rename() on non-existing file *** - -Warning: rename(%s/non_existent_file.tmp,%s/rename_variation8_new.tmp): The system cannot find the file specified. (code: 2) in %s on line %d -bool(false) -bool(false) -bool(false) - -*** Testing rename() on existing directory *** -bool(true) -bool(false) -bool(true) - -*** Testing rename() on non-existing directory *** - -Warning: rename(%s/non_existent_dir,%s/rename_basic_dir2): The system cannot find the file specified. (code: 2) in %s on line %d -bool(false) -bool(false) -bool(false) -Done - +--TEST-- +Test rename() function: variation +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing rename() on non-existing file *** + +Warning: rename(%s/non_existent_file.tmp,%s/rename_variation8_new.tmp): The system cannot find the file specified. (code: 2) in %s on line %d +bool(false) +bool(false) +bool(false) + +*** Testing rename() on existing directory *** +bool(true) +bool(false) +bool(true) + +*** Testing rename() on non-existing directory *** + +Warning: rename(%s/non_existent_dir,%s/rename_basic_dir2): The system cannot find the file specified. (code: 2) in %s on line %d +bool(false) +bool(false) +bool(false) +Done + diff --git a/ext/standard/tests/file/stream_enclosed.phpt b/ext/standard/tests/file/stream_enclosed.phpt index 9520ecce74a..f487ed07442 100644 --- a/ext/standard/tests/file/stream_enclosed.phpt +++ b/ext/standard/tests/file/stream_enclosed.phpt @@ -1,20 +1,20 @@ ---TEST-- -Unexposed/leaked stream encloses another stream ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) +--TEST-- +Bug#48746 - Junction not working properly + +--CREDITS-- +Venkat Raman Don (don.raman@microsoft.com) + +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) diff --git a/ext/standard/tests/file/windows_links/bug48746_1.phpt b/ext/standard/tests/file/windows_links/bug48746_1.phpt index a4277a47a1d..56764bcf5fe 100644 --- a/ext/standard/tests/file/windows_links/bug48746_1.phpt +++ b/ext/standard/tests/file/windows_links/bug48746_1.phpt @@ -1,59 +1,59 @@ ---TEST-- -Bug#48746 - Junction not working properly - ---CREDITS-- -Venkat Raman Don (don.raman@microsoft.com) - ---SKIPIF-- - ---FILE-- -"); -include_once "mklink_junction\\a.php"; -file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", ""); -require "$fullpath\\mnt\\test\\directory\\b.php"; -file_put_contents("$fullpath\\mnt\\test\\mklink_junction\\c.php", ""); -require_once "$fullpath\\mnt\\test\\mklink_junction\\c.php"; -var_dump(is_file("mklink_junction\\a.php")); -var_dump(is_file("$fullpath\\mnt\\test\\directory\\b.php")); -var_dump(is_file("$fullpath\\mnt\\test\\mklink_junction\\c.php")); -unlink("$fullpath\\mnt\\test\\directory\\b.php"); -unlink("$fullpath\\mnt\\test\\mklink_junction\\c.php"); -unlink("mklink_junction\\a.php"); -chdir($old_dir); -rmdir(__DIR__ . "\\mnt\\test\\directory"); -rmdir(__DIR__ . "\\mnt\\test\\mklink_junction"); -rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); -rmdir(__DIR__ . "\\mnt\\test"); -rmdir(__DIR__ . "\\mnt"); - -?> ---EXPECT-- -I am included. -I am included. -I am included. -bool(true) -bool(true) -bool(true) +--TEST-- +Bug#48746 - Junction not working properly + +--CREDITS-- +Venkat Raman Don (don.raman@microsoft.com) + +--SKIPIF-- + +--FILE-- +"); +include_once "mklink_junction\\a.php"; +file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", ""); +require "$fullpath\\mnt\\test\\directory\\b.php"; +file_put_contents("$fullpath\\mnt\\test\\mklink_junction\\c.php", ""); +require_once "$fullpath\\mnt\\test\\mklink_junction\\c.php"; +var_dump(is_file("mklink_junction\\a.php")); +var_dump(is_file("$fullpath\\mnt\\test\\directory\\b.php")); +var_dump(is_file("$fullpath\\mnt\\test\\mklink_junction\\c.php")); +unlink("$fullpath\\mnt\\test\\directory\\b.php"); +unlink("$fullpath\\mnt\\test\\mklink_junction\\c.php"); +unlink("mklink_junction\\a.php"); +chdir($old_dir); +rmdir(__DIR__ . "\\mnt\\test\\directory"); +rmdir(__DIR__ . "\\mnt\\test\\mklink_junction"); +rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); +rmdir(__DIR__ . "\\mnt\\test"); +rmdir(__DIR__ . "\\mnt"); + +?> +--EXPECT-- +I am included. +I am included. +I am included. +bool(true) +bool(true) +bool(true) diff --git a/ext/standard/tests/file/windows_links/bug48746_2.phpt b/ext/standard/tests/file/windows_links/bug48746_2.phpt index 509610f8a40..9f2ff850b61 100644 --- a/ext/standard/tests/file/windows_links/bug48746_2.phpt +++ b/ext/standard/tests/file/windows_links/bug48746_2.phpt @@ -1,69 +1,69 @@ ---TEST-- -Bug#48746 - Junction not working properly - ---CREDITS-- -Venkat Raman Don (don.raman@microsoft.com) - ---SKIPIF-- -&1', $out); -if (strpos($ret, 'privilege')) { - die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); -} -unlink('bug48746_tmp.lnk'); -?> ---FILE-- -"); -file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", ""); -print_r(scandir("mklink_junction")); -print_r(scandir("$fullpath\\mnt\\test\\directory")); -print_r(scandir("$fullpath\\mnt\\test\\mklink_junction")); -unlink("$fullpath\\mnt\\test\\directory\\b.php"); -unlink("mklink_junction\\a.php"); -chdir($old_dir); -rmdir(__DIR__ . "\\mnt\\test\\directory"); -rmdir(__DIR__ . "\\mnt\\test\\mklink_junction"); -rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); -rmdir(__DIR__ . "\\mnt\\test"); -rmdir(__DIR__ . "\\mnt"); - -?> ---EXPECT-- -Array -( - [0] => . - [1] => .. - [2] => a.php - [3] => b.php -) -Array -( - [0] => . - [1] => .. - [2] => a.php - [3] => b.php -) -Array -( - [0] => . - [1] => .. - [2] => a.php - [3] => b.php -) +--TEST-- +Bug#48746 - Junction not working properly + +--CREDITS-- +Venkat Raman Don (don.raman@microsoft.com) + +--SKIPIF-- +&1', $out); +if (strpos($ret, 'privilege')) { + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); +} +unlink('bug48746_tmp.lnk'); +?> +--FILE-- +"); +file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", ""); +print_r(scandir("mklink_junction")); +print_r(scandir("$fullpath\\mnt\\test\\directory")); +print_r(scandir("$fullpath\\mnt\\test\\mklink_junction")); +unlink("$fullpath\\mnt\\test\\directory\\b.php"); +unlink("mklink_junction\\a.php"); +chdir($old_dir); +rmdir(__DIR__ . "\\mnt\\test\\directory"); +rmdir(__DIR__ . "\\mnt\\test\\mklink_junction"); +rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); +rmdir(__DIR__ . "\\mnt\\test"); +rmdir(__DIR__ . "\\mnt"); + +?> +--EXPECT-- +Array +( + [0] => . + [1] => .. + [2] => a.php + [3] => b.php +) +Array +( + [0] => . + [1] => .. + [2] => a.php + [3] => b.php +) +Array +( + [0] => . + [1] => .. + [2] => a.php + [3] => b.php +) diff --git a/ext/standard/tests/file/windows_links/bug48746_3.phpt b/ext/standard/tests/file/windows_links/bug48746_3.phpt index 98e81787b80..83bdea3a8c1 100644 --- a/ext/standard/tests/file/windows_links/bug48746_3.phpt +++ b/ext/standard/tests/file/windows_links/bug48746_3.phpt @@ -1,50 +1,50 @@ ---TEST-- -Bug#48746 - Junction not working properly - ---CREDITS-- -Venkat Raman Don (don.raman@microsoft.com) - ---SKIPIF-- -&1', $out); -if (strpos($out[0], 'recognized')) { - die('skip. junction.exe not found in PATH.'); -} - -?> ---FILE-- -"); -file_put_contents("junction\\b.php", ""); -include "junction/a.php"; -require_once "junction\\b.php"; -print_r(scandir("junction")); -unlink("junction\\a.php"); -unlink("junction\\b.php"); -chdir($old_dir); -rmdir(__DIR__ . "\\mnt\\test\\directory"); -rmdir(__DIR__ . "\\mnt\\test\\junction"); -rmdir(__DIR__ . "\\mnt\\test"); -rmdir(__DIR__ . "\\mnt"); - -?> ---EXPECT-- -I am included. -I am included. -Array -( - [0] => . - [1] => .. - [2] => a.php - [3] => b.php -) +--TEST-- +Bug#48746 - Junction not working properly + +--CREDITS-- +Venkat Raman Don (don.raman@microsoft.com) + +--SKIPIF-- +&1', $out); +if (strpos($out[0], 'recognized')) { + die('skip. junction.exe not found in PATH.'); +} + +?> +--FILE-- +"); +file_put_contents("junction\\b.php", ""); +include "junction/a.php"; +require_once "junction\\b.php"; +print_r(scandir("junction")); +unlink("junction\\a.php"); +unlink("junction\\b.php"); +chdir($old_dir); +rmdir(__DIR__ . "\\mnt\\test\\directory"); +rmdir(__DIR__ . "\\mnt\\test\\junction"); +rmdir(__DIR__ . "\\mnt\\test"); +rmdir(__DIR__ . "\\mnt"); + +?> +--EXPECT-- +I am included. +I am included. +Array +( + [0] => . + [1] => .. + [2] => a.php + [3] => b.php +) diff --git a/ext/standard/tests/general_functions/bug50690.phpt b/ext/standard/tests/general_functions/bug50690.phpt index 4d9f0dc5ee9..54198a1337b 100644 --- a/ext/standard/tests/general_functions/bug50690.phpt +++ b/ext/standard/tests/general_functions/bug50690.phpt @@ -1,14 +1,14 @@ ---TEST-- -Bug #23650 (putenv() does not assign values when the value is one character) ---FILE-- - ---EXPECT-- -string(2) "ab" -string(1) "c" -bool(false) +--TEST-- +Bug #23650 (putenv() does not assign values when the value is one character) +--FILE-- + +--EXPECT-- +string(2) "ab" +string(1) "c" +bool(false) diff --git a/ext/standard/tests/general_functions/get_defined_constants_basic.phpt b/ext/standard/tests/general_functions/get_defined_constants_basic.phpt index 9e2e66c94c4..544887129f4 100644 --- a/ext/standard/tests/general_functions/get_defined_constants_basic.phpt +++ b/ext/standard/tests/general_functions/get_defined_constants_basic.phpt @@ -1,39 +1,39 @@ ---TEST-- -Test get_defined_constants() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing get_defined_constants() : basic functionality *** -string(5) "array" -string(5) "array" -array(0) { -} -TEST PASSED +--TEST-- +Test get_defined_constants() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing get_defined_constants() : basic functionality *** +string(5) "array" +string(5) "array" +array(0) { +} +TEST PASSED ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/general_functions/get_loaded_extensions_basic.phpt b/ext/standard/tests/general_functions/get_loaded_extensions_basic.phpt index 4a8eceb24bc..52b2136f5b4 100644 --- a/ext/standard/tests/general_functions/get_loaded_extensions_basic.phpt +++ b/ext/standard/tests/general_functions/get_loaded_extensions_basic.phpt @@ -1,23 +1,23 @@ ---TEST-- -Test get_loaded_extensions() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing get_loaded_extensions() : basic functionality *** -Get loaded extensions -array(%d) { -%a -} +--TEST-- +Test get_loaded_extensions() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing get_loaded_extensions() : basic functionality *** +Get loaded extensions +array(%d) { +%a +} ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/general_functions/uniqid_error.phpt b/ext/standard/tests/general_functions/uniqid_error.phpt index 96084313c7e..8f7f22d7d3d 100644 --- a/ext/standard/tests/general_functions/uniqid_error.phpt +++ b/ext/standard/tests/general_functions/uniqid_error.phpt @@ -1,46 +1,46 @@ ---TEST-- -Test uniqid() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing uniqid() : error conditions *** - --- Testing uniqid() function with more than expected no. of arguments -- - -Warning: uniqid() expects at most 2 parameters, 3 given in %s on line %d -NULL - --- Testing uniqid() function with invalid values for $prefix -- - -Warning: uniqid() expects parameter 1 to be string, array given in %s on line %d - -Warning: uniqid() expects parameter 1 to be string, resource given in %s on line %d - -Warning: uniqid() expects parameter 1 to be string, object given in %s on line %d +--TEST-- +Test uniqid() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing uniqid() : error conditions *** + +-- Testing uniqid() function with more than expected no. of arguments -- + +Warning: uniqid() expects at most 2 parameters, 3 given in %s on line %d +NULL + +-- Testing uniqid() function with invalid values for $prefix -- + +Warning: uniqid() expects parameter 1 to be string, array given in %s on line %d + +Warning: uniqid() expects parameter 1 to be string, resource given in %s on line %d + +Warning: uniqid() expects parameter 1 to be string, object given in %s on line %d ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/mail/bug73203.phpt b/ext/standard/tests/mail/bug73203.phpt index 6b3bf6618c6..79615f31b55 100644 --- a/ext/standard/tests/mail/bug73203.phpt +++ b/ext/standard/tests/mail/bug73203.phpt @@ -1,24 +1,24 @@ ---TEST-- -Bug #73203 (passing additional_parameters causes mail to fail) ---DESCRIPTION-- -We're not really interested in testing mail() here, but it is currently the -only function besides mb_send_mail() which allows to call php_escape_shell_cmd() -with an empty string. Therefore we don't check the resulting email, but only -verify that the call succeeds. ---INI-- -sendmail_path=cat >/dev/null -mail.add_x_header = Off ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -bool(true) -===DONE=== +--TEST-- +Bug #73203 (passing additional_parameters causes mail to fail) +--DESCRIPTION-- +We're not really interested in testing mail() here, but it is currently the +only function besides mb_send_mail() which allows to call php_escape_shell_cmd() +with an empty string. Therefore we don't check the resulting email, but only +verify that the call succeeds. +--INI-- +sendmail_path=cat >/dev/null +mail.add_x_header = Off +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +bool(true) +===DONE=== diff --git a/ext/standard/tests/network/gethostbyname_basic003.phpt b/ext/standard/tests/network/gethostbyname_basic003.phpt index 711490c4130..2cb3d8d2293 100644 --- a/ext/standard/tests/network/gethostbyname_basic003.phpt +++ b/ext/standard/tests/network/gethostbyname_basic003.phpt @@ -1,18 +1,18 @@ ---TEST-- -Test gethostbyname() function : basic functionality ---FILE-- - -===DONE=== ---EXPECT-- -*** Testing gethostbyname() : basic functionality *** -127.0.0.1 +--TEST-- +Test gethostbyname() function : basic functionality +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing gethostbyname() : basic functionality *** +127.0.0.1 ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/network/gethostbynamel_basic1.phpt b/ext/standard/tests/network/gethostbynamel_basic1.phpt index 5ce7c4251aa..9d1580c8261 100644 --- a/ext/standard/tests/network/gethostbynamel_basic1.phpt +++ b/ext/standard/tests/network/gethostbynamel_basic1.phpt @@ -1,19 +1,19 @@ ---TEST-- -Test gethostbynamel() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing gethostbynamel() : basic functionality *** -array(%d) { - %a -} +--TEST-- +Test gethostbynamel() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing gethostbynamel() : basic functionality *** +array(%d) { + %a +} ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/password/password_get_info_argon2.phpt b/ext/standard/tests/password/password_get_info_argon2.phpt index 80c6f934163..0c9080f0a9d 100644 --- a/ext/standard/tests/password/password_get_info_argon2.phpt +++ b/ext/standard/tests/password/password_get_info_argon2.phpt @@ -1,29 +1,29 @@ ---TEST-- -Test normal operation of password_get_info() with Argon2 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -array(3) { - ["algo"]=> - int(2) - ["algoName"]=> - string(7) "argon2i" - ["options"]=> - array(3) { - ["memory_cost"]=> - int(65536) - ["time_cost"]=> - int(3) - ["threads"]=> - int(1) - } -} +--TEST-- +Test normal operation of password_get_info() with Argon2 +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(3) { + ["algo"]=> + int(2) + ["algoName"]=> + string(7) "argon2i" + ["options"]=> + array(3) { + ["memory_cost"]=> + int(65536) + ["time_cost"]=> + int(3) + ["threads"]=> + int(1) + } +} OK! \ No newline at end of file diff --git a/ext/standard/tests/password/password_hash_argon2.phpt b/ext/standard/tests/password/password_hash_argon2.phpt index 7bd8cd700c1..29f7f28a953 100644 --- a/ext/standard/tests/password/password_hash_argon2.phpt +++ b/ext/standard/tests/password/password_hash_argon2.phpt @@ -1,18 +1,18 @@ ---TEST-- -Test normal operation of password_hash() with argon2 ---SKIPIF-- - ---EXPECT-- -bool(true) +--TEST-- +Test normal operation of password_hash() with argon2 +--SKIPIF-- + +--EXPECT-- +bool(true) OK! \ No newline at end of file diff --git a/ext/standard/tests/password/password_hash_error_argon2.phpt b/ext/standard/tests/password/password_hash_error_argon2.phpt index 7e8722ec6f1..92c71e064b0 100644 --- a/ext/standard/tests/password/password_hash_error_argon2.phpt +++ b/ext/standard/tests/password/password_hash_error_argon2.phpt @@ -1,21 +1,21 @@ ---TEST-- -Test error operation of password_hash() with argon2 ---SKIPIF-- - ---FILE-- - 0])); -var_dump(password_hash('test', PASSWORD_ARGON2I, ['time_cost' => 0])); -var_dump(password_hash('test', PASSWORD_ARGON2I, ['threads' => 0])); -?> ---EXPECTF-- -Warning: password_hash(): Memory cost is outside of allowed memory range in %s on line %d -NULL - -Warning: password_hash(): Time cost is outside of allowed time range in %s on line %d -NULL - -Warning: password_hash(): Invalid number of threads in %s on line %d +--TEST-- +Test error operation of password_hash() with argon2 +--SKIPIF-- + +--FILE-- + 0])); +var_dump(password_hash('test', PASSWORD_ARGON2I, ['time_cost' => 0])); +var_dump(password_hash('test', PASSWORD_ARGON2I, ['threads' => 0])); +?> +--EXPECTF-- +Warning: password_hash(): Memory cost is outside of allowed memory range in %s on line %d +NULL + +Warning: password_hash(): Time cost is outside of allowed time range in %s on line %d +NULL + +Warning: password_hash(): Invalid number of threads in %s on line %d NULL \ No newline at end of file diff --git a/ext/standard/tests/password/password_needs_rehash_argon2.phpt b/ext/standard/tests/password/password_needs_rehash_argon2.phpt index 61fc0a5cae9..0b5fede1e35 100644 --- a/ext/standard/tests/password/password_needs_rehash_argon2.phpt +++ b/ext/standard/tests/password/password_needs_rehash_argon2.phpt @@ -1,22 +1,22 @@ ---TEST-- -Test normal operation of password_needs_rehash() with argon2 ---SKIPIF-- - ---FILE-- - 1<<17])); -var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['time_cost' => 4])); -var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['threads' => 4])); -echo "OK!"; -?> ---EXPECT-- -bool(false) -bool(true) -bool(true) -bool(true) -OK! +--TEST-- +Test normal operation of password_needs_rehash() with argon2 +--SKIPIF-- + +--FILE-- + 1<<17])); +var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['time_cost' => 4])); +var_dump(password_needs_rehash($hash, PASSWORD_ARGON2I, ['threads' => 4])); +echo "OK!"; +?> +--EXPECT-- +bool(false) +bool(true) +bool(true) +bool(true) +OK! diff --git a/ext/standard/tests/password/password_verify_argon2.phpt b/ext/standard/tests/password/password_verify_argon2.phpt index e3a35942f59..986f5e70050 100644 --- a/ext/standard/tests/password/password_verify_argon2.phpt +++ b/ext/standard/tests/password/password_verify_argon2.phpt @@ -1,18 +1,18 @@ ---TEST-- -Test normal operation of password_verify() with argon2 ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -bool(false) +--TEST-- +Test normal operation of password_verify() with argon2 +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) +bool(false) OK! \ No newline at end of file diff --git a/ext/standard/tests/streams/bug49936_win32.phpt b/ext/standard/tests/streams/bug49936_win32.phpt index 4db4a5044f4..594fcae4be5 100644 --- a/ext/standard/tests/streams/bug49936_win32.phpt +++ b/ext/standard/tests/streams/bug49936_win32.phpt @@ -1,30 +1,30 @@ ---TEST-- -Bug #49936 (crash with ftp stream in php_stream_context_get_option()) ---SKIPIF-- - ---INI-- -default_socket_timeout=2 ---FILE-- - ---EXPECTF-- -Warning: opendir(): connect() failed: %s - in %s on line %d - -Warning: opendir(ftp://...@localhost/): failed to open dir: operation failed in %s on line %d -bool(false) - -Warning: opendir(): connect() failed: %s - in %s on line %d - -Warning: opendir(ftp://...@localhost/): failed to open dir: operation failed in %s on line %d -bool(false) +--TEST-- +Bug #49936 (crash with ftp stream in php_stream_context_get_option()) +--SKIPIF-- + +--INI-- +default_socket_timeout=2 +--FILE-- + +--EXPECTF-- +Warning: opendir(): connect() failed: %s + in %s on line %d + +Warning: opendir(ftp://...@localhost/): failed to open dir: operation failed in %s on line %d +bool(false) + +Warning: opendir(): connect() failed: %s + in %s on line %d + +Warning: opendir(ftp://...@localhost/): failed to open dir: operation failed in %s on line %d +bool(false) diff --git a/ext/standard/tests/strings/bug49687.phpt b/ext/standard/tests/strings/bug49687.phpt index 99e8dc3ec65..ae191be0881 100644 --- a/ext/standard/tests/strings/bug49687.phpt +++ b/ext/standard/tests/strings/bug49687.phpt @@ -1,19 +1,19 @@ ---TEST-- -Bug #49687 Several utf8_decode deficiencies and vulnerabilities ---FILE-- - ---EXPECT-- -$1$f+uslYF01$ -$1$f+uslYF0$orVloNmKSLvOeswusE0bY. +--TEST-- +Bug #50052 (Different Hashes on Windows and Linux on wrong Salt size) +--FILE-- + +--EXPECT-- +$1$f+uslYF01$ +$1$f+uslYF0$orVloNmKSLvOeswusE0bY. diff --git a/ext/standard/tests/strings/bug53021.phpt b/ext/standard/tests/strings/bug53021.phpt index 38d904761d0..15b3cb07e9a 100644 --- a/ext/standard/tests/strings/bug53021.phpt +++ b/ext/standard/tests/strings/bug53021.phpt @@ -1,40 +1,40 @@ ---TEST-- -Bug #53021 (Failure to convert numeric entities with ENT_NOQUOTES and ISO-8859-1) ---FILE-- - - string(2) "e9" -} -double quotes variations: -" -" -" -" -" -" -" -" - -single quotes variations: -' -' -' -' +--TEST-- +Bug #53021 (Failure to convert numeric entities with ENT_NOQUOTES and ISO-8859-1) +--FILE-- + + string(2) "e9" +} +double quotes variations: +" +" +" +" +" +" +" +" + +single quotes variations: +' +' +' +' diff --git a/ext/standard/tests/strings/get_html_translation_table_basic1.phpt b/ext/standard/tests/strings/get_html_translation_table_basic1.phpt index 87857d9cbdc..83892a381ae 100644 --- a/ext/standard/tests/strings/get_html_translation_table_basic1.phpt +++ b/ext/standard/tests/strings/get_html_translation_table_basic1.phpt @@ -1,549 +1,549 @@ ---TEST-- -Test get_html_translation_table() function : basic functionality - with default args ---FILE-- - ---EXPECT-- -*** Testing get_html_translation_table() : basic functionality *** --- with table = HTML_ENTITIES -- -array(252) { - ["Æ"]=> - string(7) "Æ" - ["Á"]=> - string(8) "Á" - ["Â"]=> - string(7) "Â" - ["À"]=> - string(8) "À" - ["Α"]=> - string(7) "Α" - ["Å"]=> - string(7) "Å" - ["Ã"]=> - string(8) "Ã" - ["Ä"]=> - string(6) "Ä" - ["Β"]=> - string(6) "Β" - ["Ç"]=> - string(8) "Ç" - ["Χ"]=> - string(5) "Χ" - ["‡"]=> - string(8) "‡" - ["Δ"]=> - string(7) "Δ" - ["Ð"]=> - string(5) "Ð" - ["É"]=> - string(8) "É" - ["Ê"]=> - string(7) "Ê" - ["È"]=> - string(8) "È" - ["Ε"]=> - string(9) "Ε" - ["Η"]=> - string(5) "Η" - ["Ë"]=> - string(6) "Ë" - ["Γ"]=> - string(7) "Γ" - ["Í"]=> - string(8) "Í" - ["Î"]=> - string(7) "Î" - ["Ì"]=> - string(8) "Ì" - ["Ι"]=> - string(6) "Ι" - ["Ï"]=> - string(6) "Ï" - ["Κ"]=> - string(7) "Κ" - ["Λ"]=> - string(8) "Λ" - ["Μ"]=> - string(4) "Μ" - ["Ñ"]=> - string(8) "Ñ" - ["Ν"]=> - string(4) "Ν" - ["Œ"]=> - string(7) "Œ" - ["Ó"]=> - string(8) "Ó" - ["Ô"]=> - string(7) "Ô" - ["Ò"]=> - string(8) "Ò" - ["Ω"]=> - string(7) "Ω" - ["Ο"]=> - string(9) "Ο" - ["Ø"]=> - string(8) "Ø" - ["Õ"]=> - string(8) "Õ" - ["Ö"]=> - string(6) "Ö" - ["Φ"]=> - string(5) "Φ" - ["Π"]=> - string(4) "Π" - ["″"]=> - string(7) "″" - ["Ψ"]=> - string(5) "Ψ" - ["Ρ"]=> - string(5) "Ρ" - ["Š"]=> - string(8) "Š" - ["Σ"]=> - string(7) "Σ" - ["Þ"]=> - string(7) "Þ" - ["Τ"]=> - string(5) "Τ" - ["Θ"]=> - string(7) "Θ" - ["Ú"]=> - string(8) "Ú" - ["Û"]=> - string(7) "Û" - ["Ù"]=> - string(8) "Ù" - ["Υ"]=> - string(9) "Υ" - ["Ü"]=> - string(6) "Ü" - ["Ξ"]=> - string(4) "Ξ" - ["Ý"]=> - string(8) "Ý" - ["Ÿ"]=> - string(6) "Ÿ" - ["Ζ"]=> - string(6) "Ζ" - ["á"]=> - string(8) "á" - ["â"]=> - string(7) "â" - ["´"]=> - string(7) "´" - ["æ"]=> - string(7) "æ" - ["à"]=> - string(8) "à" - ["ℵ"]=> - string(9) "ℵ" - ["α"]=> - string(7) "α" - ["&"]=> - string(5) "&" - ["∧"]=> - string(5) "∧" - ["∠"]=> - string(5) "∠" - ["å"]=> - string(7) "å" - ["≈"]=> - string(7) "≈" - ["ã"]=> - string(8) "ã" - ["ä"]=> - string(6) "ä" - ["„"]=> - string(7) "„" - ["β"]=> - string(6) "β" - ["¦"]=> - string(8) "¦" - ["•"]=> - string(6) "•" - ["∩"]=> - string(5) "∩" - ["ç"]=> - string(8) "ç" - ["¸"]=> - string(7) "¸" - ["¢"]=> - string(6) "¢" - ["χ"]=> - string(5) "χ" - ["ˆ"]=> - string(6) "ˆ" - ["♣"]=> - string(7) "♣" - ["≅"]=> - string(6) "≅" - ["©"]=> - string(6) "©" - ["↵"]=> - string(7) "↵" - ["∪"]=> - string(5) "∪" - ["¤"]=> - string(8) "¤" - ["⇓"]=> - string(6) "⇓" - ["†"]=> - string(8) "†" - ["↓"]=> - string(6) "↓" - ["°"]=> - string(5) "°" - ["δ"]=> - string(7) "δ" - ["♦"]=> - string(7) "♦" - ["÷"]=> - string(8) "÷" - ["é"]=> - string(8) "é" - ["ê"]=> - string(7) "ê" - ["è"]=> - string(8) "è" - ["∅"]=> - string(7) "∅" - [" "]=> - string(6) " " - [" "]=> - string(6) " " - ["ε"]=> - string(9) "ε" - ["≡"]=> - string(7) "≡" - ["η"]=> - string(5) "η" - ["ð"]=> - string(5) "ð" - ["ë"]=> - string(6) "ë" - ["€"]=> - string(6) "€" - ["∃"]=> - string(7) "∃" - ["ƒ"]=> - string(6) "ƒ" - ["∀"]=> - string(8) "∀" - ["½"]=> - string(8) "½" - ["¼"]=> - string(8) "¼" - ["¾"]=> - string(8) "¾" - ["⁄"]=> - string(7) "⁄" - ["γ"]=> - string(7) "γ" - ["≥"]=> - string(4) "≥" - [">"]=> - string(4) ">" - ["⇔"]=> - string(6) "⇔" - ["↔"]=> - string(6) "↔" - ["♥"]=> - string(8) "♥" - ["…"]=> - string(8) "…" - ["í"]=> - string(8) "í" - ["î"]=> - string(7) "î" - ["¡"]=> - string(7) "¡" - ["ì"]=> - string(8) "ì" - ["ℑ"]=> - string(7) "ℑ" - ["∞"]=> - string(7) "∞" - ["∫"]=> - string(5) "∫" - ["ι"]=> - string(6) "ι" - ["¿"]=> - string(8) "¿" - ["∈"]=> - string(6) "∈" - ["ï"]=> - string(6) "ï" - ["κ"]=> - string(7) "κ" - ["⇐"]=> - string(6) "⇐" - ["λ"]=> - string(8) "λ" - ["〈"]=> - string(6) "⟨" - ["«"]=> - string(7) "«" - ["←"]=> - string(6) "←" - ["⌈"]=> - string(7) "⌈" - ["“"]=> - string(7) "“" - ["≤"]=> - string(4) "≤" - ["⌊"]=> - string(8) "⌊" - ["∗"]=> - string(8) "∗" - ["◊"]=> - string(5) "◊" - ["‎"]=> - string(5) "‎" - ["‹"]=> - string(8) "‹" - ["‘"]=> - string(7) "‘" - ["<"]=> - string(4) "<" - ["¯"]=> - string(6) "¯" - ["—"]=> - string(7) "—" - ["µ"]=> - string(7) "µ" - ["·"]=> - string(8) "·" - ["−"]=> - string(7) "−" - ["μ"]=> - string(4) "μ" - ["∇"]=> - string(7) "∇" - [" "]=> - string(6) " " - ["–"]=> - string(7) "–" - ["≠"]=> - string(4) "≠" - ["∋"]=> - string(4) "∋" - ["¬"]=> - string(5) "¬" - ["∉"]=> - string(7) "∉" - ["⊄"]=> - string(6) "⊄" - ["ñ"]=> - string(8) "ñ" - ["ν"]=> - string(4) "ν" - ["ó"]=> - string(8) "ó" - ["ô"]=> - string(7) "ô" - ["œ"]=> - string(7) "œ" - ["ò"]=> - string(8) "ò" - ["‾"]=> - string(7) "‾" - ["ω"]=> - string(7) "ω" - ["ο"]=> - string(9) "ο" - ["⊕"]=> - string(7) "⊕" - ["∨"]=> - string(4) "∨" - ["ª"]=> - string(6) "ª" - ["º"]=> - string(6) "º" - ["ø"]=> - string(8) "ø" - ["õ"]=> - string(8) "õ" - ["⊗"]=> - string(8) "⊗" - ["ö"]=> - string(6) "ö" - ["¶"]=> - string(6) "¶" - ["∂"]=> - string(6) "∂" - ["‰"]=> - string(8) "‰" - ["⊥"]=> - string(6) "⊥" - ["φ"]=> - string(5) "φ" - ["π"]=> - string(4) "π" - ["ϖ"]=> - string(5) "ϖ" - ["±"]=> - string(8) "±" - ["£"]=> - string(7) "£" - ["′"]=> - string(7) "′" - ["∏"]=> - string(6) "∏" - ["∝"]=> - string(6) "∝" - ["ψ"]=> - string(5) "ψ" - ["""]=> - string(6) """ - ["⇒"]=> - string(6) "⇒" - ["√"]=> - string(7) "√" - ["〉"]=> - string(6) "⟩" - ["»"]=> - string(7) "»" - ["→"]=> - string(6) "→" - ["⌉"]=> - string(7) "⌉" - ["”"]=> - string(7) "”" - ["ℜ"]=> - string(6) "ℜ" - ["®"]=> - string(5) "®" - ["⌋"]=> - string(8) "⌋" - ["ρ"]=> - string(5) "ρ" - ["‏"]=> - string(5) "‏" - ["›"]=> - string(8) "›" - ["’"]=> - string(7) "’" - ["‚"]=> - string(7) "‚" - ["š"]=> - string(8) "š" - ["⋅"]=> - string(6) "⋅" - ["§"]=> - string(6) "§" - ["­"]=> - string(5) "­" - ["σ"]=> - string(7) "σ" - ["ς"]=> - string(8) "ς" - ["∼"]=> - string(5) "∼" - ["♠"]=> - string(8) "♠" - ["⊂"]=> - string(5) "⊂" - ["⊆"]=> - string(6) "⊆" - ["∑"]=> - string(5) "∑" - ["¹"]=> - string(6) "¹" - ["²"]=> - string(6) "²" - ["³"]=> - string(6) "³" - ["⊃"]=> - string(5) "⊃" - ["⊇"]=> - string(6) "⊇" - ["ß"]=> - string(7) "ß" - ["τ"]=> - string(5) "τ" - ["∴"]=> - string(8) "∴" - ["θ"]=> - string(7) "θ" - ["ϑ"]=> - string(10) "ϑ" - [" "]=> - string(8) " " - ["þ"]=> - string(7) "þ" - ["˜"]=> - string(7) "˜" - ["×"]=> - string(7) "×" - ["™"]=> - string(7) "™" - ["⇑"]=> - string(6) "⇑" - ["ú"]=> - string(8) "ú" - ["↑"]=> - string(6) "↑" - ["û"]=> - string(7) "û" - ["ù"]=> - string(8) "ù" - ["¨"]=> - string(5) "¨" - ["ϒ"]=> - string(7) "ϒ" - ["υ"]=> - string(9) "υ" - ["ü"]=> - string(6) "ü" - ["℘"]=> - string(8) "℘" - ["ξ"]=> - string(4) "ξ" - ["ý"]=> - string(8) "ý" - ["¥"]=> - string(5) "¥" - ["ÿ"]=> - string(6) "ÿ" - ["ζ"]=> - string(6) "ζ" - ["‍"]=> - string(5) "‍" - ["‌"]=> - string(6) "‌" -} --- with table = HTML_SPECIALCHARS -- -array(4) { - ["&"]=> - string(5) "&" - [">"]=> - string(4) ">" - ["<"]=> - string(4) "<" - ["""]=> - string(6) """ -} -Done +--TEST-- +Test get_html_translation_table() function : basic functionality - with default args +--FILE-- + +--EXPECT-- +*** Testing get_html_translation_table() : basic functionality *** +-- with table = HTML_ENTITIES -- +array(252) { + ["Æ"]=> + string(7) "Æ" + ["Á"]=> + string(8) "Á" + ["Â"]=> + string(7) "Â" + ["À"]=> + string(8) "À" + ["Α"]=> + string(7) "Α" + ["Å"]=> + string(7) "Å" + ["Ã"]=> + string(8) "Ã" + ["Ä"]=> + string(6) "Ä" + ["Β"]=> + string(6) "Β" + ["Ç"]=> + string(8) "Ç" + ["Χ"]=> + string(5) "Χ" + ["‡"]=> + string(8) "‡" + ["Δ"]=> + string(7) "Δ" + ["Ð"]=> + string(5) "Ð" + ["É"]=> + string(8) "É" + ["Ê"]=> + string(7) "Ê" + ["È"]=> + string(8) "È" + ["Ε"]=> + string(9) "Ε" + ["Η"]=> + string(5) "Η" + ["Ë"]=> + string(6) "Ë" + ["Γ"]=> + string(7) "Γ" + ["Í"]=> + string(8) "Í" + ["Î"]=> + string(7) "Î" + ["Ì"]=> + string(8) "Ì" + ["Ι"]=> + string(6) "Ι" + ["Ï"]=> + string(6) "Ï" + ["Κ"]=> + string(7) "Κ" + ["Λ"]=> + string(8) "Λ" + ["Μ"]=> + string(4) "Μ" + ["Ñ"]=> + string(8) "Ñ" + ["Ν"]=> + string(4) "Ν" + ["Œ"]=> + string(7) "Œ" + ["Ó"]=> + string(8) "Ó" + ["Ô"]=> + string(7) "Ô" + ["Ò"]=> + string(8) "Ò" + ["Ω"]=> + string(7) "Ω" + ["Ο"]=> + string(9) "Ο" + ["Ø"]=> + string(8) "Ø" + ["Õ"]=> + string(8) "Õ" + ["Ö"]=> + string(6) "Ö" + ["Φ"]=> + string(5) "Φ" + ["Π"]=> + string(4) "Π" + ["″"]=> + string(7) "″" + ["Ψ"]=> + string(5) "Ψ" + ["Ρ"]=> + string(5) "Ρ" + ["Š"]=> + string(8) "Š" + ["Σ"]=> + string(7) "Σ" + ["Þ"]=> + string(7) "Þ" + ["Τ"]=> + string(5) "Τ" + ["Θ"]=> + string(7) "Θ" + ["Ú"]=> + string(8) "Ú" + ["Û"]=> + string(7) "Û" + ["Ù"]=> + string(8) "Ù" + ["Υ"]=> + string(9) "Υ" + ["Ü"]=> + string(6) "Ü" + ["Ξ"]=> + string(4) "Ξ" + ["Ý"]=> + string(8) "Ý" + ["Ÿ"]=> + string(6) "Ÿ" + ["Ζ"]=> + string(6) "Ζ" + ["á"]=> + string(8) "á" + ["â"]=> + string(7) "â" + ["´"]=> + string(7) "´" + ["æ"]=> + string(7) "æ" + ["à"]=> + string(8) "à" + ["ℵ"]=> + string(9) "ℵ" + ["α"]=> + string(7) "α" + ["&"]=> + string(5) "&" + ["∧"]=> + string(5) "∧" + ["∠"]=> + string(5) "∠" + ["å"]=> + string(7) "å" + ["≈"]=> + string(7) "≈" + ["ã"]=> + string(8) "ã" + ["ä"]=> + string(6) "ä" + ["„"]=> + string(7) "„" + ["β"]=> + string(6) "β" + ["¦"]=> + string(8) "¦" + ["•"]=> + string(6) "•" + ["∩"]=> + string(5) "∩" + ["ç"]=> + string(8) "ç" + ["¸"]=> + string(7) "¸" + ["¢"]=> + string(6) "¢" + ["χ"]=> + string(5) "χ" + ["ˆ"]=> + string(6) "ˆ" + ["♣"]=> + string(7) "♣" + ["≅"]=> + string(6) "≅" + ["©"]=> + string(6) "©" + ["↵"]=> + string(7) "↵" + ["∪"]=> + string(5) "∪" + ["¤"]=> + string(8) "¤" + ["⇓"]=> + string(6) "⇓" + ["†"]=> + string(8) "†" + ["↓"]=> + string(6) "↓" + ["°"]=> + string(5) "°" + ["δ"]=> + string(7) "δ" + ["♦"]=> + string(7) "♦" + ["÷"]=> + string(8) "÷" + ["é"]=> + string(8) "é" + ["ê"]=> + string(7) "ê" + ["è"]=> + string(8) "è" + ["∅"]=> + string(7) "∅" + [" "]=> + string(6) " " + [" "]=> + string(6) " " + ["ε"]=> + string(9) "ε" + ["≡"]=> + string(7) "≡" + ["η"]=> + string(5) "η" + ["ð"]=> + string(5) "ð" + ["ë"]=> + string(6) "ë" + ["€"]=> + string(6) "€" + ["∃"]=> + string(7) "∃" + ["ƒ"]=> + string(6) "ƒ" + ["∀"]=> + string(8) "∀" + ["½"]=> + string(8) "½" + ["¼"]=> + string(8) "¼" + ["¾"]=> + string(8) "¾" + ["⁄"]=> + string(7) "⁄" + ["γ"]=> + string(7) "γ" + ["≥"]=> + string(4) "≥" + [">"]=> + string(4) ">" + ["⇔"]=> + string(6) "⇔" + ["↔"]=> + string(6) "↔" + ["♥"]=> + string(8) "♥" + ["…"]=> + string(8) "…" + ["í"]=> + string(8) "í" + ["î"]=> + string(7) "î" + ["¡"]=> + string(7) "¡" + ["ì"]=> + string(8) "ì" + ["ℑ"]=> + string(7) "ℑ" + ["∞"]=> + string(7) "∞" + ["∫"]=> + string(5) "∫" + ["ι"]=> + string(6) "ι" + ["¿"]=> + string(8) "¿" + ["∈"]=> + string(6) "∈" + ["ï"]=> + string(6) "ï" + ["κ"]=> + string(7) "κ" + ["⇐"]=> + string(6) "⇐" + ["λ"]=> + string(8) "λ" + ["〈"]=> + string(6) "⟨" + ["«"]=> + string(7) "«" + ["←"]=> + string(6) "←" + ["⌈"]=> + string(7) "⌈" + ["“"]=> + string(7) "“" + ["≤"]=> + string(4) "≤" + ["⌊"]=> + string(8) "⌊" + ["∗"]=> + string(8) "∗" + ["◊"]=> + string(5) "◊" + ["‎"]=> + string(5) "‎" + ["‹"]=> + string(8) "‹" + ["‘"]=> + string(7) "‘" + ["<"]=> + string(4) "<" + ["¯"]=> + string(6) "¯" + ["—"]=> + string(7) "—" + ["µ"]=> + string(7) "µ" + ["·"]=> + string(8) "·" + ["−"]=> + string(7) "−" + ["μ"]=> + string(4) "μ" + ["∇"]=> + string(7) "∇" + [" "]=> + string(6) " " + ["–"]=> + string(7) "–" + ["≠"]=> + string(4) "≠" + ["∋"]=> + string(4) "∋" + ["¬"]=> + string(5) "¬" + ["∉"]=> + string(7) "∉" + ["⊄"]=> + string(6) "⊄" + ["ñ"]=> + string(8) "ñ" + ["ν"]=> + string(4) "ν" + ["ó"]=> + string(8) "ó" + ["ô"]=> + string(7) "ô" + ["œ"]=> + string(7) "œ" + ["ò"]=> + string(8) "ò" + ["‾"]=> + string(7) "‾" + ["ω"]=> + string(7) "ω" + ["ο"]=> + string(9) "ο" + ["⊕"]=> + string(7) "⊕" + ["∨"]=> + string(4) "∨" + ["ª"]=> + string(6) "ª" + ["º"]=> + string(6) "º" + ["ø"]=> + string(8) "ø" + ["õ"]=> + string(8) "õ" + ["⊗"]=> + string(8) "⊗" + ["ö"]=> + string(6) "ö" + ["¶"]=> + string(6) "¶" + ["∂"]=> + string(6) "∂" + ["‰"]=> + string(8) "‰" + ["⊥"]=> + string(6) "⊥" + ["φ"]=> + string(5) "φ" + ["π"]=> + string(4) "π" + ["ϖ"]=> + string(5) "ϖ" + ["±"]=> + string(8) "±" + ["£"]=> + string(7) "£" + ["′"]=> + string(7) "′" + ["∏"]=> + string(6) "∏" + ["∝"]=> + string(6) "∝" + ["ψ"]=> + string(5) "ψ" + ["""]=> + string(6) """ + ["⇒"]=> + string(6) "⇒" + ["√"]=> + string(7) "√" + ["〉"]=> + string(6) "⟩" + ["»"]=> + string(7) "»" + ["→"]=> + string(6) "→" + ["⌉"]=> + string(7) "⌉" + ["”"]=> + string(7) "”" + ["ℜ"]=> + string(6) "ℜ" + ["®"]=> + string(5) "®" + ["⌋"]=> + string(8) "⌋" + ["ρ"]=> + string(5) "ρ" + ["‏"]=> + string(5) "‏" + ["›"]=> + string(8) "›" + ["’"]=> + string(7) "’" + ["‚"]=> + string(7) "‚" + ["š"]=> + string(8) "š" + ["⋅"]=> + string(6) "⋅" + ["§"]=> + string(6) "§" + ["­"]=> + string(5) "­" + ["σ"]=> + string(7) "σ" + ["ς"]=> + string(8) "ς" + ["∼"]=> + string(5) "∼" + ["♠"]=> + string(8) "♠" + ["⊂"]=> + string(5) "⊂" + ["⊆"]=> + string(6) "⊆" + ["∑"]=> + string(5) "∑" + ["¹"]=> + string(6) "¹" + ["²"]=> + string(6) "²" + ["³"]=> + string(6) "³" + ["⊃"]=> + string(5) "⊃" + ["⊇"]=> + string(6) "⊇" + ["ß"]=> + string(7) "ß" + ["τ"]=> + string(5) "τ" + ["∴"]=> + string(8) "∴" + ["θ"]=> + string(7) "θ" + ["ϑ"]=> + string(10) "ϑ" + [" "]=> + string(8) " " + ["þ"]=> + string(7) "þ" + ["˜"]=> + string(7) "˜" + ["×"]=> + string(7) "×" + ["™"]=> + string(7) "™" + ["⇑"]=> + string(6) "⇑" + ["ú"]=> + string(8) "ú" + ["↑"]=> + string(6) "↑" + ["û"]=> + string(7) "û" + ["ù"]=> + string(8) "ù" + ["¨"]=> + string(5) "¨" + ["ϒ"]=> + string(7) "ϒ" + ["υ"]=> + string(9) "υ" + ["ü"]=> + string(6) "ü" + ["℘"]=> + string(8) "℘" + ["ξ"]=> + string(4) "ξ" + ["ý"]=> + string(8) "ý" + ["¥"]=> + string(5) "¥" + ["ÿ"]=> + string(6) "ÿ" + ["ζ"]=> + string(6) "ζ" + ["‍"]=> + string(5) "‍" + ["‌"]=> + string(6) "‌" +} +-- with table = HTML_SPECIALCHARS -- +array(4) { + ["&"]=> + string(5) "&" + [">"]=> + string(4) ">" + ["<"]=> + string(4) "<" + ["""]=> + string(6) """ +} +Done diff --git a/ext/standard/tests/strings/htmlentities-utf-3.phpt b/ext/standard/tests/strings/htmlentities-utf-3.phpt index c28917ba16c..82693056ef0 100644 --- a/ext/standard/tests/strings/htmlentities-utf-3.phpt +++ b/ext/standard/tests/strings/htmlentities-utf-3.phpt @@ -1,83 +1,83 @@ ---TEST-- -Test get_next_char(), used by htmlentities()/htmlspecialchars(): validity of UTF-8 sequences ---FILE-- -= $l[0][0] && $b <= $l[0][1]) { - if (count($l) != strlen($seq)) { - return false; - } - for ($n = 1; $n < strlen($seq); $n++) { - if (ord($seq[$n]) < $l[$n][0] || ord($seq[$n]) > $l[$n][1]) { - return false; - } - } - return true; - } - } - return false; -} - -function concordance($s) { - $vhe = strlen(htmlspecialchars($s, ENT_QUOTES, "UTF-8")) > 0; - $v = is_valid($s); - return ($vhe === $v); -} - -for ($b1 = 0xC0; $b1 < 0xE0; $b1++) { - for ($b2 = 0x80; $b2 < 0xBF; $b2++) { - $s = chr($b1).chr($b2); - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - } -} - - -for ($b1 = 0xE0; $b1 < 0xEF; $b1++) { - for ($b2 = 0x80; $b2 < 0xBF; $b2++) { - $s = chr($b1).chr($b2)."\x80"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - $s = chr($b1).chr($b2)."\xBF"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - } -} - -for ($b1 = 0xF0; $b1 < 0xFF; $b1++) { - for ($b2 = 0x80; $b2 < 0xBF; $b2++) { - $s = chr($b1).chr($b2)."\x80\x80"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - $s = chr($b1).chr($b2)."\xBF\x80"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - $s = chr($b1).chr($b2)."\x80\xBF"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - $s = chr($b1).chr($b2)."\xBF\xBF"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - } -} -echo "Done.\n"; ---EXPECT-- -Done. +--TEST-- +Test get_next_char(), used by htmlentities()/htmlspecialchars(): validity of UTF-8 sequences +--FILE-- += $l[0][0] && $b <= $l[0][1]) { + if (count($l) != strlen($seq)) { + return false; + } + for ($n = 1; $n < strlen($seq); $n++) { + if (ord($seq[$n]) < $l[$n][0] || ord($seq[$n]) > $l[$n][1]) { + return false; + } + } + return true; + } + } + return false; +} + +function concordance($s) { + $vhe = strlen(htmlspecialchars($s, ENT_QUOTES, "UTF-8")) > 0; + $v = is_valid($s); + return ($vhe === $v); +} + +for ($b1 = 0xC0; $b1 < 0xE0; $b1++) { + for ($b2 = 0x80; $b2 < 0xBF; $b2++) { + $s = chr($b1).chr($b2); + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + } +} + + +for ($b1 = 0xE0; $b1 < 0xEF; $b1++) { + for ($b2 = 0x80; $b2 < 0xBF; $b2++) { + $s = chr($b1).chr($b2)."\x80"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + $s = chr($b1).chr($b2)."\xBF"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + } +} + +for ($b1 = 0xF0; $b1 < 0xFF; $b1++) { + for ($b2 = 0x80; $b2 < 0xBF; $b2++) { + $s = chr($b1).chr($b2)."\x80\x80"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + $s = chr($b1).chr($b2)."\xBF\x80"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + $s = chr($b1).chr($b2)."\x80\xBF"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + $s = chr($b1).chr($b2)."\xBF\xBF"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + } +} +echo "Done.\n"; +--EXPECT-- +Done. diff --git a/ext/standard/tests/strings/md5_basic1.phpt b/ext/standard/tests/strings/md5_basic1.phpt index c1f8805ac06..af91ade73fd 100644 --- a/ext/standard/tests/strings/md5_basic1.phpt +++ b/ext/standard/tests/strings/md5_basic1.phpt @@ -1,17 +1,17 @@ ---TEST-- -Test md5() function : basic functionality ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing md5() : basic functionality *** -string(32) "1f3870be274f6c49b3e31a0c6728957f" -===DONE=== +--TEST-- +Test md5() function : basic functionality +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing md5() : basic functionality *** +string(32) "1f3870be274f6c49b3e31a0c6728957f" +===DONE=== diff --git a/ext/standard/tests/strings/md5_basic2.phpt b/ext/standard/tests/strings/md5_basic2.phpt index 670872f74d5..7098dc41b57 100644 --- a/ext/standard/tests/strings/md5_basic2.phpt +++ b/ext/standard/tests/strings/md5_basic2.phpt @@ -1,30 +1,30 @@ ---TEST-- -Test md5() function : basic functionality - with raw output ---FILE-- - -===DONE=== ---EXPECT-- -*** Testing md5() : basic functionality - with raw output*** -string(32) "b10a8db164e0754105b7a99be72e3fe5" -TEST PASSED +--TEST-- +Test md5() function : basic functionality - with raw output +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing md5() : basic functionality - with raw output*** +string(32) "b10a8db164e0754105b7a99be72e3fe5" +TEST PASSED ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/md5_error.phpt b/ext/standard/tests/strings/md5_error.phpt index 190b09c8e5d..dbdbdcb2a54 100644 --- a/ext/standard/tests/strings/md5_error.phpt +++ b/ext/standard/tests/strings/md5_error.phpt @@ -1,35 +1,35 @@ ---TEST-- -Test md5() function : error conditions ---FILE-- - -===DONE== ---EXPECTF-- -*** Testing md5() : error conditions *** - --- Testing md5() function with no arguments -- - -Warning: md5() expects at least 1 parameter, 0 given in %s on line %d -NULL - --- Testing md5() function with more than expected no. of arguments -- - -Warning: md5() expects at most 2 parameters, 3 given in %s on line %d -NULL +--TEST-- +Test md5() function : error conditions +--FILE-- + +===DONE== +--EXPECTF-- +*** Testing md5() : error conditions *** + +-- Testing md5() function with no arguments -- + +Warning: md5() expects at least 1 parameter, 0 given in %s on line %d +NULL + +-- Testing md5() function with more than expected no. of arguments -- + +Warning: md5() expects at most 2 parameters, 3 given in %s on line %d +NULL ===DONE== \ No newline at end of file diff --git a/ext/standard/tests/strings/soundex_basic.phpt b/ext/standard/tests/strings/soundex_basic.phpt index 65bcb642523..9777473ee99 100644 --- a/ext/standard/tests/strings/soundex_basic.phpt +++ b/ext/standard/tests/strings/soundex_basic.phpt @@ -1,46 +1,46 @@ ---TEST-- -Test soundex() function : basic functionality ---FILE-- - -===DONE=== ---EXPECT-- -*** Testing soundex() : basic functionality *** -string(4) "E460" -string(4) "G200" -string(4) "H416" -string(4) "K530" -string(4) "L300" -string(4) "L222" -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) -bool(false) -bool(false) - -===DONE=== +--TEST-- +Test soundex() function : basic functionality +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing soundex() : basic functionality *** +string(4) "E460" +string(4) "G200" +string(4) "H416" +string(4) "K530" +string(4) "L300" +string(4) "L222" +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(false) +bool(false) + +===DONE=== diff --git a/ext/standard/tests/strings/soundex_error.phpt b/ext/standard/tests/strings/soundex_error.phpt index a81b9d24fed..20cf2c9d3e4 100644 --- a/ext/standard/tests/strings/soundex_error.phpt +++ b/ext/standard/tests/strings/soundex_error.phpt @@ -1,34 +1,34 @@ ---TEST-- -Test soundex() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing soundex error conditions ***-- Testing soundex() function with Zero arguments -- - -Warning: soundex() expects exactly 1 parameter, 0 given in %s on line %d -NULL - - --- Testing soundex() function with more than expected no. of arguments -- - -Warning: soundex() expects exactly 1 parameter, 2 given in %s on line %d -NULL - +--TEST-- +Test soundex() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing soundex error conditions ***-- Testing soundex() function with Zero arguments -- + +Warning: soundex() expects exactly 1 parameter, 0 given in %s on line %d +NULL + + +-- Testing soundex() function with more than expected no. of arguments -- + +Warning: soundex() expects exactly 1 parameter, 2 given in %s on line %d +NULL + ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/str_rot13_basic.phpt b/ext/standard/tests/strings/str_rot13_basic.phpt index 949d725754e..321a2bf1b76 100644 --- a/ext/standard/tests/strings/str_rot13_basic.phpt +++ b/ext/standard/tests/strings/str_rot13_basic.phpt @@ -1,55 +1,55 @@ ---TEST-- -Test soundex() function : basic functionality ---FILE-- -.?"), "!%^&*()_-+={}[]:;@~#<,>.?")) { - echo "Strings equal : TEST PASSED\n"; -} else { - echo "Strings unequal : TEST FAILED\n"; -} - -echo "\nEnsure strings round trip\n"; -$str = "str_rot13() tests starting"; -$encode = str_rot13($str); -$decode = str_rot13($encode); -if (strcmp($str, $decode) == 0) { - echo "Strings equal : TEST PASSED\n"; -} else { - echo "Strings unequal : TEST FAILED\n"; -} -?> -===DONE=== ---EXPECTF-- -*** Testing str_rot13() : basic functionality *** - -Basic tests -string(26) "fge_ebg13() grfgf fgnegvat" -string(26) "nopqrstuvwxyzabcdefghijklm" - -Ensure numeric characters are left untouched -Strings equal : TEST PASSED - -Ensure non-alphabetic characters are left untouched -Strings unequal : TEST FAILED - -Ensure strings round trip -Strings equal : TEST PASSED +--TEST-- +Test soundex() function : basic functionality +--FILE-- +.?"), "!%^&*()_-+={}[]:;@~#<,>.?")) { + echo "Strings equal : TEST PASSED\n"; +} else { + echo "Strings unequal : TEST FAILED\n"; +} + +echo "\nEnsure strings round trip\n"; +$str = "str_rot13() tests starting"; +$encode = str_rot13($str); +$decode = str_rot13($encode); +if (strcmp($str, $decode) == 0) { + echo "Strings equal : TEST PASSED\n"; +} else { + echo "Strings unequal : TEST FAILED\n"; +} +?> +===DONE=== +--EXPECTF-- +*** Testing str_rot13() : basic functionality *** + +Basic tests +string(26) "fge_ebg13() grfgf fgnegvat" +string(26) "nopqrstuvwxyzabcdefghijklm" + +Ensure numeric characters are left untouched +Strings equal : TEST PASSED + +Ensure non-alphabetic characters are left untouched +Strings unequal : TEST FAILED + +Ensure strings round trip +Strings equal : TEST PASSED ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/str_rot13_error.phpt b/ext/standard/tests/strings/str_rot13_error.phpt index 99a99f29c5e..2361c0abb5a 100644 --- a/ext/standard/tests/strings/str_rot13_error.phpt +++ b/ext/standard/tests/strings/str_rot13_error.phpt @@ -1,32 +1,32 @@ ---TEST-- -Test str_rot13() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing str_rot13() : error conditions *** --- Testing str_rot13() function with Zero arguments -- - -Warning: str_rot13() expects exactly 1 parameter, 0 given in %s on line %d -NULL - - --- Testing str_rot13() function with more than expected no. of arguments -- - -Warning: str_rot13() expects exactly 1 parameter, 2 given in %s on line %d -NULL +--TEST-- +Test str_rot13() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing str_rot13() : error conditions *** +-- Testing str_rot13() function with Zero arguments -- + +Warning: str_rot13() expects exactly 1 parameter, 0 given in %s on line %d +NULL + + +-- Testing str_rot13() function with more than expected no. of arguments -- + +Warning: str_rot13() expects exactly 1 parameter, 2 given in %s on line %d +NULL ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/strnatcasecmp_error.phpt b/ext/standard/tests/strings/strnatcasecmp_error.phpt index 45a15daefc7..3085e8d8fd6 100644 --- a/ext/standard/tests/strings/strnatcasecmp_error.phpt +++ b/ext/standard/tests/strings/strnatcasecmp_error.phpt @@ -1,33 +1,33 @@ ---TEST-- -Test strnatcasecmp() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing strnatcasecmp() : error conditions *** --- Testing strnatcmp() function with Zero arguments -- - -Warning: strnatcasecmp() expects exactly 2 parameters, 0 given in %s on line %d -NULL - - --- Testing strnatcasecmp() function with more than expected no. of arguments -- - -Warning: strnatcasecmp() expects exactly 2 parameters, 3 given in %s on line %d -NULL +--TEST-- +Test strnatcasecmp() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing strnatcasecmp() : error conditions *** +-- Testing strnatcmp() function with Zero arguments -- + +Warning: strnatcasecmp() expects exactly 2 parameters, 0 given in %s on line %d +NULL + + +-- Testing strnatcasecmp() function with more than expected no. of arguments -- + +Warning: strnatcasecmp() expects exactly 2 parameters, 3 given in %s on line %d +NULL ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/strnatcmp_basic.phpt b/ext/standard/tests/strings/strnatcmp_basic.phpt index 140bd48d6c5..bef01de6535 100644 --- a/ext/standard/tests/strings/strnatcmp_basic.phpt +++ b/ext/standard/tests/strings/strnatcmp_basic.phpt @@ -1,80 +1,80 @@ ---TEST-- -Test strnatcmp() function : basic functionality ---FILE-- - -===DONE=== ---EXPECT-- -*** Testing strnatcmp() : basic functionality *** -Less than tests -int(-1) -int(-1) -int(-1) -int(-1) -int(-1) -int(1) -int(1) -int(1) -int(1) -int(1) -Equal too tests -int(0) -int(1) -Greater than tests -int(1) -int(1) -int(1) -int(1) -int(1) -int(1) -int(1) -int(1) -int(1) -int(1) +--TEST-- +Test strnatcmp() function : basic functionality +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing strnatcmp() : basic functionality *** +Less than tests +int(-1) +int(-1) +int(-1) +int(-1) +int(-1) +int(1) +int(1) +int(1) +int(1) +int(1) +Equal too tests +int(0) +int(1) +Greater than tests +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) +int(1) ===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/strings/strnatcmp_error.phpt b/ext/standard/tests/strings/strnatcmp_error.phpt index 09cc668af93..2b6d93afee9 100644 --- a/ext/standard/tests/strings/strnatcmp_error.phpt +++ b/ext/standard/tests/strings/strnatcmp_error.phpt @@ -1,34 +1,34 @@ ---TEST-- -Test strnatcmp() function : error conditions ---FILE-- - -===DONE=== ---EXPECTF-- -*** Testing strnatcmp() : error conditions *** --- Testing strnatcmp() function with Zero arguments -- - -Warning: strnatcmp() expects exactly 2 parameters, 0 given in %s on line %d -NULL - - --- Testing strnatcmp() function with more than expected no. of arguments -- - -Warning: strnatcmp() expects exactly 2 parameters, 3 given in %s on line %d -NULL -===DONE=== +--TEST-- +Test strnatcmp() function : error conditions +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing strnatcmp() : error conditions *** +-- Testing strnatcmp() function with Zero arguments -- + +Warning: strnatcmp() expects exactly 2 parameters, 0 given in %s on line %d +NULL + + +-- Testing strnatcmp() function with more than expected no. of arguments -- + +Warning: strnatcmp() expects exactly 2 parameters, 3 given in %s on line %d +NULL +===DONE=== diff --git a/tests/basic/bug53180.phpt b/tests/basic/bug53180.phpt index 5c2eb76952f..16783de8a7b 100644 --- a/tests/basic/bug53180.phpt +++ b/tests/basic/bug53180.phpt @@ -1,19 +1,19 @@ ---TEST-- -Bug #53180 (post_max_size=0 partly not working) ---INI-- -post_max_size=0 ---POST-- -email=foo&password=bar&submit=Log+on ---FILE-- - ---EXPECT-- -array(3) { - ["email"]=> - string(3) "foo" - ["password"]=> - string(3) "bar" - ["submit"]=> - string(6) "Log on" -} +--TEST-- +Bug #53180 (post_max_size=0 partly not working) +--INI-- +post_max_size=0 +--POST-- +email=foo&password=bar&submit=Log+on +--FILE-- + +--EXPECT-- +array(3) { + ["email"]=> + string(3) "foo" + ["password"]=> + string(3) "bar" + ["submit"]=> + string(6) "Log on" +} diff --git a/tests/basic/req44164.phpt b/tests/basic/req44164.phpt index d0082861f2f..7a142f5fb97 100644 --- a/tests/basic/req44164.phpt +++ b/tests/basic/req44164.phpt @@ -1,17 +1,17 @@ ---TEST-- -Req #44164 (Handle "Content-Length" HTTP header when zlib.output_compression active) ---SKIPIF-- - ---INI-- -zlib.output_compression=On ---ENV-- -HTTP_ACCEPT_ENCODING=gzip ---FILE-- - +--INI-- +zlib.output_compression=On +--ENV-- +HTTP_ACCEPT_ENCODING=gzip +--FILE-- + ---EXPECTF-- -array(4) { - ["file2"]=> - array(5) { - ["name"]=> - string(0) "" - ["type"]=> - string(0) "" - ["tmp_name"]=> - string(0) "" - ["error"]=> - int(4) - ["size"]=> - int(0) - } - ["file3"]=> - array(5) { - ["name"]=> - string(0) "" - ["type"]=> - string(0) "" - ["tmp_name"]=> - string(0) "" - ["error"]=> - int(4) - ["size"]=> - int(0) - } - ["file4"]=> - array(5) { - ["name"]=> - string(9) "file4.txt" - ["type"]=> - string(15) "text/plain-file" - ["tmp_name"]=> - string(%d) "%s" - ["error"]=> - int(0) - ["size"]=> - int(0) - } - ["file1"]=> - array(5) { - ["name"]=> - string(9) "file1.txt" - ["type"]=> - string(15) "text/plain-file" - ["tmp_name"]=> - string(%d) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } -} -array(0) { -} -string(1) "1" -string(0) "" +--TEST-- +rfc1867 max_file_uploads - empty files shouldn't count +--INI-- +file_uploads=1 +max_file_uploads=2 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="" +Content-Type: text/plain-file + + +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file3"; filename="" +Content-Type: text/plain-file + +33 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file4"; filename="file4.txt" +Content-Type: text/plain-file + + +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file + +1 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(4) { + ["file2"]=> + array(5) { + ["name"]=> + string(0) "" + ["type"]=> + string(0) "" + ["tmp_name"]=> + string(0) "" + ["error"]=> + int(4) + ["size"]=> + int(0) + } + ["file3"]=> + array(5) { + ["name"]=> + string(0) "" + ["type"]=> + string(0) "" + ["tmp_name"]=> + string(0) "" + ["error"]=> + int(4) + ["size"]=> + int(0) + } + ["file4"]=> + array(5) { + ["name"]=> + string(9) "file4.txt" + ["type"]=> + string(15) "text/plain-file" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(0) + } + ["file1"]=> + array(5) { + ["name"]=> + string(9) "file1.txt" + ["type"]=> + string(15) "text/plain-file" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(1) + } +} +array(0) { +} +string(1) "1" +string(0) "" diff --git a/tests/lang/foreachLoop.001.phpt b/tests/lang/foreachLoop.001.phpt index d35f26116dc..a7ec701fd14 100644 --- a/tests/lang/foreachLoop.001.phpt +++ b/tests/lang/foreachLoop.001.phpt @@ -1,64 +1,64 @@ ---TEST-- -Foreach loop tests - basic loop with just value and key => value. ---FILE-- - $v) { - var_dump($k, $v); -} -//check key and value after the loop. -var_dump($k, $v); - -echo "\n"; -//Dynamic array -foreach (array("d","e","f") as $v) { - var_dump($v); -} -foreach (array("d","e","f") as $k => $v) { - var_dump($k, $v); -} -//check key and value after the loop. -var_dump($k, $v); - -echo "\n"; -//Ensure counter is advanced during loop -$a=array("a","b","c"); -foreach ($a as $v); -var_dump(current($a)); -$a=array("a","b","c"); -foreach ($a as &$v); -var_dump(current($a)); - -?> ---EXPECT-- -string(1) "a" -string(1) "b" -string(1) "c" -int(0) -string(1) "a" -int(1) -string(1) "b" -int(2) -string(1) "c" -int(2) -string(1) "c" - -string(1) "d" -string(1) "e" -string(1) "f" -int(0) -string(1) "d" -int(1) -string(1) "e" -int(2) -string(1) "f" -int(2) -string(1) "f" - -string(1) "a" +--TEST-- +Foreach loop tests - basic loop with just value and key => value. +--FILE-- + $v) { + var_dump($k, $v); +} +//check key and value after the loop. +var_dump($k, $v); + +echo "\n"; +//Dynamic array +foreach (array("d","e","f") as $v) { + var_dump($v); +} +foreach (array("d","e","f") as $k => $v) { + var_dump($k, $v); +} +//check key and value after the loop. +var_dump($k, $v); + +echo "\n"; +//Ensure counter is advanced during loop +$a=array("a","b","c"); +foreach ($a as $v); +var_dump(current($a)); +$a=array("a","b","c"); +foreach ($a as &$v); +var_dump(current($a)); + +?> +--EXPECT-- +string(1) "a" +string(1) "b" +string(1) "c" +int(0) +string(1) "a" +int(1) +string(1) "b" +int(2) +string(1) "c" +int(2) +string(1) "c" + +string(1) "d" +string(1) "e" +string(1) "f" +int(0) +string(1) "d" +int(1) +string(1) "e" +int(2) +string(1) "f" +int(2) +string(1) "f" + +string(1) "a" string(1) "a" diff --git a/tests/lang/foreachLoop.002.phpt b/tests/lang/foreachLoop.002.phpt index 5896124f40a..31492953a46 100644 --- a/tests/lang/foreachLoop.002.phpt +++ b/tests/lang/foreachLoop.002.phpt @@ -1,173 +1,173 @@ ---TEST-- -Foreach loop tests - modifying the array during the loop. ---FILE-- -$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"; -} -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"; -} -var_dump($a); - -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"); - - //avoid infinite loop if test is failing - if ($counter++>10) { - echo "Loop detected\n"; - break; - } -} -var_dump($a); - -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"); - - //avoid infinite loop if test is failing - if ($counter++>10) { - echo "Loop detected\n"; - break; - } -} -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); -} -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); -} -var_dump($a); - -?> ---EXPECT-- - -Directly changing array values. -string(10) "original.1" -string(10) "original.2" -string(10) "original.3" -array(3) { - [0]=> - string(9) "changed.0" - [1]=> - string(9) "changed.1" - [2]=> - string(9) "changed.2" -} - -Modifying the foreach $value. -array(3) { - [0]=> - string(10) "original.1" - [1]=> - string(10) "original.2" - [2]=> - string(10) "original.3" -} - -Modifying the foreach &$value. -array(3) { - [0]=> - string(9) "changed.0" - [1]=> - string(9) "changed.1" - [2]=> - &string(9) "changed.2" -} - -Pushing elements onto an unreferenced array. -array(6) { - [0]=> - string(10) "original.1" - [1]=> - string(10) "original.2" - [2]=> - string(10) "original.3" - [3]=> - string(5) "new.0" - [4]=> - string(5) "new.1" - [5]=> - string(5) "new.2" -} - -Pushing elements onto an unreferenced array, using &$value. -Loop detected -array(15) { - [0]=> - string(10) "original.1" - [1]=> - string(10) "original.2" - [2]=> - string(10) "original.3" - [3]=> - string(5) "new.0" - [4]=> - string(5) "new.1" - [5]=> - string(5) "new.2" - [6]=> - string(5) "new.3" - [7]=> - string(5) "new.4" - [8]=> - string(5) "new.5" - [9]=> - string(5) "new.6" - [10]=> - string(5) "new.7" - [11]=> - &string(5) "new.8" - [12]=> - string(5) "new.9" - [13]=> - string(6) "new.10" - [14]=> - string(6) "new.11" -} - -Popping elements off an unreferenced array. -string(10) "original.1" -string(10) "original.2" -string(10) "original.3" -array(0) { -} - -Popping elements off an unreferenced array, using &$value. -string(10) "original.1" -string(10) "original.2" -array(1) { - [0]=> - string(10) "original.1" +--TEST-- +Foreach loop tests - modifying the array during the loop. +--FILE-- +$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"; +} +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"; +} +var_dump($a); + +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"); + + //avoid infinite loop if test is failing + if ($counter++>10) { + echo "Loop detected\n"; + break; + } +} +var_dump($a); + +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"); + + //avoid infinite loop if test is failing + if ($counter++>10) { + echo "Loop detected\n"; + break; + } +} +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); +} +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); +} +var_dump($a); + +?> +--EXPECT-- + +Directly changing array values. +string(10) "original.1" +string(10) "original.2" +string(10) "original.3" +array(3) { + [0]=> + string(9) "changed.0" + [1]=> + string(9) "changed.1" + [2]=> + string(9) "changed.2" +} + +Modifying the foreach $value. +array(3) { + [0]=> + string(10) "original.1" + [1]=> + string(10) "original.2" + [2]=> + string(10) "original.3" +} + +Modifying the foreach &$value. +array(3) { + [0]=> + string(9) "changed.0" + [1]=> + string(9) "changed.1" + [2]=> + &string(9) "changed.2" +} + +Pushing elements onto an unreferenced array. +array(6) { + [0]=> + string(10) "original.1" + [1]=> + string(10) "original.2" + [2]=> + string(10) "original.3" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.2" +} + +Pushing elements onto an unreferenced array, using &$value. +Loop detected +array(15) { + [0]=> + string(10) "original.1" + [1]=> + string(10) "original.2" + [2]=> + string(10) "original.3" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.2" + [6]=> + string(5) "new.3" + [7]=> + string(5) "new.4" + [8]=> + string(5) "new.5" + [9]=> + string(5) "new.6" + [10]=> + string(5) "new.7" + [11]=> + &string(5) "new.8" + [12]=> + string(5) "new.9" + [13]=> + string(6) "new.10" + [14]=> + string(6) "new.11" +} + +Popping elements off an unreferenced array. +string(10) "original.1" +string(10) "original.2" +string(10) "original.3" +array(0) { +} + +Popping elements off an unreferenced array, using &$value. +string(10) "original.1" +string(10) "original.2" +array(1) { + [0]=> + string(10) "original.1" } diff --git a/tests/lang/foreachLoop.003.phpt b/tests/lang/foreachLoop.003.phpt index d554d0d87f2..a62d5dbb3b2 100644 --- a/tests/lang/foreachLoop.003.phpt +++ b/tests/lang/foreachLoop.003.phpt @@ -1,46 +1,46 @@ ---TEST-- -Foreach loop tests - error case: not an array. ---FILE-- - ---EXPECTF-- - -Not an array. - -Warning: Invalid argument supplied for foreach() in %s on line 4 - -Warning: Invalid argument supplied for foreach() in %s on line 9 - -Warning: Invalid argument supplied for foreach() in %s on line 14 - -Warning: Invalid argument supplied for foreach() in %s on line 19 - -Warning: Invalid argument supplied for foreach() in %s on line 24 -done. +--TEST-- +Foreach loop tests - error case: not an array. +--FILE-- + +--EXPECTF-- + +Not an array. + +Warning: Invalid argument supplied for foreach() in %s on line 4 + +Warning: Invalid argument supplied for foreach() in %s on line 9 + +Warning: Invalid argument supplied for foreach() in %s on line 14 + +Warning: Invalid argument supplied for foreach() in %s on line 19 + +Warning: Invalid argument supplied for foreach() in %s on line 24 +done. diff --git a/tests/lang/foreachLoop.004.phpt b/tests/lang/foreachLoop.004.phpt index 178cad09811..3cc1960ca14 100644 --- a/tests/lang/foreachLoop.004.phpt +++ b/tests/lang/foreachLoop.004.phpt @@ -1,76 +1,76 @@ ---TEST-- -Foreach loop tests - using an array element as the $value ---FILE-- -$v[0]) { - var_dump($k, $v); -} -var_dump($a); -var_dump($k, $v); -?> ---EXPECT-- -array(1) { - [0]=> - string(1) "a" -} -array(1) { - [0]=> - string(1) "b" -} -array(1) { - [0]=> - string(1) "c" -} -array(3) { - [0]=> - string(1) "a" - [1]=> - string(1) "b" - [2]=> - string(1) "c" -} -array(1) { - [0]=> - string(1) "c" -} - -int(0) -array(1) { - [0]=> - string(1) "a" -} -int(1) -array(1) { - [0]=> - string(1) "b" -} -int(2) -array(1) { - [0]=> - string(1) "c" -} -array(3) { - [0]=> - string(1) "a" - [1]=> - string(1) "b" - [2]=> - string(1) "c" -} -int(2) -array(1) { - [0]=> - string(1) "c" +--TEST-- +Foreach loop tests - using an array element as the $value +--FILE-- +$v[0]) { + var_dump($k, $v); +} +var_dump($a); +var_dump($k, $v); +?> +--EXPECT-- +array(1) { + [0]=> + string(1) "a" +} +array(1) { + [0]=> + string(1) "b" +} +array(1) { + [0]=> + string(1) "c" +} +array(3) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + [2]=> + string(1) "c" +} +array(1) { + [0]=> + string(1) "c" +} + +int(0) +array(1) { + [0]=> + string(1) "a" +} +int(1) +array(1) { + [0]=> + string(1) "b" +} +int(2) +array(1) { + [0]=> + string(1) "c" +} +array(3) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + [2]=> + string(1) "c" +} +int(2) +array(1) { + [0]=> + string(1) "c" } diff --git a/tests/lang/foreachLoop.005.phpt b/tests/lang/foreachLoop.005.phpt index ae6ed3aa28f..c7e4ceb8e77 100644 --- a/tests/lang/foreachLoop.005.phpt +++ b/tests/lang/foreachLoop.005.phpt @@ -1,23 +1,23 @@ ---TEST-- -Foreach loop tests - modifying the array during the loop: special case. Behaviour is good since php 5.2.2. ---FILE-- -&$v){ - $a[$k] = "changed.$k"; - echo "After changing \$a directly, \$v@$k is: $v\n"; -} -//--- Expected output: -//After changing $a directly, $v@0 is: changed.0 -//After changing $a directly, $v@1 is: changed.1 -//After changing $a directly, $v@2 is: changed.2 -//--- Actual output from php.net before 5.2.2: -//After changing $a directly, $v@0 is: changed.0 -//After changing $a directly, $v@1 is: original.1 -//After changing $a directly, $v@2 is: original.2 - -?> ---EXPECT-- -After changing $a directly, $v@0 is: changed.0 -After changing $a directly, $v@1 is: changed.1 -After changing $a directly, $v@2 is: changed.2 +--TEST-- +Foreach loop tests - modifying the array during the loop: special case. Behaviour is good since php 5.2.2. +--FILE-- +&$v){ + $a[$k] = "changed.$k"; + echo "After changing \$a directly, \$v@$k is: $v\n"; +} +//--- Expected output: +//After changing $a directly, $v@0 is: changed.0 +//After changing $a directly, $v@1 is: changed.1 +//After changing $a directly, $v@2 is: changed.2 +//--- Actual output from php.net before 5.2.2: +//After changing $a directly, $v@0 is: changed.0 +//After changing $a directly, $v@1 is: original.1 +//After changing $a directly, $v@2 is: original.2 + +?> +--EXPECT-- +After changing $a directly, $v@0 is: changed.0 +After changing $a directly, $v@1 is: changed.1 +After changing $a directly, $v@2 is: changed.2 diff --git a/tests/lang/foreachLoop.006.phpt b/tests/lang/foreachLoop.006.phpt index d31ea64563e..f7563dccd05 100644 --- a/tests/lang/foreachLoop.006.phpt +++ b/tests/lang/foreachLoop.006.phpt @@ -1,11 +1,11 @@ ---TEST-- -Foreach loop tests - error case: key is a reference. ---FILE-- -$v) { - var_dump($v); -} -?> ---EXPECTF-- +--TEST-- +Foreach loop tests - error case: key is a reference. +--FILE-- +$v) { + var_dump($v); +} +?> +--EXPECTF-- Fatal error: Key element cannot be a reference in %s on line 3 diff --git a/tests/lang/foreachLoop.009.phpt b/tests/lang/foreachLoop.009.phpt index df51fd6be4f..90aa33953ba 100644 --- a/tests/lang/foreachLoop.009.phpt +++ b/tests/lang/foreachLoop.009.phpt @@ -1,78 +1,78 @@ ---TEST-- -Foreach loop tests - foreach operates on the original array if the array is referenced outside the loop. ---FILE-- -$v1) { - 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"; -} - -echo "\nAdd elements to a referenced array during loop\n"; -$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"; - - if ($count++>5) { - echo "Loop detected, as expected.\n"; - break; - } -} - -echo "\nAdd elements to a referenced array during loop, using &\$value\n"; -$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"; - - if ($count++>5) { - echo "Loop detected, as expected.\n"; - break; - } -} - -?> ---EXPECT-- - -Remove elements from a referenced array during loop -key: 0; value: original.0 -key: 1; value: original.1 -key: 2; value: original.2 - -Remove elements from a referenced array during loop, using &$value -key: 0; value: original.0 -key: 1; value: original.1 - -Add elements to a referenced array during loop -key: 0; value: original.0 -key: 1; value: original.1 -key: 2; value: original.2 - -Add elements to a referenced array during loop, using &$value -key: 0; value: original.0 -key: 1; value: original.1 -key: 2; value: original.2 -key: 3; value: new.0 -key: 4; value: new.1 -key: 5; value: new.2 -key: 6; value: new.3 -Loop detected, as expected. - +--TEST-- +Foreach loop tests - foreach operates on the original array if the array is referenced outside the loop. +--FILE-- +$v1) { + 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"; +} + +echo "\nAdd elements to a referenced array during loop\n"; +$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"; + + if ($count++>5) { + echo "Loop detected, as expected.\n"; + break; + } +} + +echo "\nAdd elements to a referenced array during loop, using &\$value\n"; +$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"; + + if ($count++>5) { + echo "Loop detected, as expected.\n"; + break; + } +} + +?> +--EXPECT-- + +Remove elements from a referenced array during loop +key: 0; value: original.0 +key: 1; value: original.1 +key: 2; value: original.2 + +Remove elements from a referenced array during loop, using &$value +key: 0; value: original.0 +key: 1; value: original.1 + +Add elements to a referenced array during loop +key: 0; value: original.0 +key: 1; value: original.1 +key: 2; value: original.2 + +Add elements to a referenced array during loop, using &$value +key: 0; value: original.0 +key: 1; value: original.1 +key: 2; value: original.2 +key: 3; value: new.0 +key: 4; value: new.1 +key: 5; value: new.2 +key: 6; value: new.3 +Loop detected, as expected. + diff --git a/tests/lang/foreachLoop.010.phpt b/tests/lang/foreachLoop.010.phpt index 31f6e8cc49f..c021a80c395 100644 --- a/tests/lang/foreachLoop.010.phpt +++ b/tests/lang/foreachLoop.010.phpt @@ -1,40 +1,40 @@ ---TEST-- -This test illustrates the impact of invoking destructors when refcount is decremented to 0 on foreach. -It will pass only if the 'contentious code' in PHPValue.decReferences() is enabled. ---FILE-- -10) { - echo "Infinite loop detected\n"; - break; - } -} - -?> ---EXPECTF-- -int(1) -int(2) +--TEST-- +This test illustrates the impact of invoking destructors when refcount is decremented to 0 on foreach. +It will pass only if the 'contentious code' in PHPValue.decReferences() is enabled. +--FILE-- +10) { + echo "Infinite loop detected\n"; + break; + } +} + +?> +--EXPECTF-- +int(1) +int(2) int(3) diff --git a/tests/lang/foreachLoop.011.phpt b/tests/lang/foreachLoop.011.phpt index 8527a8833e4..6ceebd8a50f 100644 --- a/tests/lang/foreachLoop.011.phpt +++ b/tests/lang/foreachLoop.011.phpt @@ -1,33 +1,33 @@ ---TEST-- -Changing from an interable type to a non iterable type during the iteration ---FILE-- -a=1; -$a->b=2; -$b=&$a; -foreach ($a as $v) { - var_dump($v); - $b='x'; -} - -?> ---EXPECTF-- - -Change from array to non iterable: -int(1) -int(2) -int(3) - -Change from object to non iterable: -int(1) -int(2) +--TEST-- +Changing from an interable type to a non iterable type during the iteration +--FILE-- +a=1; +$a->b=2; +$b=&$a; +foreach ($a as $v) { + var_dump($v); + $b='x'; +} + +?> +--EXPECTF-- + +Change from array to non iterable: +int(1) +int(2) +int(3) + +Change from object to non iterable: +int(1) +int(2) diff --git a/tests/lang/foreachLoop.012.phpt b/tests/lang/foreachLoop.012.phpt index 1165b74a587..3652a71aed6 100644 --- a/tests/lang/foreachLoop.012.phpt +++ b/tests/lang/foreachLoop.012.phpt @@ -1,494 +1,494 @@ ---TEST-- -Directly modifying an unreferenced array when foreach'ing over it. ---FILE-- - 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 "\nPopping elements off end of an unreferenced array"; -$transform = 'array_pop($a);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nShift elements off start of an unreferenced array"; -$transform = 'array_shift($a);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nRemove current element of an unreferenced array"; -$transform = 'unset($a[$k]);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nAdding elements to the end of an unreferenced array"; -$transform = 'array_push($a, "new.$counter");'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nAdding elements to the start of an unreferenced array"; -$transform = 'array_unshift($a, "new.$counter");'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -?> ---EXPECTF-- - -Popping elements off end of an unreferenced array ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Shift elements off start of an unreferenced array ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Remove current element of an unreferenced array ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Adding elements to the end of an unreferenced array ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(5) "new.0" -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(5) "new.0" - [3]=> - string(5) "new.1" -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(6) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(5) "new.0" - [4]=> - string(5) "new.1" - [5]=> - string(5) "new.2" -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(8) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" - [4]=> - string(5) "new.0" - [5]=> - string(5) "new.1" - [6]=> - string(5) "new.2" - [7]=> - string(5) "new.3" -} - - - -Adding elements to the start of an unreferenced array ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(2) { - [0]=> - string(5) "new.0" - [1]=> - string(3) "v.0" -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(4) { - [0]=> - string(5) "new.1" - [1]=> - string(5) "new.0" - [2]=> - string(3) "v.0" - [3]=> - string(3) "v.1" -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(6) { - [0]=> - string(5) "new.2" - [1]=> - string(5) "new.1" - [2]=> - string(5) "new.0" - [3]=> - string(3) "v.0" - [4]=> - string(3) "v.1" - [5]=> - string(3) "v.2" -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(8) { - [0]=> - string(5) "new.3" - [1]=> - string(5) "new.2" - [2]=> - string(5) "new.1" - [3]=> - string(5) "new.0" - [4]=> - string(3) "v.0" - [5]=> - string(3) "v.1" - [6]=> - string(3) "v.2" - [7]=> - string(3) "v.3" -} +--TEST-- +Directly modifying an unreferenced array when foreach'ing over it. +--FILE-- + 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 "\nPopping elements off end of an unreferenced array"; +$transform = 'array_pop($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nShift elements off start of an unreferenced array"; +$transform = 'array_shift($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nRemove current element of an unreferenced array"; +$transform = 'unset($a[$k]);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the end of an unreferenced array"; +$transform = 'array_push($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the start of an unreferenced array"; +$transform = 'array_unshift($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +?> +--EXPECTF-- + +Popping elements off end of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Shift elements off start of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Remove current element of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Adding elements to the end of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(5) "new.0" +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(5) "new.0" + [3]=> + string(5) "new.1" +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(6) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.2" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(8) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" + [4]=> + string(5) "new.0" + [5]=> + string(5) "new.1" + [6]=> + string(5) "new.2" + [7]=> + string(5) "new.3" +} + + + +Adding elements to the start of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(5) "new.0" + [1]=> + string(3) "v.0" +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(4) { + [0]=> + string(5) "new.1" + [1]=> + string(5) "new.0" + [2]=> + string(3) "v.0" + [3]=> + string(3) "v.1" +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(6) { + [0]=> + string(5) "new.2" + [1]=> + string(5) "new.1" + [2]=> + string(5) "new.0" + [3]=> + string(3) "v.0" + [4]=> + string(3) "v.1" + [5]=> + string(3) "v.2" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(8) { + [0]=> + string(5) "new.3" + [1]=> + string(5) "new.2" + [2]=> + string(5) "new.1" + [3]=> + string(5) "new.0" + [4]=> + string(3) "v.0" + [5]=> + string(3) "v.1" + [6]=> + string(3) "v.2" + [7]=> + string(3) "v.3" +} diff --git a/tests/lang/foreachLoop.013.phpt b/tests/lang/foreachLoop.013.phpt index ea728156f0f..ba1bc89628d 100644 --- a/tests/lang/foreachLoop.013.phpt +++ b/tests/lang/foreachLoop.013.phpt @@ -1,535 +1,535 @@ ---TEST-- -Directly modifying an unreferenced array when foreach'ing over it while using &$value syntax. ---FILE-- - 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 "\nPopping elements off end of an unreferenced array, using &\$value."; -$transform = 'array_pop($a);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nShift elements off start of an unreferenced array, using &\$value."; -$transform = 'array_shift($a);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nRemove current element of an unreferenced array, using &\$value."; -$transform = 'unset($a[$k]);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nAdding elements to the end of an unreferenced array, using &\$value."; -$transform = 'array_push($a, "new.$counter");'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nAdding elements to the start of an unreferenced array, using &\$value."; -$transform = 'array_unshift($a, "new.$counter");'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -?> ---EXPECT-- - -Popping elements off end of an unreferenced array, using &$value. ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(1) { - [0]=> - &string(3) "v.0" -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(1) { - [0]=> - string(3) "v.0" -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - &string(3) "v.1" -} - - - -Shift elements off start of an unreferenced array, using &$value. ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=0; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=0; $v=v.1 - iteration 2: $k=0; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=0; $v=v.1 - iteration 2: $k=0; $v=v.2 - iteration 3: $k=0; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Remove current element of an unreferenced array, using &$value. ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Adding elements to the end of an unreferenced array, using &$value. ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=new.0 - iteration 2: $k=2; $v=new.1 - iteration 3: $k=3; $v=new.2 - iteration 4: $k=4; $v=new.3 - iteration 5: $k=5; $v=new.4 - ** Stuck in a loop! ** ---> State of array after loop: -array(7) { - [0]=> - string(3) "v.0" - [1]=> - string(5) "new.0" - [2]=> - string(5) "new.1" - [3]=> - string(5) "new.2" - [4]=> - string(5) "new.3" - [5]=> - &string(5) "new.4" - [6]=> - string(5) "new.5" -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=new.0 - iteration 3: $k=3; $v=new.1 - iteration 4: $k=4; $v=new.2 - iteration 5: $k=5; $v=new.3 - ** Stuck in a loop! ** ---> State of array after loop: -array(8) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(5) "new.0" - [3]=> - string(5) "new.1" - [4]=> - string(5) "new.2" - [5]=> - &string(5) "new.3" - [6]=> - string(5) "new.4" - [7]=> - string(5) "new.5" -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=new.0 - iteration 4: $k=4; $v=new.1 - iteration 5: $k=5; $v=new.2 - ** Stuck in a loop! ** ---> State of array after loop: -array(9) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(5) "new.0" - [4]=> - string(5) "new.1" - [5]=> - &string(5) "new.2" - [6]=> - string(5) "new.3" - [7]=> - string(5) "new.4" - [8]=> - string(5) "new.5" -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 - iteration 4: $k=4; $v=new.0 - iteration 5: $k=5; $v=new.1 - ** Stuck in a loop! ** ---> State of array after loop: -array(10) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" - [4]=> - string(5) "new.0" - [5]=> - &string(5) "new.1" - [6]=> - string(5) "new.2" - [7]=> - string(5) "new.3" - [8]=> - string(5) "new.4" - [9]=> - string(5) "new.5" -} - - - -Adding elements to the start of an unreferenced array, using &$value. ----( Array with 1 element(s): )--- ---> State of array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(2) { - [0]=> - string(5) "new.0" - [1]=> - &string(3) "v.0" -} - ----( Array with 2 element(s): )--- ---> State of array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=2; $v=v.1 ---> State of array after loop: -array(4) { - [0]=> - string(5) "new.1" - [1]=> - string(5) "new.0" - [2]=> - string(3) "v.0" - [3]=> - &string(3) "v.1" -} - ----( Array with 3 element(s): )--- ---> State of array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=3; $v=v.2 ---> State of array after loop: -array(5) { - [0]=> - string(5) "new.1" - [1]=> - string(5) "new.0" - [2]=> - string(3) "v.0" - [3]=> - string(3) "v.1" - [4]=> - &string(3) "v.2" -} - ----( Array with 4 element(s): )--- ---> State of array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=4; $v=v.3 ---> State of array after loop: -array(6) { - [0]=> - string(5) "new.1" - [1]=> - string(5) "new.0" - [2]=> - string(3) "v.0" - [3]=> - string(3) "v.1" - [4]=> - string(3) "v.2" - [5]=> - &string(3) "v.3" -} +--TEST-- +Directly modifying an unreferenced array when foreach'ing over it while using &$value syntax. +--FILE-- + 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 "\nPopping elements off end of an unreferenced array, using &\$value."; +$transform = 'array_pop($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nShift elements off start of an unreferenced array, using &\$value."; +$transform = 'array_shift($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nRemove current element of an unreferenced array, using &\$value."; +$transform = 'unset($a[$k]);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the end of an unreferenced array, using &\$value."; +$transform = 'array_push($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the start of an unreferenced array, using &\$value."; +$transform = 'array_unshift($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +?> +--EXPECT-- + +Popping elements off end of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(1) { + [0]=> + &string(3) "v.0" +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(1) { + [0]=> + string(3) "v.0" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + &string(3) "v.1" +} + + + +Shift elements off start of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 + iteration 3: $k=0; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Remove current element of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Adding elements to the end of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=new.0 + iteration 2: $k=2; $v=new.1 + iteration 3: $k=3; $v=new.2 + iteration 4: $k=4; $v=new.3 + iteration 5: $k=5; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(7) { + [0]=> + string(3) "v.0" + [1]=> + string(5) "new.0" + [2]=> + string(5) "new.1" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.3" + [5]=> + &string(5) "new.4" + [6]=> + string(5) "new.5" +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=new.0 + iteration 3: $k=3; $v=new.1 + iteration 4: $k=4; $v=new.2 + iteration 5: $k=5; $v=new.3 + ** Stuck in a loop! ** +--> State of array after loop: +array(8) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(5) "new.0" + [3]=> + string(5) "new.1" + [4]=> + string(5) "new.2" + [5]=> + &string(5) "new.3" + [6]=> + string(5) "new.4" + [7]=> + string(5) "new.5" +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=new.0 + iteration 4: $k=4; $v=new.1 + iteration 5: $k=5; $v=new.2 + ** Stuck in a loop! ** +--> State of array after loop: +array(9) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + &string(5) "new.2" + [6]=> + string(5) "new.3" + [7]=> + string(5) "new.4" + [8]=> + string(5) "new.5" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 + iteration 4: $k=4; $v=new.0 + iteration 5: $k=5; $v=new.1 + ** Stuck in a loop! ** +--> State of array after loop: +array(10) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" + [4]=> + string(5) "new.0" + [5]=> + &string(5) "new.1" + [6]=> + string(5) "new.2" + [7]=> + string(5) "new.3" + [8]=> + string(5) "new.4" + [9]=> + string(5) "new.5" +} + + + +Adding elements to the start of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(5) "new.0" + [1]=> + &string(3) "v.0" +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=2; $v=v.1 +--> State of array after loop: +array(4) { + [0]=> + string(5) "new.1" + [1]=> + string(5) "new.0" + [2]=> + string(3) "v.0" + [3]=> + &string(3) "v.1" +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=3; $v=v.2 +--> State of array after loop: +array(5) { + [0]=> + string(5) "new.1" + [1]=> + string(5) "new.0" + [2]=> + string(3) "v.0" + [3]=> + string(3) "v.1" + [4]=> + &string(3) "v.2" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=4; $v=v.3 +--> State of array after loop: +array(6) { + [0]=> + string(5) "new.1" + [1]=> + string(5) "new.0" + [2]=> + string(3) "v.0" + [3]=> + string(3) "v.1" + [4]=> + string(3) "v.2" + [5]=> + &string(3) "v.3" +} diff --git a/tests/lang/foreachLoop.014.phpt b/tests/lang/foreachLoop.014.phpt index 9b179ab22a7..770ee9f92e0 100644 --- a/tests/lang/foreachLoop.014.phpt +++ b/tests/lang/foreachLoop.014.phpt @@ -1,495 +1,495 @@ ---TEST-- -Directly modifying a REFERENCED array when foreach'ing over it. ---FILE-- - 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 "\nPopping elements off end of a referenced array"; -$transform = 'array_pop($a);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nShift elements off start of a referenced array"; -$transform = 'array_shift($a);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nRemove current element of a referenced array"; -$transform = 'unset($a[$k]);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nAdding elements to the end of a referenced array"; -$transform = 'array_push($a, "new.$counter");'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nAdding elements to the start of a referenced array"; -$transform = 'array_unshift($a, "new.$counter");'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -?> ---EXPECTF-- -Popping elements off end of a referenced array ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Shift elements off start of a referenced array ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Remove current element of a referenced array ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Adding elements to the end of a referenced array ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(5) "new.0" -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(5) "new.0" - [3]=> - string(5) "new.1" -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(6) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(5) "new.0" - [4]=> - string(5) "new.1" - [5]=> - string(5) "new.2" -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(8) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" - [4]=> - string(5) "new.0" - [5]=> - string(5) "new.1" - [6]=> - string(5) "new.2" - [7]=> - string(5) "new.3" -} - - - -Adding elements to the start of a referenced array ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(2) { - [0]=> - string(5) "new.0" - [1]=> - string(3) "v.0" -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(4) { - [0]=> - string(5) "new.1" - [1]=> - string(5) "new.0" - [2]=> - string(3) "v.0" - [3]=> - string(3) "v.1" -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(6) { - [0]=> - string(5) "new.2" - [1]=> - string(5) "new.1" - [2]=> - string(5) "new.0" - [3]=> - string(3) "v.0" - [4]=> - string(3) "v.1" - [5]=> - string(3) "v.2" -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(8) { - [0]=> - string(5) "new.3" - [1]=> - string(5) "new.2" - [2]=> - string(5) "new.1" - [3]=> - string(5) "new.0" - [4]=> - string(3) "v.0" - [5]=> - string(3) "v.1" - [6]=> - string(3) "v.2" - [7]=> - string(3) "v.3" -} +--TEST-- +Directly modifying a REFERENCED array when foreach'ing over it. +--FILE-- + 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 "\nPopping elements off end of a referenced array"; +$transform = 'array_pop($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nShift elements off start of a referenced array"; +$transform = 'array_shift($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nRemove current element of a referenced array"; +$transform = 'unset($a[$k]);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the end of a referenced array"; +$transform = 'array_push($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the start of a referenced array"; +$transform = 'array_unshift($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +?> +--EXPECTF-- +Popping elements off end of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Shift elements off start of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Remove current element of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Adding elements to the end of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(5) "new.0" +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(5) "new.0" + [3]=> + string(5) "new.1" +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(6) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.2" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(8) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" + [4]=> + string(5) "new.0" + [5]=> + string(5) "new.1" + [6]=> + string(5) "new.2" + [7]=> + string(5) "new.3" +} + + + +Adding elements to the start of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(5) "new.0" + [1]=> + string(3) "v.0" +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(4) { + [0]=> + string(5) "new.1" + [1]=> + string(5) "new.0" + [2]=> + string(3) "v.0" + [3]=> + string(3) "v.1" +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(6) { + [0]=> + string(5) "new.2" + [1]=> + string(5) "new.1" + [2]=> + string(5) "new.0" + [3]=> + string(3) "v.0" + [4]=> + string(3) "v.1" + [5]=> + string(3) "v.2" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(8) { + [0]=> + string(5) "new.3" + [1]=> + string(5) "new.2" + [2]=> + string(5) "new.1" + [3]=> + string(5) "new.0" + [4]=> + string(3) "v.0" + [5]=> + string(3) "v.1" + [6]=> + string(3) "v.2" + [7]=> + string(3) "v.3" +} diff --git a/tests/lang/foreachLoop.015.phpt b/tests/lang/foreachLoop.015.phpt index a4ee09d6a96..f7f53893957 100644 --- a/tests/lang/foreachLoop.015.phpt +++ b/tests/lang/foreachLoop.015.phpt @@ -1,537 +1,537 @@ ---TEST-- -Directly modifying a REFERENCED array when foreach'ing over it while using &$value syntax. ---FILE-- - 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 "\nPopping elements off end of a referenced array, using &\$value"; -$transform = 'array_pop($a);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nShift elements off start of a referenced array, using &\$value"; -$transform = 'array_shift($a);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nRemove current element of a referenced array, using &\$value"; -$transform = 'unset($a[$k]);'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nAdding elements to the end of a referenced array, using &\$value"; -$transform = 'array_push($a, "new.$counter");'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -echo "\n\n\nAdding elements to the start of a referenced array, using &\$value"; -$transform = 'array_unshift($a, "new.$counter");'; -withRefValue(1, $transform); -withRefValue(2, $transform); -withRefValue(3, $transform); -withRefValue(4, $transform); - -?> ---EXPECT-- - -Popping elements off end of a referenced array, using &$value ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(1) { - [0]=> - &string(3) "v.0" -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(1) { - [0]=> - string(3) "v.0" -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - &string(3) "v.1" -} - - - -Shift elements off start of a referenced array, using &$value ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=0; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=0; $v=v.1 - iteration 2: $k=0; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=0; $v=v.1 - iteration 2: $k=0; $v=v.2 - iteration 3: $k=0; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Remove current element of a referenced array, using &$value ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(0) { -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 ---> State of array after loop: -array(0) { -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 ---> State of array after loop: -array(0) { -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 ---> State of array after loop: -array(0) { -} - - - -Adding elements to the end of a referenced array, using &$value ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=new.0 - iteration 2: $k=2; $v=new.1 - iteration 3: $k=3; $v=new.2 - iteration 4: $k=4; $v=new.3 - iteration 5: $k=5; $v=new.4 - ** Stuck in a loop! ** ---> State of array after loop: -array(7) { - [0]=> - string(3) "v.0" - [1]=> - string(5) "new.0" - [2]=> - string(5) "new.1" - [3]=> - string(5) "new.2" - [4]=> - string(5) "new.3" - [5]=> - &string(5) "new.4" - [6]=> - string(5) "new.5" -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=new.0 - iteration 3: $k=3; $v=new.1 - iteration 4: $k=4; $v=new.2 - iteration 5: $k=5; $v=new.3 - ** Stuck in a loop! ** ---> State of array after loop: -array(8) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(5) "new.0" - [3]=> - string(5) "new.1" - [4]=> - string(5) "new.2" - [5]=> - &string(5) "new.3" - [6]=> - string(5) "new.4" - [7]=> - string(5) "new.5" -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=new.0 - iteration 4: $k=4; $v=new.1 - iteration 5: $k=5; $v=new.2 - ** Stuck in a loop! ** ---> State of array after loop: -array(9) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(5) "new.0" - [4]=> - string(5) "new.1" - [5]=> - &string(5) "new.2" - [6]=> - string(5) "new.3" - [7]=> - string(5) "new.4" - [8]=> - string(5) "new.5" -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=1; $v=v.1 - iteration 2: $k=2; $v=v.2 - iteration 3: $k=3; $v=v.3 - iteration 4: $k=4; $v=new.0 - iteration 5: $k=5; $v=new.1 - ** Stuck in a loop! ** ---> State of array after loop: -array(10) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" - [4]=> - string(5) "new.0" - [5]=> - &string(5) "new.1" - [6]=> - string(5) "new.2" - [7]=> - string(5) "new.3" - [8]=> - string(5) "new.4" - [9]=> - string(5) "new.5" -} - - - -Adding elements to the start of a referenced array, using &$value ----( Array with 1 element(s): )--- ---> State of referenced array before loop: -array(1) { - [0]=> - string(3) "v.0" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 ---> State of array after loop: -array(2) { - [0]=> - string(5) "new.0" - [1]=> - &string(3) "v.0" -} - ----( Array with 2 element(s): )--- ---> State of referenced array before loop: -array(2) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=2; $v=v.1 ---> State of array after loop: -array(4) { - [0]=> - string(5) "new.1" - [1]=> - string(5) "new.0" - [2]=> - string(3) "v.0" - [3]=> - &string(3) "v.1" -} - ----( Array with 3 element(s): )--- ---> State of referenced array before loop: -array(3) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=3; $v=v.2 ---> State of array after loop: -array(5) { - [0]=> - string(5) "new.1" - [1]=> - string(5) "new.0" - [2]=> - string(3) "v.0" - [3]=> - string(3) "v.1" - [4]=> - &string(3) "v.2" -} - ----( Array with 4 element(s): )--- ---> State of referenced array before loop: -array(4) { - [0]=> - string(3) "v.0" - [1]=> - string(3) "v.1" - [2]=> - string(3) "v.2" - [3]=> - string(3) "v.3" -} ---> Do loop: - iteration 0: $k=0; $v=v.0 - iteration 1: $k=4; $v=v.3 ---> State of array after loop: -array(6) { - [0]=> - string(5) "new.1" - [1]=> - string(5) "new.0" - [2]=> - string(3) "v.0" - [3]=> - string(3) "v.1" - [4]=> - string(3) "v.2" - [5]=> - &string(3) "v.3" -} +--TEST-- +Directly modifying a REFERENCED array when foreach'ing over it while using &$value syntax. +--FILE-- + 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 "\nPopping elements off end of a referenced array, using &\$value"; +$transform = 'array_pop($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nShift elements off start of a referenced array, using &\$value"; +$transform = 'array_shift($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nRemove current element of a referenced array, using &\$value"; +$transform = 'unset($a[$k]);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the end of a referenced array, using &\$value"; +$transform = 'array_push($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the start of a referenced array, using &\$value"; +$transform = 'array_unshift($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +?> +--EXPECT-- + +Popping elements off end of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(1) { + [0]=> + &string(3) "v.0" +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(1) { + [0]=> + string(3) "v.0" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + &string(3) "v.1" +} + + + +Shift elements off start of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 + iteration 3: $k=0; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Remove current element of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Adding elements to the end of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=new.0 + iteration 2: $k=2; $v=new.1 + iteration 3: $k=3; $v=new.2 + iteration 4: $k=4; $v=new.3 + iteration 5: $k=5; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(7) { + [0]=> + string(3) "v.0" + [1]=> + string(5) "new.0" + [2]=> + string(5) "new.1" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.3" + [5]=> + &string(5) "new.4" + [6]=> + string(5) "new.5" +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=new.0 + iteration 3: $k=3; $v=new.1 + iteration 4: $k=4; $v=new.2 + iteration 5: $k=5; $v=new.3 + ** Stuck in a loop! ** +--> State of array after loop: +array(8) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(5) "new.0" + [3]=> + string(5) "new.1" + [4]=> + string(5) "new.2" + [5]=> + &string(5) "new.3" + [6]=> + string(5) "new.4" + [7]=> + string(5) "new.5" +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=new.0 + iteration 4: $k=4; $v=new.1 + iteration 5: $k=5; $v=new.2 + ** Stuck in a loop! ** +--> State of array after loop: +array(9) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + &string(5) "new.2" + [6]=> + string(5) "new.3" + [7]=> + string(5) "new.4" + [8]=> + string(5) "new.5" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 + iteration 4: $k=4; $v=new.0 + iteration 5: $k=5; $v=new.1 + ** Stuck in a loop! ** +--> State of array after loop: +array(10) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" + [4]=> + string(5) "new.0" + [5]=> + &string(5) "new.1" + [6]=> + string(5) "new.2" + [7]=> + string(5) "new.3" + [8]=> + string(5) "new.4" + [9]=> + string(5) "new.5" +} + + + +Adding elements to the start of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(5) "new.0" + [1]=> + &string(3) "v.0" +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=2; $v=v.1 +--> State of array after loop: +array(4) { + [0]=> + string(5) "new.1" + [1]=> + string(5) "new.0" + [2]=> + string(3) "v.0" + [3]=> + &string(3) "v.1" +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=3; $v=v.2 +--> State of array after loop: +array(5) { + [0]=> + string(5) "new.1" + [1]=> + string(5) "new.0" + [2]=> + string(3) "v.0" + [3]=> + string(3) "v.1" + [4]=> + &string(3) "v.2" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=4; $v=v.3 +--> State of array after loop: +array(6) { + [0]=> + string(5) "new.1" + [1]=> + string(5) "new.0" + [2]=> + string(3) "v.0" + [3]=> + string(3) "v.1" + [4]=> + string(3) "v.2" + [5]=> + &string(3) "v.3" +} diff --git a/tests/lang/foreachLoop.016.phpt b/tests/lang/foreachLoop.016.phpt index d570aba3167..91c96f694d7 100644 --- a/tests/lang/foreachLoop.016.phpt +++ b/tests/lang/foreachLoop.016.phpt @@ -1,206 +1,206 @@ ---TEST-- -Ensure foreach splits the iterated entity from its cow reference set, for all sorts of iterated entities. ---FILE-- -&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . '${\'a\'}' . "\n"; - $b = $a = array('original'); - foreach(${'a'} as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . '$$a' . "\n"; - $a = 'blah'; - $$a = array('original'); - $b = $$a; - foreach($$a as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . '$a[0]' . "\n"; - $b = $a[0] = array('original'); - foreach($a[0] as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . '$a[0][0]' . "\n"; - $b = $a[0][0] = array('original'); - foreach($a[0][0] as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . '$a->b' . "\n"; - $b = $a->b = array('original'); - foreach($a->b as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . '$a->b->c' . "\n"; - $b = $a->b->c = array('original'); - foreach($a->b as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . '$a->b[0]' . "\n"; - $b = $a->b[0] = array('original'); - foreach($a->b[0] as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . '$a->b[0][0]' . "\n"; - $b = $a->b[0][0] = array('original'); - foreach($a->b[0][0] as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . '$a->b[0]->c' . "\n"; - $b = $a->b[0]->c = array('original'); - foreach($a->b[0]->c as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - class C { - public static $a; - } - - echo "\n" . 'C::$a' . "\n"; - C::$a = array('original'); - $b = C::$a; - foreach(C::$a as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset($a, $b); - - echo "\n" . 'C::$a[0]' . "\n"; - C::$a[0] = array('original'); - $b = C::$a[0]; - foreach(C::$a[0] as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset(C::$a[0], $b); - - echo "\n" . 'C::$a[0]->b' . "\n"; - C::$a[0]->b = array('original'); - $b = C::$a[0]->b; - foreach(C::$a[0]->b as $k=>&$v) { - $v = 'changed'; - } - var_dump($b); - unset(C::$a[0]->b, $b); -?> ---EXPECTF-- - -$a -array(1) { - [0]=> - string(8) "original" -} - -${'a'} -array(1) { - [0]=> - string(8) "original" -} - -$$a -array(1) { - [0]=> - string(8) "original" -} - -$a[0] -array(1) { - [0]=> - string(8) "original" -} - -$a[0][0] -array(1) { - [0]=> - string(8) "original" -} - -$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 -array(1) { - [0]=> - string(8) "original" -} - -$a->b[0] -array(1) { - [0]=> - string(8) "original" -} - -$a->b[0][0] -array(1) { - [0]=> - string(8) "original" -} - -$a->b[0]->c - -Warning: Creating default object from empty value in %s on line %d -array(1) { - [0]=> - string(8) "original" -} - -C::$a -array(1) { - [0]=> - string(8) "original" -} - -C::$a[0] -array(1) { - [0]=> - string(8) "original" -} - -C::$a[0]->b - -Warning: Creating default object from empty value in %s on line %d -array(1) { - [0]=> - string(8) "original" -} +--TEST-- +Ensure foreach splits the iterated entity from its cow reference set, for all sorts of iterated entities. +--FILE-- +&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '${\'a\'}' . "\n"; + $b = $a = array('original'); + foreach(${'a'} as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$$a' . "\n"; + $a = 'blah'; + $$a = array('original'); + $b = $$a; + foreach($$a as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a[0]' . "\n"; + $b = $a[0] = array('original'); + foreach($a[0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a[0][0]' . "\n"; + $b = $a[0][0] = array('original'); + foreach($a[0][0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b' . "\n"; + $b = $a->b = array('original'); + foreach($a->b as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b->c' . "\n"; + $b = $a->b->c = array('original'); + foreach($a->b as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b[0]' . "\n"; + $b = $a->b[0] = array('original'); + foreach($a->b[0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b[0][0]' . "\n"; + $b = $a->b[0][0] = array('original'); + foreach($a->b[0][0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b[0]->c' . "\n"; + $b = $a->b[0]->c = array('original'); + foreach($a->b[0]->c as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + class C { + public static $a; + } + + echo "\n" . 'C::$a' . "\n"; + C::$a = array('original'); + $b = C::$a; + foreach(C::$a as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . 'C::$a[0]' . "\n"; + C::$a[0] = array('original'); + $b = C::$a[0]; + foreach(C::$a[0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset(C::$a[0], $b); + + echo "\n" . 'C::$a[0]->b' . "\n"; + C::$a[0]->b = array('original'); + $b = C::$a[0]->b; + foreach(C::$a[0]->b as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset(C::$a[0]->b, $b); +?> +--EXPECTF-- + +$a +array(1) { + [0]=> + string(8) "original" +} + +${'a'} +array(1) { + [0]=> + string(8) "original" +} + +$$a +array(1) { + [0]=> + string(8) "original" +} + +$a[0] +array(1) { + [0]=> + string(8) "original" +} + +$a[0][0] +array(1) { + [0]=> + string(8) "original" +} + +$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 +array(1) { + [0]=> + string(8) "original" +} + +$a->b[0] +array(1) { + [0]=> + string(8) "original" +} + +$a->b[0][0] +array(1) { + [0]=> + string(8) "original" +} + +$a->b[0]->c + +Warning: Creating default object from empty value in %s on line %d +array(1) { + [0]=> + string(8) "original" +} + +C::$a +array(1) { + [0]=> + string(8) "original" +} + +C::$a[0] +array(1) { + [0]=> + string(8) "original" +} + +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/foreachLoop.017.phpt b/tests/lang/foreachLoop.017.phpt index 4c3a1f6c3e9..987fe3cb27f 100644 --- a/tests/lang/foreachLoop.017.phpt +++ b/tests/lang/foreachLoop.017.phpt @@ -1,11 +1,11 @@ ---TEST-- -Ensure foreach works with arrays with Binary keys. ---FILE-- - 10 ); -foreach ($a as $val=>$key) echo $key; -echo "\nDone\n"; -?> ---EXPECTF-- -10 +--TEST-- +Ensure foreach works with arrays with Binary keys. +--FILE-- + 10 ); +foreach ($a as $val=>$key) echo $key; +echo "\nDone\n"; +?> +--EXPECTF-- +10 Done diff --git a/tests/lang/operators/add_basiclong_64bit.phpt b/tests/lang/operators/add_basiclong_64bit.phpt index cae8f4f1fb5..eb55d5f2101 100644 --- a/tests/lang/operators/add_basiclong_64bit.phpt +++ b/tests/lang/operators/add_basiclong_64bit.phpt @@ -1,44 +1,44 @@ ---TEST-- -Test + operator : 64bit long tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test + operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- --- testing: 9223372036854775807 + 0 --- int(9223372036854775807) --- testing: 9223372036854775807 + 1 --- @@ -578,5 +578,5 @@ float(1.844674407371E+19) --- testing: 9223372036854775807 + -9223372036854775807 --- int(0) --- testing: 9223372036854775807 + -9.2233720368548E+18 --- -float(0) -===DONE=== +float(0) +===DONE=== diff --git a/tests/lang/operators/add_variationStr.phpt b/tests/lang/operators/add_variationStr.phpt index 264c5c1bb96..9bf11ec6981 100644 --- a/tests/lang/operators/add_variationStr.phpt +++ b/tests/lang/operators/add_variationStr.phpt @@ -1,26 +1,26 @@ ---TEST-- -Test + operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test + operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- --- testing: '0' + '0' --- int(0) --- testing: '0' + '65' --- @@ -412,5 +412,5 @@ int(123) --- testing: 'a5.9' + '3.4a' --- float(3.4) --- testing: 'a5.9' + 'a5.9' --- -int(0) -===DONE=== +int(0) +===DONE=== diff --git a/tests/lang/operators/bitwiseAnd_variationStr.phpt b/tests/lang/operators/bitwiseAnd_variationStr.phpt index 26022705fcb..5b7cb10b123 100644 --- a/tests/lang/operators/bitwiseAnd_variationStr.phpt +++ b/tests/lang/operators/bitwiseAnd_variationStr.phpt @@ -1,26 +1,26 @@ ---TEST-- -Test & operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test & operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- --- testing: '0' & '0' --- string(2) "30" --- testing: '0' & '65' --- @@ -412,5 +412,5 @@ string(8) "21302221" --- testing: 'a5.9' & '3.4a' --- string(8) "21242421" --- testing: 'a5.9' & 'a5.9' --- -string(8) "61352e39" -===DONE=== +string(8) "61352e39" +===DONE=== diff --git a/tests/lang/operators/bitwiseNot_variationStr.phpt b/tests/lang/operators/bitwiseNot_variationStr.phpt index 3e7b698680d..98bca9e4737 100644 --- a/tests/lang/operators/bitwiseNot_variationStr.phpt +++ b/tests/lang/operators/bitwiseNot_variationStr.phpt @@ -1,22 +1,22 @@ ---TEST-- -Test ~N operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test ~N operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- --- testing: '0' --- string(2) "cf" --- testing: '65' --- @@ -44,5 +44,5 @@ string(14) "cecdcc9e9d9cdf" --- testing: '3.4a' --- string(8) "ccd1cb9e" --- testing: 'a5.9' --- -string(8) "9ecad1c6" -===DONE=== +string(8) "9ecad1c6" +===DONE=== diff --git a/tests/lang/operators/bitwiseOr_variationStr.phpt b/tests/lang/operators/bitwiseOr_variationStr.phpt index 6c31477884e..2d1d3537888 100644 --- a/tests/lang/operators/bitwiseOr_variationStr.phpt +++ b/tests/lang/operators/bitwiseOr_variationStr.phpt @@ -1,26 +1,26 @@ ---TEST-- -Test | operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test | operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- --- testing: '0' | '0' --- string(2) "30" --- testing: '0' | '65' --- @@ -412,5 +412,5 @@ string(14) "71373f79626320" --- testing: 'a5.9' | '3.4a' --- string(8) "733f3e79" --- testing: 'a5.9' | 'a5.9' --- -string(8) "61352e39" -===DONE=== +string(8) "61352e39" +===DONE=== diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt index 69fd90f1c8c..ddfd2f7c6d0 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt @@ -1,424 +1,424 @@ ---TEST-- -Test << operator : various numbers as strings ---SKIPIF-- - ---FILE-- -getMessage() . "\n"; - } - } -} - - -?> -===DONE=== ---EXPECT-- ---- testing: '0' << '0' --- -int(0) ---- testing: '0' << '65' --- -int(0) ---- testing: '0' << '-44' --- -Exception: Bit shift by negative number ---- testing: '0' << '1.2' --- -int(0) ---- testing: '0' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '0' << 'abc' --- -int(0) ---- testing: '0' << '123abc' --- -int(0) ---- testing: '0' << '123e5' --- -int(0) ---- testing: '0' << '123e5xyz' --- -int(0) ---- testing: '0' << ' 123abc' --- -int(0) ---- testing: '0' << '123 abc' --- -int(0) ---- testing: '0' << '123abc ' --- -int(0) ---- testing: '0' << '3.4a' --- -int(0) ---- testing: '0' << 'a5.9' --- -int(0) ---- testing: '65' << '0' --- -int(65) ---- testing: '65' << '65' --- -int(0) ---- testing: '65' << '-44' --- -Exception: Bit shift by negative number ---- testing: '65' << '1.2' --- -int(130) ---- testing: '65' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '65' << 'abc' --- -int(65) ---- testing: '65' << '123abc' --- -int(0) ---- testing: '65' << '123e5' --- -int(0) ---- testing: '65' << '123e5xyz' --- -int(0) ---- testing: '65' << ' 123abc' --- -int(0) ---- testing: '65' << '123 abc' --- -int(0) ---- testing: '65' << '123abc ' --- -int(0) ---- testing: '65' << '3.4a' --- -int(520) ---- testing: '65' << 'a5.9' --- -int(65) ---- testing: '-44' << '0' --- -int(-44) ---- testing: '-44' << '65' --- -int(0) ---- testing: '-44' << '-44' --- -Exception: Bit shift by negative number ---- testing: '-44' << '1.2' --- -int(-88) ---- testing: '-44' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '-44' << 'abc' --- -int(-44) ---- testing: '-44' << '123abc' --- -int(0) ---- testing: '-44' << '123e5' --- -int(0) ---- testing: '-44' << '123e5xyz' --- -int(0) ---- testing: '-44' << ' 123abc' --- -int(0) ---- testing: '-44' << '123 abc' --- -int(0) ---- testing: '-44' << '123abc ' --- -int(0) ---- testing: '-44' << '3.4a' --- -int(-352) ---- testing: '-44' << 'a5.9' --- -int(-44) ---- testing: '1.2' << '0' --- -int(1) ---- testing: '1.2' << '65' --- -int(0) ---- testing: '1.2' << '-44' --- -Exception: Bit shift by negative number ---- testing: '1.2' << '1.2' --- -int(2) ---- testing: '1.2' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '1.2' << 'abc' --- -int(1) ---- testing: '1.2' << '123abc' --- -int(0) ---- testing: '1.2' << '123e5' --- -int(0) ---- testing: '1.2' << '123e5xyz' --- -int(0) ---- testing: '1.2' << ' 123abc' --- -int(0) ---- testing: '1.2' << '123 abc' --- -int(0) ---- testing: '1.2' << '123abc ' --- -int(0) ---- testing: '1.2' << '3.4a' --- -int(8) ---- testing: '1.2' << 'a5.9' --- -int(1) ---- testing: '-7.7' << '0' --- -int(-7) ---- testing: '-7.7' << '65' --- -int(0) ---- testing: '-7.7' << '-44' --- -Exception: Bit shift by negative number ---- testing: '-7.7' << '1.2' --- -int(-14) ---- testing: '-7.7' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '-7.7' << 'abc' --- -int(-7) ---- testing: '-7.7' << '123abc' --- -int(0) ---- testing: '-7.7' << '123e5' --- -int(0) ---- testing: '-7.7' << '123e5xyz' --- -int(0) ---- testing: '-7.7' << ' 123abc' --- -int(0) ---- testing: '-7.7' << '123 abc' --- -int(0) ---- testing: '-7.7' << '123abc ' --- -int(0) ---- testing: '-7.7' << '3.4a' --- -int(-56) ---- testing: '-7.7' << 'a5.9' --- -int(-7) ---- testing: 'abc' << '0' --- -int(0) ---- testing: 'abc' << '65' --- -int(0) ---- testing: 'abc' << '-44' --- -Exception: Bit shift by negative number ---- testing: 'abc' << '1.2' --- -int(0) ---- testing: 'abc' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: 'abc' << 'abc' --- -int(0) ---- testing: 'abc' << '123abc' --- -int(0) ---- testing: 'abc' << '123e5' --- -int(0) ---- testing: 'abc' << '123e5xyz' --- -int(0) ---- testing: 'abc' << ' 123abc' --- -int(0) ---- testing: 'abc' << '123 abc' --- -int(0) ---- testing: 'abc' << '123abc ' --- -int(0) ---- testing: 'abc' << '3.4a' --- -int(0) ---- testing: 'abc' << 'a5.9' --- -int(0) ---- testing: '123abc' << '0' --- -int(123) ---- testing: '123abc' << '65' --- -int(0) ---- testing: '123abc' << '-44' --- -Exception: Bit shift by negative number ---- testing: '123abc' << '1.2' --- -int(246) ---- testing: '123abc' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '123abc' << 'abc' --- -int(123) ---- testing: '123abc' << '123abc' --- -int(0) ---- testing: '123abc' << '123e5' --- -int(0) ---- testing: '123abc' << '123e5xyz' --- -int(0) ---- testing: '123abc' << ' 123abc' --- -int(0) ---- testing: '123abc' << '123 abc' --- -int(0) ---- testing: '123abc' << '123abc ' --- -int(0) ---- testing: '123abc' << '3.4a' --- -int(984) ---- testing: '123abc' << 'a5.9' --- -int(123) ---- testing: '123e5' << '0' --- -int(12300000) ---- testing: '123e5' << '65' --- -int(0) ---- testing: '123e5' << '-44' --- -Exception: Bit shift by negative number ---- testing: '123e5' << '1.2' --- -int(24600000) ---- testing: '123e5' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '123e5' << 'abc' --- -int(12300000) ---- testing: '123e5' << '123abc' --- -int(0) ---- testing: '123e5' << '123e5' --- -int(0) ---- testing: '123e5' << '123e5xyz' --- -int(0) ---- testing: '123e5' << ' 123abc' --- -int(0) ---- testing: '123e5' << '123 abc' --- -int(0) ---- testing: '123e5' << '123abc ' --- -int(0) ---- testing: '123e5' << '3.4a' --- -int(98400000) ---- testing: '123e5' << 'a5.9' --- -int(12300000) ---- testing: '123e5xyz' << '0' --- -int(12300000) ---- testing: '123e5xyz' << '65' --- -int(0) ---- testing: '123e5xyz' << '-44' --- -Exception: Bit shift by negative number ---- testing: '123e5xyz' << '1.2' --- -int(24600000) ---- testing: '123e5xyz' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '123e5xyz' << 'abc' --- -int(12300000) ---- testing: '123e5xyz' << '123abc' --- -int(0) ---- testing: '123e5xyz' << '123e5' --- -int(0) ---- testing: '123e5xyz' << '123e5xyz' --- -int(0) ---- testing: '123e5xyz' << ' 123abc' --- -int(0) ---- testing: '123e5xyz' << '123 abc' --- -int(0) ---- testing: '123e5xyz' << '123abc ' --- -int(0) ---- testing: '123e5xyz' << '3.4a' --- -int(98400000) ---- testing: '123e5xyz' << 'a5.9' --- -int(12300000) ---- testing: ' 123abc' << '0' --- -int(123) ---- testing: ' 123abc' << '65' --- -int(0) ---- testing: ' 123abc' << '-44' --- -Exception: Bit shift by negative number ---- testing: ' 123abc' << '1.2' --- -int(246) ---- testing: ' 123abc' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: ' 123abc' << 'abc' --- -int(123) ---- testing: ' 123abc' << '123abc' --- -int(0) ---- testing: ' 123abc' << '123e5' --- -int(0) ---- testing: ' 123abc' << '123e5xyz' --- -int(0) ---- testing: ' 123abc' << ' 123abc' --- -int(0) ---- testing: ' 123abc' << '123 abc' --- -int(0) ---- testing: ' 123abc' << '123abc ' --- -int(0) ---- testing: ' 123abc' << '3.4a' --- -int(984) ---- testing: ' 123abc' << 'a5.9' --- -int(123) ---- testing: '123 abc' << '0' --- -int(123) ---- testing: '123 abc' << '65' --- -int(0) ---- testing: '123 abc' << '-44' --- -Exception: Bit shift by negative number ---- testing: '123 abc' << '1.2' --- -int(246) ---- testing: '123 abc' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '123 abc' << 'abc' --- -int(123) ---- testing: '123 abc' << '123abc' --- -int(0) ---- testing: '123 abc' << '123e5' --- -int(0) ---- testing: '123 abc' << '123e5xyz' --- -int(0) ---- testing: '123 abc' << ' 123abc' --- -int(0) ---- testing: '123 abc' << '123 abc' --- -int(0) ---- testing: '123 abc' << '123abc ' --- -int(0) ---- testing: '123 abc' << '3.4a' --- -int(984) ---- testing: '123 abc' << 'a5.9' --- -int(123) ---- testing: '123abc ' << '0' --- -int(123) ---- testing: '123abc ' << '65' --- -int(0) ---- testing: '123abc ' << '-44' --- -Exception: Bit shift by negative number ---- testing: '123abc ' << '1.2' --- -int(246) ---- testing: '123abc ' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '123abc ' << 'abc' --- -int(123) ---- testing: '123abc ' << '123abc' --- -int(0) ---- testing: '123abc ' << '123e5' --- -int(0) ---- testing: '123abc ' << '123e5xyz' --- -int(0) ---- testing: '123abc ' << ' 123abc' --- -int(0) ---- testing: '123abc ' << '123 abc' --- -int(0) ---- testing: '123abc ' << '123abc ' --- -int(0) ---- testing: '123abc ' << '3.4a' --- -int(984) ---- testing: '123abc ' << 'a5.9' --- -int(123) ---- testing: '3.4a' << '0' --- -int(3) ---- testing: '3.4a' << '65' --- -int(0) ---- testing: '3.4a' << '-44' --- -Exception: Bit shift by negative number ---- testing: '3.4a' << '1.2' --- -int(6) ---- testing: '3.4a' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: '3.4a' << 'abc' --- -int(3) ---- testing: '3.4a' << '123abc' --- -int(0) ---- testing: '3.4a' << '123e5' --- -int(0) ---- testing: '3.4a' << '123e5xyz' --- -int(0) ---- testing: '3.4a' << ' 123abc' --- -int(0) ---- testing: '3.4a' << '123 abc' --- -int(0) ---- testing: '3.4a' << '123abc ' --- -int(0) ---- testing: '3.4a' << '3.4a' --- -int(24) ---- testing: '3.4a' << 'a5.9' --- -int(3) ---- testing: 'a5.9' << '0' --- -int(0) ---- testing: 'a5.9' << '65' --- -int(0) ---- testing: 'a5.9' << '-44' --- -Exception: Bit shift by negative number ---- testing: 'a5.9' << '1.2' --- -int(0) ---- testing: 'a5.9' << '-7.7' --- -Exception: Bit shift by negative number ---- testing: 'a5.9' << 'abc' --- -int(0) ---- testing: 'a5.9' << '123abc' --- -int(0) ---- testing: 'a5.9' << '123e5' --- -int(0) ---- testing: 'a5.9' << '123e5xyz' --- -int(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' --- -int(0) ---- testing: 'a5.9' << 'a5.9' --- -int(0) -===DONE=== +--TEST-- +Test << operator : various numbers as strings +--SKIPIF-- + +--FILE-- +getMessage() . "\n"; + } + } +} + + +?> +===DONE=== +--EXPECT-- +--- testing: '0' << '0' --- +int(0) +--- testing: '0' << '65' --- +int(0) +--- testing: '0' << '-44' --- +Exception: Bit shift by negative number +--- testing: '0' << '1.2' --- +int(0) +--- testing: '0' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '0' << 'abc' --- +int(0) +--- testing: '0' << '123abc' --- +int(0) +--- testing: '0' << '123e5' --- +int(0) +--- testing: '0' << '123e5xyz' --- +int(0) +--- testing: '0' << ' 123abc' --- +int(0) +--- testing: '0' << '123 abc' --- +int(0) +--- testing: '0' << '123abc ' --- +int(0) +--- testing: '0' << '3.4a' --- +int(0) +--- testing: '0' << 'a5.9' --- +int(0) +--- testing: '65' << '0' --- +int(65) +--- testing: '65' << '65' --- +int(0) +--- testing: '65' << '-44' --- +Exception: Bit shift by negative number +--- testing: '65' << '1.2' --- +int(130) +--- testing: '65' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '65' << 'abc' --- +int(65) +--- testing: '65' << '123abc' --- +int(0) +--- testing: '65' << '123e5' --- +int(0) +--- testing: '65' << '123e5xyz' --- +int(0) +--- testing: '65' << ' 123abc' --- +int(0) +--- testing: '65' << '123 abc' --- +int(0) +--- testing: '65' << '123abc ' --- +int(0) +--- testing: '65' << '3.4a' --- +int(520) +--- testing: '65' << 'a5.9' --- +int(65) +--- testing: '-44' << '0' --- +int(-44) +--- testing: '-44' << '65' --- +int(0) +--- testing: '-44' << '-44' --- +Exception: Bit shift by negative number +--- testing: '-44' << '1.2' --- +int(-88) +--- testing: '-44' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '-44' << 'abc' --- +int(-44) +--- testing: '-44' << '123abc' --- +int(0) +--- testing: '-44' << '123e5' --- +int(0) +--- testing: '-44' << '123e5xyz' --- +int(0) +--- testing: '-44' << ' 123abc' --- +int(0) +--- testing: '-44' << '123 abc' --- +int(0) +--- testing: '-44' << '123abc ' --- +int(0) +--- testing: '-44' << '3.4a' --- +int(-352) +--- testing: '-44' << 'a5.9' --- +int(-44) +--- testing: '1.2' << '0' --- +int(1) +--- testing: '1.2' << '65' --- +int(0) +--- testing: '1.2' << '-44' --- +Exception: Bit shift by negative number +--- testing: '1.2' << '1.2' --- +int(2) +--- testing: '1.2' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '1.2' << 'abc' --- +int(1) +--- testing: '1.2' << '123abc' --- +int(0) +--- testing: '1.2' << '123e5' --- +int(0) +--- testing: '1.2' << '123e5xyz' --- +int(0) +--- testing: '1.2' << ' 123abc' --- +int(0) +--- testing: '1.2' << '123 abc' --- +int(0) +--- testing: '1.2' << '123abc ' --- +int(0) +--- testing: '1.2' << '3.4a' --- +int(8) +--- testing: '1.2' << 'a5.9' --- +int(1) +--- testing: '-7.7' << '0' --- +int(-7) +--- testing: '-7.7' << '65' --- +int(0) +--- testing: '-7.7' << '-44' --- +Exception: Bit shift by negative number +--- testing: '-7.7' << '1.2' --- +int(-14) +--- testing: '-7.7' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '-7.7' << 'abc' --- +int(-7) +--- testing: '-7.7' << '123abc' --- +int(0) +--- testing: '-7.7' << '123e5' --- +int(0) +--- testing: '-7.7' << '123e5xyz' --- +int(0) +--- testing: '-7.7' << ' 123abc' --- +int(0) +--- testing: '-7.7' << '123 abc' --- +int(0) +--- testing: '-7.7' << '123abc ' --- +int(0) +--- testing: '-7.7' << '3.4a' --- +int(-56) +--- testing: '-7.7' << 'a5.9' --- +int(-7) +--- testing: 'abc' << '0' --- +int(0) +--- testing: 'abc' << '65' --- +int(0) +--- testing: 'abc' << '-44' --- +Exception: Bit shift by negative number +--- testing: 'abc' << '1.2' --- +int(0) +--- testing: 'abc' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: 'abc' << 'abc' --- +int(0) +--- testing: 'abc' << '123abc' --- +int(0) +--- testing: 'abc' << '123e5' --- +int(0) +--- testing: 'abc' << '123e5xyz' --- +int(0) +--- testing: 'abc' << ' 123abc' --- +int(0) +--- testing: 'abc' << '123 abc' --- +int(0) +--- testing: 'abc' << '123abc ' --- +int(0) +--- testing: 'abc' << '3.4a' --- +int(0) +--- testing: 'abc' << 'a5.9' --- +int(0) +--- testing: '123abc' << '0' --- +int(123) +--- testing: '123abc' << '65' --- +int(0) +--- testing: '123abc' << '-44' --- +Exception: Bit shift by negative number +--- testing: '123abc' << '1.2' --- +int(246) +--- testing: '123abc' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '123abc' << 'abc' --- +int(123) +--- testing: '123abc' << '123abc' --- +int(0) +--- testing: '123abc' << '123e5' --- +int(0) +--- testing: '123abc' << '123e5xyz' --- +int(0) +--- testing: '123abc' << ' 123abc' --- +int(0) +--- testing: '123abc' << '123 abc' --- +int(0) +--- testing: '123abc' << '123abc ' --- +int(0) +--- testing: '123abc' << '3.4a' --- +int(984) +--- testing: '123abc' << 'a5.9' --- +int(123) +--- testing: '123e5' << '0' --- +int(12300000) +--- testing: '123e5' << '65' --- +int(0) +--- testing: '123e5' << '-44' --- +Exception: Bit shift by negative number +--- testing: '123e5' << '1.2' --- +int(24600000) +--- testing: '123e5' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '123e5' << 'abc' --- +int(12300000) +--- testing: '123e5' << '123abc' --- +int(0) +--- testing: '123e5' << '123e5' --- +int(0) +--- testing: '123e5' << '123e5xyz' --- +int(0) +--- testing: '123e5' << ' 123abc' --- +int(0) +--- testing: '123e5' << '123 abc' --- +int(0) +--- testing: '123e5' << '123abc ' --- +int(0) +--- testing: '123e5' << '3.4a' --- +int(98400000) +--- testing: '123e5' << 'a5.9' --- +int(12300000) +--- testing: '123e5xyz' << '0' --- +int(12300000) +--- testing: '123e5xyz' << '65' --- +int(0) +--- testing: '123e5xyz' << '-44' --- +Exception: Bit shift by negative number +--- testing: '123e5xyz' << '1.2' --- +int(24600000) +--- testing: '123e5xyz' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '123e5xyz' << 'abc' --- +int(12300000) +--- testing: '123e5xyz' << '123abc' --- +int(0) +--- testing: '123e5xyz' << '123e5' --- +int(0) +--- testing: '123e5xyz' << '123e5xyz' --- +int(0) +--- testing: '123e5xyz' << ' 123abc' --- +int(0) +--- testing: '123e5xyz' << '123 abc' --- +int(0) +--- testing: '123e5xyz' << '123abc ' --- +int(0) +--- testing: '123e5xyz' << '3.4a' --- +int(98400000) +--- testing: '123e5xyz' << 'a5.9' --- +int(12300000) +--- testing: ' 123abc' << '0' --- +int(123) +--- testing: ' 123abc' << '65' --- +int(0) +--- testing: ' 123abc' << '-44' --- +Exception: Bit shift by negative number +--- testing: ' 123abc' << '1.2' --- +int(246) +--- testing: ' 123abc' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: ' 123abc' << 'abc' --- +int(123) +--- testing: ' 123abc' << '123abc' --- +int(0) +--- testing: ' 123abc' << '123e5' --- +int(0) +--- testing: ' 123abc' << '123e5xyz' --- +int(0) +--- testing: ' 123abc' << ' 123abc' --- +int(0) +--- testing: ' 123abc' << '123 abc' --- +int(0) +--- testing: ' 123abc' << '123abc ' --- +int(0) +--- testing: ' 123abc' << '3.4a' --- +int(984) +--- testing: ' 123abc' << 'a5.9' --- +int(123) +--- testing: '123 abc' << '0' --- +int(123) +--- testing: '123 abc' << '65' --- +int(0) +--- testing: '123 abc' << '-44' --- +Exception: Bit shift by negative number +--- testing: '123 abc' << '1.2' --- +int(246) +--- testing: '123 abc' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '123 abc' << 'abc' --- +int(123) +--- testing: '123 abc' << '123abc' --- +int(0) +--- testing: '123 abc' << '123e5' --- +int(0) +--- testing: '123 abc' << '123e5xyz' --- +int(0) +--- testing: '123 abc' << ' 123abc' --- +int(0) +--- testing: '123 abc' << '123 abc' --- +int(0) +--- testing: '123 abc' << '123abc ' --- +int(0) +--- testing: '123 abc' << '3.4a' --- +int(984) +--- testing: '123 abc' << 'a5.9' --- +int(123) +--- testing: '123abc ' << '0' --- +int(123) +--- testing: '123abc ' << '65' --- +int(0) +--- testing: '123abc ' << '-44' --- +Exception: Bit shift by negative number +--- testing: '123abc ' << '1.2' --- +int(246) +--- testing: '123abc ' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '123abc ' << 'abc' --- +int(123) +--- testing: '123abc ' << '123abc' --- +int(0) +--- testing: '123abc ' << '123e5' --- +int(0) +--- testing: '123abc ' << '123e5xyz' --- +int(0) +--- testing: '123abc ' << ' 123abc' --- +int(0) +--- testing: '123abc ' << '123 abc' --- +int(0) +--- testing: '123abc ' << '123abc ' --- +int(0) +--- testing: '123abc ' << '3.4a' --- +int(984) +--- testing: '123abc ' << 'a5.9' --- +int(123) +--- testing: '3.4a' << '0' --- +int(3) +--- testing: '3.4a' << '65' --- +int(0) +--- testing: '3.4a' << '-44' --- +Exception: Bit shift by negative number +--- testing: '3.4a' << '1.2' --- +int(6) +--- testing: '3.4a' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: '3.4a' << 'abc' --- +int(3) +--- testing: '3.4a' << '123abc' --- +int(0) +--- testing: '3.4a' << '123e5' --- +int(0) +--- testing: '3.4a' << '123e5xyz' --- +int(0) +--- testing: '3.4a' << ' 123abc' --- +int(0) +--- testing: '3.4a' << '123 abc' --- +int(0) +--- testing: '3.4a' << '123abc ' --- +int(0) +--- testing: '3.4a' << '3.4a' --- +int(24) +--- testing: '3.4a' << 'a5.9' --- +int(3) +--- testing: 'a5.9' << '0' --- +int(0) +--- testing: 'a5.9' << '65' --- +int(0) +--- testing: 'a5.9' << '-44' --- +Exception: Bit shift by negative number +--- testing: 'a5.9' << '1.2' --- +int(0) +--- testing: 'a5.9' << '-7.7' --- +Exception: Bit shift by negative number +--- testing: 'a5.9' << 'abc' --- +int(0) +--- testing: 'a5.9' << '123abc' --- +int(0) +--- testing: 'a5.9' << '123e5' --- +int(0) +--- testing: 'a5.9' << '123e5xyz' --- +int(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' --- +int(0) +--- testing: 'a5.9' << 'a5.9' --- +int(0) +===DONE=== diff --git a/tests/lang/operators/bitwiseXor_variationStr.phpt b/tests/lang/operators/bitwiseXor_variationStr.phpt index 7dda65910a1..64d5eb75d80 100644 --- a/tests/lang/operators/bitwiseXor_variationStr.phpt +++ b/tests/lang/operators/bitwiseXor_variationStr.phpt @@ -1,26 +1,26 @@ ---TEST-- -Test ^ operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test ^ operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- --- testing: '0' ^ '0' --- string(2) "00" --- testing: '0' ^ '65' --- @@ -412,5 +412,5 @@ string(8) "50071d58" --- testing: 'a5.9' ^ '3.4a' --- string(8) "521b1a58" --- testing: 'a5.9' ^ 'a5.9' --- -string(8) "00000000" -===DONE=== +string(8) "00000000" +===DONE=== diff --git a/tests/lang/operators/divide_basiclong_64bit.phpt b/tests/lang/operators/divide_basiclong_64bit.phpt index c6bed0c88bc..0dd08f534f6 100644 --- a/tests/lang/operators/divide_basiclong_64bit.phpt +++ b/tests/lang/operators/divide_basiclong_64bit.phpt @@ -1,44 +1,44 @@ ---TEST-- -Test / operator : 64bit long tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test / operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- --- testing: 9223372036854775807 / 0 --- float(INF) --- testing: 9223372036854775807 / 1 --- @@ -578,5 +578,5 @@ float(1) --- testing: 9223372036854775807 / -9223372036854775807 --- int(-1) --- testing: 9223372036854775807 / -9.2233720368548E+18 --- -float(-1) -===DONE=== +float(-1) +===DONE=== diff --git a/tests/lang/operators/divide_variationStr.phpt b/tests/lang/operators/divide_variationStr.phpt index f54013fcece..88ff8f18406 100644 --- a/tests/lang/operators/divide_variationStr.phpt +++ b/tests/lang/operators/divide_variationStr.phpt @@ -1,26 +1,26 @@ ---TEST-- -Test / operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test / operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- --- testing: '0' / '0' --- float(NAN) --- testing: '0' / '65' --- @@ -412,5 +412,5 @@ int(0) --- testing: 'a5.9' / '3.4a' --- float(0) --- testing: 'a5.9' / 'a5.9' --- -float(NAN) -===DONE=== +float(NAN) +===DONE=== diff --git a/tests/lang/operators/modulus_variationStr.phpt b/tests/lang/operators/modulus_variationStr.phpt index 4cfd7768ffe..6441428e3e5 100644 --- a/tests/lang/operators/modulus_variationStr.phpt +++ b/tests/lang/operators/modulus_variationStr.phpt @@ -1,420 +1,420 @@ ---TEST-- -Test % operator : various numbers as strings ---FILE-- -getMessage() . "\n"; - } - } -} - - -?> -===DONE=== ---EXPECT-- ---- testing: '0' % '0' --- -Exception: Modulo by zero ---- testing: '0' % '65' --- -int(0) ---- testing: '0' % '-44' --- -int(0) ---- testing: '0' % '1.2' --- -int(0) ---- testing: '0' % '-7.7' --- -int(0) ---- testing: '0' % 'abc' --- -Exception: Modulo by zero ---- testing: '0' % '123abc' --- -int(0) ---- testing: '0' % '123e5' --- -int(0) ---- testing: '0' % '123e5xyz' --- -int(0) ---- testing: '0' % ' 123abc' --- -int(0) ---- testing: '0' % '123 abc' --- -int(0) ---- testing: '0' % '123abc ' --- -int(0) ---- testing: '0' % '3.4a' --- -int(0) ---- testing: '0' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '65' % '0' --- -Exception: Modulo by zero ---- testing: '65' % '65' --- -int(0) ---- testing: '65' % '-44' --- -int(21) ---- testing: '65' % '1.2' --- -int(0) ---- testing: '65' % '-7.7' --- -int(2) ---- testing: '65' % 'abc' --- -Exception: Modulo by zero ---- testing: '65' % '123abc' --- -int(65) ---- testing: '65' % '123e5' --- -int(65) ---- testing: '65' % '123e5xyz' --- -int(65) ---- testing: '65' % ' 123abc' --- -int(65) ---- testing: '65' % '123 abc' --- -int(65) ---- testing: '65' % '123abc ' --- -int(65) ---- testing: '65' % '3.4a' --- -int(2) ---- testing: '65' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '-44' % '0' --- -Exception: Modulo by zero ---- testing: '-44' % '65' --- -int(-44) ---- testing: '-44' % '-44' --- -int(0) ---- testing: '-44' % '1.2' --- -int(0) ---- testing: '-44' % '-7.7' --- -int(-2) ---- testing: '-44' % 'abc' --- -Exception: Modulo by zero ---- testing: '-44' % '123abc' --- -int(-44) ---- testing: '-44' % '123e5' --- -int(-44) ---- testing: '-44' % '123e5xyz' --- -int(-44) ---- testing: '-44' % ' 123abc' --- -int(-44) ---- testing: '-44' % '123 abc' --- -int(-44) ---- testing: '-44' % '123abc ' --- -int(-44) ---- testing: '-44' % '3.4a' --- -int(-2) ---- testing: '-44' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '1.2' % '0' --- -Exception: Modulo by zero ---- testing: '1.2' % '65' --- -int(1) ---- testing: '1.2' % '-44' --- -int(1) ---- testing: '1.2' % '1.2' --- -int(0) ---- testing: '1.2' % '-7.7' --- -int(1) ---- testing: '1.2' % 'abc' --- -Exception: Modulo by zero ---- testing: '1.2' % '123abc' --- -int(1) ---- testing: '1.2' % '123e5' --- -int(1) ---- testing: '1.2' % '123e5xyz' --- -int(1) ---- testing: '1.2' % ' 123abc' --- -int(1) ---- testing: '1.2' % '123 abc' --- -int(1) ---- testing: '1.2' % '123abc ' --- -int(1) ---- testing: '1.2' % '3.4a' --- -int(1) ---- testing: '1.2' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '-7.7' % '0' --- -Exception: Modulo by zero ---- testing: '-7.7' % '65' --- -int(-7) ---- testing: '-7.7' % '-44' --- -int(-7) ---- testing: '-7.7' % '1.2' --- -int(0) ---- testing: '-7.7' % '-7.7' --- -int(0) ---- testing: '-7.7' % 'abc' --- -Exception: Modulo by zero ---- testing: '-7.7' % '123abc' --- -int(-7) ---- testing: '-7.7' % '123e5' --- -int(-7) ---- testing: '-7.7' % '123e5xyz' --- -int(-7) ---- testing: '-7.7' % ' 123abc' --- -int(-7) ---- testing: '-7.7' % '123 abc' --- -int(-7) ---- testing: '-7.7' % '123abc ' --- -int(-7) ---- testing: '-7.7' % '3.4a' --- -int(-1) ---- testing: '-7.7' % 'a5.9' --- -Exception: Modulo by zero ---- testing: 'abc' % '0' --- -Exception: Modulo by zero ---- testing: 'abc' % '65' --- -int(0) ---- testing: 'abc' % '-44' --- -int(0) ---- testing: 'abc' % '1.2' --- -int(0) ---- testing: 'abc' % '-7.7' --- -int(0) ---- testing: 'abc' % 'abc' --- -Exception: Modulo by zero ---- testing: 'abc' % '123abc' --- -int(0) ---- testing: 'abc' % '123e5' --- -int(0) ---- testing: 'abc' % '123e5xyz' --- -int(0) ---- testing: 'abc' % ' 123abc' --- -int(0) ---- testing: 'abc' % '123 abc' --- -int(0) ---- testing: 'abc' % '123abc ' --- -int(0) ---- testing: 'abc' % '3.4a' --- -int(0) ---- testing: 'abc' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '123abc' % '0' --- -Exception: Modulo by zero ---- testing: '123abc' % '65' --- -int(58) ---- testing: '123abc' % '-44' --- -int(35) ---- testing: '123abc' % '1.2' --- -int(0) ---- testing: '123abc' % '-7.7' --- -int(4) ---- testing: '123abc' % 'abc' --- -Exception: Modulo by zero ---- testing: '123abc' % '123abc' --- -int(0) ---- testing: '123abc' % '123e5' --- -int(123) ---- testing: '123abc' % '123e5xyz' --- -int(123) ---- testing: '123abc' % ' 123abc' --- -int(0) ---- testing: '123abc' % '123 abc' --- -int(0) ---- testing: '123abc' % '123abc ' --- -int(0) ---- testing: '123abc' % '3.4a' --- -int(0) ---- testing: '123abc' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '123e5' % '0' --- -Exception: Modulo by zero ---- testing: '123e5' % '65' --- -int(50) ---- testing: '123e5' % '-44' --- -int(20) ---- testing: '123e5' % '1.2' --- -int(0) ---- testing: '123e5' % '-7.7' --- -int(6) ---- testing: '123e5' % 'abc' --- -Exception: Modulo by zero ---- testing: '123e5' % '123abc' --- -int(0) ---- testing: '123e5' % '123e5' --- -int(0) ---- testing: '123e5' % '123e5xyz' --- -int(0) ---- testing: '123e5' % ' 123abc' --- -int(0) ---- testing: '123e5' % '123 abc' --- -int(0) ---- testing: '123e5' % '123abc ' --- -int(0) ---- testing: '123e5' % '3.4a' --- -int(0) ---- testing: '123e5' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '123e5xyz' % '0' --- -Exception: Modulo by zero ---- testing: '123e5xyz' % '65' --- -int(50) ---- testing: '123e5xyz' % '-44' --- -int(20) ---- testing: '123e5xyz' % '1.2' --- -int(0) ---- testing: '123e5xyz' % '-7.7' --- -int(6) ---- testing: '123e5xyz' % 'abc' --- -Exception: Modulo by zero ---- testing: '123e5xyz' % '123abc' --- -int(0) ---- testing: '123e5xyz' % '123e5' --- -int(0) ---- testing: '123e5xyz' % '123e5xyz' --- -int(0) ---- testing: '123e5xyz' % ' 123abc' --- -int(0) ---- testing: '123e5xyz' % '123 abc' --- -int(0) ---- testing: '123e5xyz' % '123abc ' --- -int(0) ---- testing: '123e5xyz' % '3.4a' --- -int(0) ---- testing: '123e5xyz' % 'a5.9' --- -Exception: Modulo by zero ---- testing: ' 123abc' % '0' --- -Exception: Modulo by zero ---- testing: ' 123abc' % '65' --- -int(58) ---- testing: ' 123abc' % '-44' --- -int(35) ---- testing: ' 123abc' % '1.2' --- -int(0) ---- testing: ' 123abc' % '-7.7' --- -int(4) ---- testing: ' 123abc' % 'abc' --- -Exception: Modulo by zero ---- testing: ' 123abc' % '123abc' --- -int(0) ---- testing: ' 123abc' % '123e5' --- -int(123) ---- testing: ' 123abc' % '123e5xyz' --- -int(123) ---- testing: ' 123abc' % ' 123abc' --- -int(0) ---- testing: ' 123abc' % '123 abc' --- -int(0) ---- testing: ' 123abc' % '123abc ' --- -int(0) ---- testing: ' 123abc' % '3.4a' --- -int(0) ---- testing: ' 123abc' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '123 abc' % '0' --- -Exception: Modulo by zero ---- testing: '123 abc' % '65' --- -int(58) ---- testing: '123 abc' % '-44' --- -int(35) ---- testing: '123 abc' % '1.2' --- -int(0) ---- testing: '123 abc' % '-7.7' --- -int(4) ---- testing: '123 abc' % 'abc' --- -Exception: Modulo by zero ---- testing: '123 abc' % '123abc' --- -int(0) ---- testing: '123 abc' % '123e5' --- -int(123) ---- testing: '123 abc' % '123e5xyz' --- -int(123) ---- testing: '123 abc' % ' 123abc' --- -int(0) ---- testing: '123 abc' % '123 abc' --- -int(0) ---- testing: '123 abc' % '123abc ' --- -int(0) ---- testing: '123 abc' % '3.4a' --- -int(0) ---- testing: '123 abc' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '123abc ' % '0' --- -Exception: Modulo by zero ---- testing: '123abc ' % '65' --- -int(58) ---- testing: '123abc ' % '-44' --- -int(35) ---- testing: '123abc ' % '1.2' --- -int(0) ---- testing: '123abc ' % '-7.7' --- -int(4) ---- testing: '123abc ' % 'abc' --- -Exception: Modulo by zero ---- testing: '123abc ' % '123abc' --- -int(0) ---- testing: '123abc ' % '123e5' --- -int(123) ---- testing: '123abc ' % '123e5xyz' --- -int(123) ---- testing: '123abc ' % ' 123abc' --- -int(0) ---- testing: '123abc ' % '123 abc' --- -int(0) ---- testing: '123abc ' % '123abc ' --- -int(0) ---- testing: '123abc ' % '3.4a' --- -int(0) ---- testing: '123abc ' % 'a5.9' --- -Exception: Modulo by zero ---- testing: '3.4a' % '0' --- -Exception: Modulo by zero ---- testing: '3.4a' % '65' --- -int(3) ---- testing: '3.4a' % '-44' --- -int(3) ---- testing: '3.4a' % '1.2' --- -int(0) ---- testing: '3.4a' % '-7.7' --- -int(3) ---- testing: '3.4a' % 'abc' --- -Exception: Modulo by zero ---- testing: '3.4a' % '123abc' --- -int(3) ---- testing: '3.4a' % '123e5' --- -int(3) ---- testing: '3.4a' % '123e5xyz' --- -int(3) ---- testing: '3.4a' % ' 123abc' --- -int(3) ---- testing: '3.4a' % '123 abc' --- -int(3) ---- testing: '3.4a' % '123abc ' --- -int(3) ---- testing: '3.4a' % '3.4a' --- -int(0) ---- testing: '3.4a' % 'a5.9' --- -Exception: Modulo by zero ---- testing: 'a5.9' % '0' --- -Exception: Modulo by zero ---- testing: 'a5.9' % '65' --- -int(0) ---- testing: 'a5.9' % '-44' --- -int(0) ---- testing: 'a5.9' % '1.2' --- -int(0) ---- testing: 'a5.9' % '-7.7' --- -int(0) ---- testing: 'a5.9' % 'abc' --- -Exception: Modulo by zero ---- testing: 'a5.9' % '123abc' --- -int(0) ---- testing: 'a5.9' % '123e5' --- -int(0) ---- testing: 'a5.9' % '123e5xyz' --- -int(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' --- -int(0) ---- testing: 'a5.9' % 'a5.9' --- -Exception: Modulo by zero -===DONE=== +--TEST-- +Test % operator : various numbers as strings +--FILE-- +getMessage() . "\n"; + } + } +} + + +?> +===DONE=== +--EXPECT-- +--- testing: '0' % '0' --- +Exception: Modulo by zero +--- testing: '0' % '65' --- +int(0) +--- testing: '0' % '-44' --- +int(0) +--- testing: '0' % '1.2' --- +int(0) +--- testing: '0' % '-7.7' --- +int(0) +--- testing: '0' % 'abc' --- +Exception: Modulo by zero +--- testing: '0' % '123abc' --- +int(0) +--- testing: '0' % '123e5' --- +int(0) +--- testing: '0' % '123e5xyz' --- +int(0) +--- testing: '0' % ' 123abc' --- +int(0) +--- testing: '0' % '123 abc' --- +int(0) +--- testing: '0' % '123abc ' --- +int(0) +--- testing: '0' % '3.4a' --- +int(0) +--- testing: '0' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '65' % '0' --- +Exception: Modulo by zero +--- testing: '65' % '65' --- +int(0) +--- testing: '65' % '-44' --- +int(21) +--- testing: '65' % '1.2' --- +int(0) +--- testing: '65' % '-7.7' --- +int(2) +--- testing: '65' % 'abc' --- +Exception: Modulo by zero +--- testing: '65' % '123abc' --- +int(65) +--- testing: '65' % '123e5' --- +int(65) +--- testing: '65' % '123e5xyz' --- +int(65) +--- testing: '65' % ' 123abc' --- +int(65) +--- testing: '65' % '123 abc' --- +int(65) +--- testing: '65' % '123abc ' --- +int(65) +--- testing: '65' % '3.4a' --- +int(2) +--- testing: '65' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '-44' % '0' --- +Exception: Modulo by zero +--- testing: '-44' % '65' --- +int(-44) +--- testing: '-44' % '-44' --- +int(0) +--- testing: '-44' % '1.2' --- +int(0) +--- testing: '-44' % '-7.7' --- +int(-2) +--- testing: '-44' % 'abc' --- +Exception: Modulo by zero +--- testing: '-44' % '123abc' --- +int(-44) +--- testing: '-44' % '123e5' --- +int(-44) +--- testing: '-44' % '123e5xyz' --- +int(-44) +--- testing: '-44' % ' 123abc' --- +int(-44) +--- testing: '-44' % '123 abc' --- +int(-44) +--- testing: '-44' % '123abc ' --- +int(-44) +--- testing: '-44' % '3.4a' --- +int(-2) +--- testing: '-44' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '1.2' % '0' --- +Exception: Modulo by zero +--- testing: '1.2' % '65' --- +int(1) +--- testing: '1.2' % '-44' --- +int(1) +--- testing: '1.2' % '1.2' --- +int(0) +--- testing: '1.2' % '-7.7' --- +int(1) +--- testing: '1.2' % 'abc' --- +Exception: Modulo by zero +--- testing: '1.2' % '123abc' --- +int(1) +--- testing: '1.2' % '123e5' --- +int(1) +--- testing: '1.2' % '123e5xyz' --- +int(1) +--- testing: '1.2' % ' 123abc' --- +int(1) +--- testing: '1.2' % '123 abc' --- +int(1) +--- testing: '1.2' % '123abc ' --- +int(1) +--- testing: '1.2' % '3.4a' --- +int(1) +--- testing: '1.2' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '-7.7' % '0' --- +Exception: Modulo by zero +--- testing: '-7.7' % '65' --- +int(-7) +--- testing: '-7.7' % '-44' --- +int(-7) +--- testing: '-7.7' % '1.2' --- +int(0) +--- testing: '-7.7' % '-7.7' --- +int(0) +--- testing: '-7.7' % 'abc' --- +Exception: Modulo by zero +--- testing: '-7.7' % '123abc' --- +int(-7) +--- testing: '-7.7' % '123e5' --- +int(-7) +--- testing: '-7.7' % '123e5xyz' --- +int(-7) +--- testing: '-7.7' % ' 123abc' --- +int(-7) +--- testing: '-7.7' % '123 abc' --- +int(-7) +--- testing: '-7.7' % '123abc ' --- +int(-7) +--- testing: '-7.7' % '3.4a' --- +int(-1) +--- testing: '-7.7' % 'a5.9' --- +Exception: Modulo by zero +--- testing: 'abc' % '0' --- +Exception: Modulo by zero +--- testing: 'abc' % '65' --- +int(0) +--- testing: 'abc' % '-44' --- +int(0) +--- testing: 'abc' % '1.2' --- +int(0) +--- testing: 'abc' % '-7.7' --- +int(0) +--- testing: 'abc' % 'abc' --- +Exception: Modulo by zero +--- testing: 'abc' % '123abc' --- +int(0) +--- testing: 'abc' % '123e5' --- +int(0) +--- testing: 'abc' % '123e5xyz' --- +int(0) +--- testing: 'abc' % ' 123abc' --- +int(0) +--- testing: 'abc' % '123 abc' --- +int(0) +--- testing: 'abc' % '123abc ' --- +int(0) +--- testing: 'abc' % '3.4a' --- +int(0) +--- testing: 'abc' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '123abc' % '0' --- +Exception: Modulo by zero +--- testing: '123abc' % '65' --- +int(58) +--- testing: '123abc' % '-44' --- +int(35) +--- testing: '123abc' % '1.2' --- +int(0) +--- testing: '123abc' % '-7.7' --- +int(4) +--- testing: '123abc' % 'abc' --- +Exception: Modulo by zero +--- testing: '123abc' % '123abc' --- +int(0) +--- testing: '123abc' % '123e5' --- +int(123) +--- testing: '123abc' % '123e5xyz' --- +int(123) +--- testing: '123abc' % ' 123abc' --- +int(0) +--- testing: '123abc' % '123 abc' --- +int(0) +--- testing: '123abc' % '123abc ' --- +int(0) +--- testing: '123abc' % '3.4a' --- +int(0) +--- testing: '123abc' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '123e5' % '0' --- +Exception: Modulo by zero +--- testing: '123e5' % '65' --- +int(50) +--- testing: '123e5' % '-44' --- +int(20) +--- testing: '123e5' % '1.2' --- +int(0) +--- testing: '123e5' % '-7.7' --- +int(6) +--- testing: '123e5' % 'abc' --- +Exception: Modulo by zero +--- testing: '123e5' % '123abc' --- +int(0) +--- testing: '123e5' % '123e5' --- +int(0) +--- testing: '123e5' % '123e5xyz' --- +int(0) +--- testing: '123e5' % ' 123abc' --- +int(0) +--- testing: '123e5' % '123 abc' --- +int(0) +--- testing: '123e5' % '123abc ' --- +int(0) +--- testing: '123e5' % '3.4a' --- +int(0) +--- testing: '123e5' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '123e5xyz' % '0' --- +Exception: Modulo by zero +--- testing: '123e5xyz' % '65' --- +int(50) +--- testing: '123e5xyz' % '-44' --- +int(20) +--- testing: '123e5xyz' % '1.2' --- +int(0) +--- testing: '123e5xyz' % '-7.7' --- +int(6) +--- testing: '123e5xyz' % 'abc' --- +Exception: Modulo by zero +--- testing: '123e5xyz' % '123abc' --- +int(0) +--- testing: '123e5xyz' % '123e5' --- +int(0) +--- testing: '123e5xyz' % '123e5xyz' --- +int(0) +--- testing: '123e5xyz' % ' 123abc' --- +int(0) +--- testing: '123e5xyz' % '123 abc' --- +int(0) +--- testing: '123e5xyz' % '123abc ' --- +int(0) +--- testing: '123e5xyz' % '3.4a' --- +int(0) +--- testing: '123e5xyz' % 'a5.9' --- +Exception: Modulo by zero +--- testing: ' 123abc' % '0' --- +Exception: Modulo by zero +--- testing: ' 123abc' % '65' --- +int(58) +--- testing: ' 123abc' % '-44' --- +int(35) +--- testing: ' 123abc' % '1.2' --- +int(0) +--- testing: ' 123abc' % '-7.7' --- +int(4) +--- testing: ' 123abc' % 'abc' --- +Exception: Modulo by zero +--- testing: ' 123abc' % '123abc' --- +int(0) +--- testing: ' 123abc' % '123e5' --- +int(123) +--- testing: ' 123abc' % '123e5xyz' --- +int(123) +--- testing: ' 123abc' % ' 123abc' --- +int(0) +--- testing: ' 123abc' % '123 abc' --- +int(0) +--- testing: ' 123abc' % '123abc ' --- +int(0) +--- testing: ' 123abc' % '3.4a' --- +int(0) +--- testing: ' 123abc' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '123 abc' % '0' --- +Exception: Modulo by zero +--- testing: '123 abc' % '65' --- +int(58) +--- testing: '123 abc' % '-44' --- +int(35) +--- testing: '123 abc' % '1.2' --- +int(0) +--- testing: '123 abc' % '-7.7' --- +int(4) +--- testing: '123 abc' % 'abc' --- +Exception: Modulo by zero +--- testing: '123 abc' % '123abc' --- +int(0) +--- testing: '123 abc' % '123e5' --- +int(123) +--- testing: '123 abc' % '123e5xyz' --- +int(123) +--- testing: '123 abc' % ' 123abc' --- +int(0) +--- testing: '123 abc' % '123 abc' --- +int(0) +--- testing: '123 abc' % '123abc ' --- +int(0) +--- testing: '123 abc' % '3.4a' --- +int(0) +--- testing: '123 abc' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '123abc ' % '0' --- +Exception: Modulo by zero +--- testing: '123abc ' % '65' --- +int(58) +--- testing: '123abc ' % '-44' --- +int(35) +--- testing: '123abc ' % '1.2' --- +int(0) +--- testing: '123abc ' % '-7.7' --- +int(4) +--- testing: '123abc ' % 'abc' --- +Exception: Modulo by zero +--- testing: '123abc ' % '123abc' --- +int(0) +--- testing: '123abc ' % '123e5' --- +int(123) +--- testing: '123abc ' % '123e5xyz' --- +int(123) +--- testing: '123abc ' % ' 123abc' --- +int(0) +--- testing: '123abc ' % '123 abc' --- +int(0) +--- testing: '123abc ' % '123abc ' --- +int(0) +--- testing: '123abc ' % '3.4a' --- +int(0) +--- testing: '123abc ' % 'a5.9' --- +Exception: Modulo by zero +--- testing: '3.4a' % '0' --- +Exception: Modulo by zero +--- testing: '3.4a' % '65' --- +int(3) +--- testing: '3.4a' % '-44' --- +int(3) +--- testing: '3.4a' % '1.2' --- +int(0) +--- testing: '3.4a' % '-7.7' --- +int(3) +--- testing: '3.4a' % 'abc' --- +Exception: Modulo by zero +--- testing: '3.4a' % '123abc' --- +int(3) +--- testing: '3.4a' % '123e5' --- +int(3) +--- testing: '3.4a' % '123e5xyz' --- +int(3) +--- testing: '3.4a' % ' 123abc' --- +int(3) +--- testing: '3.4a' % '123 abc' --- +int(3) +--- testing: '3.4a' % '123abc ' --- +int(3) +--- testing: '3.4a' % '3.4a' --- +int(0) +--- testing: '3.4a' % 'a5.9' --- +Exception: Modulo by zero +--- testing: 'a5.9' % '0' --- +Exception: Modulo by zero +--- testing: 'a5.9' % '65' --- +int(0) +--- testing: 'a5.9' % '-44' --- +int(0) +--- testing: 'a5.9' % '1.2' --- +int(0) +--- testing: 'a5.9' % '-7.7' --- +int(0) +--- testing: 'a5.9' % 'abc' --- +Exception: Modulo by zero +--- testing: 'a5.9' % '123abc' --- +int(0) +--- testing: 'a5.9' % '123e5' --- +int(0) +--- testing: 'a5.9' % '123e5xyz' --- +int(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' --- +int(0) +--- testing: 'a5.9' % 'a5.9' --- +Exception: Modulo by zero +===DONE=== diff --git a/tests/lang/operators/multiply_basiclong_64bit.phpt b/tests/lang/operators/multiply_basiclong_64bit.phpt index 4c7077bf3b9..31d9188a775 100644 --- a/tests/lang/operators/multiply_basiclong_64bit.phpt +++ b/tests/lang/operators/multiply_basiclong_64bit.phpt @@ -1,44 +1,44 @@ ---TEST-- -Test * operator : 64bit long tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test * operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- --- testing: 9223372036854775807 * 0 --- int(0) --- testing: 9223372036854775807 * 1 --- @@ -578,5 +578,5 @@ float(8.5070591730235E+37) --- testing: 9223372036854775807 * -9223372036854775807 --- float(-8.5070591730235E+37) --- testing: 9223372036854775807 * -9.2233720368548E+18 --- -float(-8.5070591730235E+37) -===DONE=== +float(-8.5070591730235E+37) +===DONE=== diff --git a/tests/lang/operators/multiply_variationStr.phpt b/tests/lang/operators/multiply_variationStr.phpt index 30d5f79f1a3..01d7e050749 100644 --- a/tests/lang/operators/multiply_variationStr.phpt +++ b/tests/lang/operators/multiply_variationStr.phpt @@ -1,26 +1,26 @@ ---TEST-- -Test * operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test * operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- --- testing: '0' * '0' --- int(0) --- testing: '0' * '65' --- @@ -412,5 +412,5 @@ int(0) --- testing: 'a5.9' * '3.4a' --- float(0) --- testing: 'a5.9' * 'a5.9' --- -int(0) -===DONE=== +int(0) +===DONE=== diff --git a/tests/lang/operators/negate_basiclong_64bit.phpt b/tests/lang/operators/negate_basiclong_64bit.phpt index e0cf10da69d..47b25e5397b 100644 --- a/tests/lang/operators/negate_basiclong_64bit.phpt +++ b/tests/lang/operators/negate_basiclong_64bit.phpt @@ -1,32 +1,32 @@ ---TEST-- -Test -N operator : 64bit long tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test -N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- --- testing: 9223372036854775807 --- int(-9223372036854775807) --- testing: -9223372036854775808 --- @@ -56,5 +56,5 @@ float(-9.2233720368548E+18) --- testing: -9223372036854775807 --- int(9223372036854775807) --- testing: -9.2233720368548E+18 --- -float(9.2233720368548E+18) -===DONE=== +float(9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/negate_variationStr.phpt b/tests/lang/operators/negate_variationStr.phpt index 7405d42882e..ccff2fba2c2 100644 --- a/tests/lang/operators/negate_variationStr.phpt +++ b/tests/lang/operators/negate_variationStr.phpt @@ -1,22 +1,22 @@ ---TEST-- -Test -N operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECTF-- +--TEST-- +Test -N operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECTF-- --- testing: '0' --- int(0) --- testing: '65' --- @@ -60,5 +60,5 @@ float(-3.4) --- testing: 'a5.9' --- Warning: A non-numeric value encountered in %s on line %d -int(0) -===DONE=== +int(0) +===DONE=== diff --git a/tests/lang/operators/operator_equals_basic.phpt b/tests/lang/operators/operator_equals_basic.phpt index 3cb2704444e..9de4ed1a2aa 100644 --- a/tests/lang/operators/operator_equals_basic.phpt +++ b/tests/lang/operators/operator_equals_basic.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test == operator : different types ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test == operator : different types +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_equals_variation.phpt b/tests/lang/operators/operator_equals_variation.phpt index f7dc32868cf..d72253404b6 100644 --- a/tests/lang/operators/operator_equals_variation.phpt +++ b/tests/lang/operators/operator_equals_variation.phpt @@ -1,63 +1,63 @@ ---TEST-- -Test == operator : max int 32bit range ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test == operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +===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 6329225fcc4..ada6c2d7ecc 100644 --- a/tests/lang/operators/operator_equals_variation_64bit.phpt +++ b/tests/lang/operators/operator_equals_variation_64bit.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test == operator : max int 64bit range ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test == operator : max int 64bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_gt_basic.phpt b/tests/lang/operators/operator_gt_basic.phpt index c410b19dc86..db856c62e65 100644 --- a/tests/lang/operators/operator_gt_basic.phpt +++ b/tests/lang/operators/operator_gt_basic.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test > operator : different types ---FILE-- - true for example -// also note that a string of "0" is converted to false but a string of "0.0" is converted to true -// false cannot be tested as 0 can never be > 0 or 1 - true, $valid_false, $valid_true, - $int1, $valid_int1, $invalid_int1, - $int2, $valid_int2, $invalid_int2, - $float1, $valid_float1, $invalid_float1, - $float2, $valid_float2, $invalid_float2 -); - -$failed = false; -for ($i = 0; $i < count($toCompare); $i +=3) { - $typeToTest = $toCompare[$i]; - $valid_compares = $toCompare[$i + 1]; - $invalid_compares = $toCompare[$i + 2]; - - foreach($valid_compares as $compareVal) { - if ($typeToTest > $compareVal) { - // do nothing - } - else { - echo "FAILED: '$typeToTest' <= '$compareVal'\n"; - $failed = true; - } - } - - foreach($invalid_compares as $compareVal) { - if ($typeToTest > $compareVal) { - echo "FAILED: '$typeToTest' > '$compareVal'\n"; - $failed = true; - } - } - -} -if ($failed == false) { - echo "Test Passed\n"; -} -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test > operator : different types +--FILE-- + true for example +// also note that a string of "0" is converted to false but a string of "0.0" is converted to true +// false cannot be tested as 0 can never be > 0 or 1 + true, $valid_false, $valid_true, + $int1, $valid_int1, $invalid_int1, + $int2, $valid_int2, $invalid_int2, + $float1, $valid_float1, $invalid_float1, + $float2, $valid_float2, $invalid_float2 +); + +$failed = false; +for ($i = 0; $i < count($toCompare); $i +=3) { + $typeToTest = $toCompare[$i]; + $valid_compares = $toCompare[$i + 1]; + $invalid_compares = $toCompare[$i + 2]; + + foreach($valid_compares as $compareVal) { + if ($typeToTest > $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTest' <= '$compareVal'\n"; + $failed = true; + } + } + + foreach($invalid_compares as $compareVal) { + if ($typeToTest > $compareVal) { + echo "FAILED: '$typeToTest' > '$compareVal'\n"; + $failed = true; + } + } + +} +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 20b00df8bbc..f1b1e01048b 100644 --- a/tests/lang/operators/operator_gt_or_equal_basic.phpt +++ b/tests/lang/operators/operator_gt_or_equal_basic.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test >= operator : different types ---FILE-- -= $compareVal) { - // do nothing - } - else { - echo "FAILED: '$typeToTest' < '$compareVal'\n"; - $failed = true; - } - } - - if ($invalid_compares != NULL) { - foreach($invalid_compares as $compareVal) { - if ($typeToTest >= $compareVal) { - echo "FAILED: '$typeToTest' >= '$compareVal'\n"; - $failed = true; - } - } - } - -} -if ($failed == false) { - echo "Test Passed\n"; -} -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test >= operator : different types +--FILE-- += $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTest' < '$compareVal'\n"; + $failed = true; + } + } + + if ($invalid_compares != NULL) { + foreach($invalid_compares as $compareVal) { + if ($typeToTest >= $compareVal) { + echo "FAILED: '$typeToTest' >= '$compareVal'\n"; + $failed = true; + } + } + } + +} +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 6cb6ed6d81c..2355ab4c45a 100644 --- a/tests/lang/operators/operator_gt_or_equal_variation.phpt +++ b/tests/lang/operators/operator_gt_or_equal_variation.phpt @@ -1,63 +1,63 @@ ---TEST-- -Test >= operator : max int 32bit range ---SKIPIF-- - ---FILE-- -= $compareVal) { - // do nothing - } - else { - echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; - $failed = true; - } - } -} -// test for invalid values -for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) { - $typeToTestVal = $invalidGtOrEqual[$i]; - $compares = $invalidGtOrEqual[$i + 1]; - foreach($compares as $compareVal) { - if ($typeToTestVal >= $compareVal) { - echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; - $failed = true; - } - } -} - -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test >= operator : max int 32bit range +--SKIPIF-- + +--FILE-- += $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) { + $typeToTestVal = $invalidGtOrEqual[$i]; + $compares = $invalidGtOrEqual[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal >= $compareVal) { + echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===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 52ef7100a60..8a1ed35f109 100644 --- a/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt +++ b/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt @@ -1,63 +1,63 @@ ---TEST-- -Test >= operator : max int 64bit range ---SKIPIF-- - ---FILE-- -= $compareVal) { - // do nothing - } - else { - echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; - $failed = true; - } - } -} -// test for invalid values -for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) { - $typeToTestVal = $invalidGtOrEqual[$i]; - $compares = $invalidGtOrEqual[$i + 1]; - foreach($compares as $compareVal) { - if ($typeToTestVal >= $compareVal) { - echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; - $failed = true; - } - } -} - -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test >= operator : max int 64bit range +--SKIPIF-- + +--FILE-- += $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) { + $typeToTestVal = $invalidGtOrEqual[$i]; + $compares = $invalidGtOrEqual[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal >= $compareVal) { + echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_gt_variation.phpt b/tests/lang/operators/operator_gt_variation.phpt index 1b429a076f3..ff15550dbe2 100644 --- a/tests/lang/operators/operator_gt_variation.phpt +++ b/tests/lang/operators/operator_gt_variation.phpt @@ -1,62 +1,62 @@ ---TEST-- -Test > operator : max int 32bit range ---SKIPIF-- - ---FILE-- - $compareVal) { - // do nothing - } - else { - echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; - $failed = true; - } - } -} -// test for invalid values -for ($i = 0; $i < count($invalidGreaterThan); $i +=2) { - $typeToTestVal = $invalidGreaterThan[$i]; - $compares = $invalidGreaterThan[$i + 1]; - foreach($compares as $compareVal) { - if ($typeToTestVal > $compareVal) { - echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; - $failed = true; - } - } -} - -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test > operator : max int 32bit range +--SKIPIF-- + +--FILE-- + $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidGreaterThan); $i +=2) { + $typeToTestVal = $invalidGreaterThan[$i]; + $compares = $invalidGreaterThan[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal > $compareVal) { + echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===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 1881567080a..15c6b88319f 100644 --- a/tests/lang/operators/operator_gt_variation_64bit.phpt +++ b/tests/lang/operators/operator_gt_variation_64bit.phpt @@ -1,62 +1,62 @@ ---TEST-- -Test > operator : max int 64bit range ---SKIPIF-- - ---FILE-- - $compareVal) { - // do nothing - } - else { - echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; - $failed = true; - } - } -} -// test for invalid values -for ($i = 0; $i < count($invalidGreaterThan); $i +=2) { - $typeToTestVal = $invalidGreaterThan[$i]; - $compares = $invalidGreaterThan[$i + 1]; - foreach($compares as $compareVal) { - if ($typeToTestVal > $compareVal) { - echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; - $failed = true; - } - } -} - -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test > operator : max int 64bit range +--SKIPIF-- + +--FILE-- + $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidGreaterThan); $i +=2) { + $typeToTestVal = $invalidGreaterThan[$i]; + $compares = $invalidGreaterThan[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal > $compareVal) { + echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_identical_basic.phpt b/tests/lang/operators/operator_identical_basic.phpt index dbf4c62f5b0..e3a0fe272fc 100644 --- a/tests/lang/operators/operator_identical_basic.phpt +++ b/tests/lang/operators/operator_identical_basic.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test === operator : different types ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test === operator : different types +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_identical_variation.phpt b/tests/lang/operators/operator_identical_variation.phpt index f2150e956dc..a215fef0a44 100644 --- a/tests/lang/operators/operator_identical_variation.phpt +++ b/tests/lang/operators/operator_identical_variation.phpt @@ -1,63 +1,63 @@ ---TEST-- -Test === operator : max int 32bit range ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test === operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +===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 138a53a1191..0c8d398dafa 100644 --- a/tests/lang/operators/operator_identical_variation_64bit.phpt +++ b/tests/lang/operators/operator_identical_variation_64bit.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test === operator : max int 64bit range ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test === operator : max int 64bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_lt_basic.phpt b/tests/lang/operators/operator_lt_basic.phpt index 016b35dd4b2..41f18ef9d23 100644 --- a/tests/lang/operators/operator_lt_basic.phpt +++ b/tests/lang/operators/operator_lt_basic.phpt @@ -1,62 +1,62 @@ ---TEST-- -Test < operator : different types ---FILE-- -= '$compareVal'\n"; - $failed = true; - } - } - - foreach($invalid_compares as $compareVal) { - if ($typeToTest < $compareVal) { - echo "FAILED: '$typeToTest' < '$compareVal'\n"; - $failed = true; - } - } - -} -if ($failed == false) { - echo "Test Passed\n"; -} -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test < operator : different types +--FILE-- += '$compareVal'\n"; + $failed = true; + } + } + + foreach($invalid_compares as $compareVal) { + if ($typeToTest < $compareVal) { + echo "FAILED: '$typeToTest' < '$compareVal'\n"; + $failed = true; + } + } + +} +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 785b9338acc..85a86e19965 100644 --- a/tests/lang/operators/operator_lt_or_equal_basic.phpt +++ b/tests/lang/operators/operator_lt_or_equal_basic.phpt @@ -1,64 +1,64 @@ ---TEST-- -Test <= operator : different types ---FILE-- - '$compareVal'\n"; - $failed = true; - } - } - - if ($invalid_compares != NULL) { - foreach($invalid_compares as $compareVal) { - if ($typeToTest <= $compareVal) { - echo "FAILED: '$typeToTest' <= '$compareVal'\n"; - $failed = true; - } - } - } - -} -if ($failed == false) { - echo "Test Passed\n"; -} -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test <= operator : different types +--FILE-- + '$compareVal'\n"; + $failed = true; + } + } + + if ($invalid_compares != NULL) { + foreach($invalid_compares as $compareVal) { + if ($typeToTest <= $compareVal) { + echo "FAILED: '$typeToTest' <= '$compareVal'\n"; + $failed = true; + } + } + } + +} +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 293205876df..5724511a0e6 100644 --- a/tests/lang/operators/operator_lt_or_equal_variation.phpt +++ b/tests/lang/operators/operator_lt_or_equal_variation.phpt @@ -1,63 +1,63 @@ ---TEST-- -Test <= operator : max int 32bit range ---SKIPIF-- - ---FILE-- - '$compareVal'\n"; - $failed = true; - } - } -} -// test invalid values -for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) { - $typeToTestVal = $invalidLtOrEqual[$i]; - $compares = $invalidLtOrEqual[$i + 1]; - foreach($compares as $compareVal) { - if ($typeToTestVal <= $compareVal) { - echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; - $failed = true; - } - } -} - -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test <= operator : max int 32bit range +--SKIPIF-- + +--FILE-- + '$compareVal'\n"; + $failed = true; + } + } +} +// test invalid values +for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) { + $typeToTestVal = $invalidLtOrEqual[$i]; + $compares = $invalidLtOrEqual[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal <= $compareVal) { + echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===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 055cfc673b7..f3b16c1fc91 100644 --- a/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt +++ b/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt @@ -1,63 +1,63 @@ ---TEST-- -Test <= operator : max int 64bit range ---SKIPIF-- - ---FILE-- - '$compareVal'\n"; - $failed = true; - } - } -} -// test invalid values -for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) { - $typeToTestVal = $invalidLtOrEqual[$i]; - $compares = $invalidLtOrEqual[$i + 1]; - foreach($compares as $compareVal) { - if ($typeToTestVal <= $compareVal) { - echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; - $failed = true; - } - } -} - -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test <= operator : max int 64bit range +--SKIPIF-- + +--FILE-- + '$compareVal'\n"; + $failed = true; + } + } +} +// test invalid values +for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) { + $typeToTestVal = $invalidLtOrEqual[$i]; + $compares = $invalidLtOrEqual[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal <= $compareVal) { + echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_lt_variation.phpt b/tests/lang/operators/operator_lt_variation.phpt index 62fedfad5a8..4f468638dcd 100644 --- a/tests/lang/operators/operator_lt_variation.phpt +++ b/tests/lang/operators/operator_lt_variation.phpt @@ -1,60 +1,60 @@ ---TEST-- -Test < operator : max int 32bit range ---SKIPIF-- - ---FILE-- -= '$compareVal'\n"; - $failed = true; - } - } -} -// test for invalid values -for ($i = 0; $i < count($invalidLessThan); $i +=2) { - $typeToTestVal = $invalidLessThan[$i]; - $compares = $invalidLessThan[$i + 1]; - foreach($compares as $compareVal) { - if ($typeToTestVal < $compareVal) { - echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; - $failed = true; - } - } -} - -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test < operator : max int 32bit range +--SKIPIF-- + +--FILE-- += '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidLessThan); $i +=2) { + $typeToTestVal = $invalidLessThan[$i]; + $compares = $invalidLessThan[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal < $compareVal) { + echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===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 e6f16a3883b..3ee274aea0c 100644 --- a/tests/lang/operators/operator_lt_variation_64bit.phpt +++ b/tests/lang/operators/operator_lt_variation_64bit.phpt @@ -1,60 +1,60 @@ ---TEST-- -Test < operator : max int 64bit range ---SKIPIF-- - ---FILE-- -= '$compareVal'\n"; - $failed = true; - } - } -} -// test for invalid values -for ($i = 0; $i < count($invalidLessThan); $i +=2) { - $typeToTestVal = $invalidLessThan[$i]; - $compares = $invalidLessThan[$i + 1]; - foreach($compares as $compareVal) { - if ($typeToTestVal < $compareVal) { - echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; - $failed = true; - } - } -} - -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test < operator : max int 64bit range +--SKIPIF-- + +--FILE-- += '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidLessThan); $i +=2) { + $typeToTestVal = $invalidLessThan[$i]; + $compares = $invalidLessThan[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal < $compareVal) { + echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_notequals_basic.phpt b/tests/lang/operators/operator_notequals_basic.phpt index 80754dacb4b..cef0be62790 100644 --- a/tests/lang/operators/operator_notequals_basic.phpt +++ b/tests/lang/operators/operator_notequals_basic.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test != operator : different types ---FILE-- - $compareVal) { - // do nothing - } - else { - echo "FAILED: '$typeToTest' == '$compareVal'\n"; - $failed = true; - } - } - - foreach($invalid_compares as $compareVal) { - if ($typeToTest != $compareVal || $typeToTest <> $compareVal) { - echo "FAILED: '$typeToTest' != '$compareVal'\n"; - $failed = true; - } - } - -} -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test != operator : different types +--FILE-- + $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTest' == '$compareVal'\n"; + $failed = true; + } + } + + foreach($invalid_compares as $compareVal) { + if ($typeToTest != $compareVal || $typeToTest <> $compareVal) { + echo "FAILED: '$typeToTest' != '$compareVal'\n"; + $failed = true; + } + } + +} +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_notequals_variation.phpt b/tests/lang/operators/operator_notequals_variation.phpt index 2a0b57035dd..25bbfc58598 100644 --- a/tests/lang/operators/operator_notequals_variation.phpt +++ b/tests/lang/operators/operator_notequals_variation.phpt @@ -1,63 +1,63 @@ ---TEST-- -Test != operator : max int 32bit range ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test != operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +===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 16ec925cb89..6fbc496fa5c 100644 --- a/tests/lang/operators/operator_notequals_variation_64bit.phpt +++ b/tests/lang/operators/operator_notequals_variation_64bit.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test == operator : max int 64bit range ---SKIPIF-- - ---FILE-- - $compareVal) { - // do nothing - } - else { - echo "FAILED: '$typeToTestVal' == '$compareVal'\n"; - $failed = true; - } - } -} -// test invalid values -for ($i = 0; $i < count($invalidNotEquals); $i +=2) { - $typeToTestVal = $invalidNotEquals[$i]; - $compares = $invalidNotEquals[$i + 1]; - foreach($compares as $compareVal) { - if ($typeToTestVal != $compareVal || $typeToTestVal <> $compareVal) { - echo "FAILED: '$typeToTestVal' != '$compareVal'\n"; - $failed = true; - } - } -} - -if ($failed == false) { - echo "Test Passed\n"; -} - -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test == operator : max int 64bit range +--SKIPIF-- + +--FILE-- + $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' == '$compareVal'\n"; + $failed = true; + } + } +} +// test invalid values +for ($i = 0; $i < count($invalidNotEquals); $i +=2) { + $typeToTestVal = $invalidNotEquals[$i]; + $compares = $invalidNotEquals[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal != $compareVal || $typeToTestVal <> $compareVal) { + echo "FAILED: '$typeToTestVal' != '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_notidentical_basic.phpt b/tests/lang/operators/operator_notidentical_basic.phpt index 143d72038b5..9f21ea4bcaf 100644 --- a/tests/lang/operators/operator_notidentical_basic.phpt +++ b/tests/lang/operators/operator_notidentical_basic.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test !== operator : different types ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test !== operator : different types +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_notidentical_variation.phpt b/tests/lang/operators/operator_notidentical_variation.phpt index 702797ec8d6..a9fbcf60e10 100644 --- a/tests/lang/operators/operator_notidentical_variation.phpt +++ b/tests/lang/operators/operator_notidentical_variation.phpt @@ -1,64 +1,64 @@ ---TEST-- -Test !== operator : max int 32bit range ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test !== operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +===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 8a60cfdbb45..aa5aab7a59c 100644 --- a/tests/lang/operators/operator_notidentical_variation_64bit.phpt +++ b/tests/lang/operators/operator_notidentical_variation_64bit.phpt @@ -1,65 +1,65 @@ ---TEST-- -Test !== operator : max int 64bit range ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test !== operator : max int 64bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/operator_spaceship_basic.phpt b/tests/lang/operators/operator_spaceship_basic.phpt index 3dbdbb41978..81b05167574 100644 --- a/tests/lang/operators/operator_spaceship_basic.phpt +++ b/tests/lang/operators/operator_spaceship_basic.phpt @@ -1,94 +1,94 @@ ---TEST-- -Test <=> operator : different types ---FILE-- - true for example -// also note that a string of "0" is converted to false but a string of "0.0" is converted to true -// false cannot be tested as 0 can never be > 0 or 1 - true, $valid_false, $valid_true, - $int1, $valid_int1, $invalid_int1, - $int2, $valid_int2, $invalid_int2, - $float1, $valid_float1, $invalid_float1, - $float2, $valid_float2, $invalid_float2 -); - -$failed = false; -for ($i = 0; $i < count($toCompare); $i +=3) { - $typeToTest = $toCompare[$i]; - $valid_compares = $toCompare[$i + 1]; - $invalid_compares = $toCompare[$i + 2]; - - foreach($valid_compares as $compareVal) { - if (($typeToTest <=> $compareVal) === 1) { - // do nothing - } - else { - echo "FAILED: ('$typeToTest' <=> '$compareVal') !== 1\n"; - $failed = true; - } - if (($compareVal <=> $typeToTest) === -1) { - // do nothing - } - else { - echo "FAILED: ('$compareVal' <=> '$typeToTest') !== -1\n"; - $failed = true; - } - if (($compareVal <=> $compareVal) === 0) { - // do nothing - } - else { - echo "FAILED: ('$compareVal' <=> '$compareVal') !== 0\n"; - $failed = true; - } - } - - foreach($invalid_compares as $compareVal) { - if (($typeToTest <=> $compareVal) === 1) { - echo "FAILED: ('$typeToTest' <=> '$compareVal') === 1\n"; - $failed = true; - } - if (($compareVal <=> $typeToTest) === -1) { - echo "FAILED: ('$compareVal' <=> '$typeToTest') === -1\n"; - $failed = true; - } - if (($compareVal <=> $compareVal) !== 0) { - echo "FAILED: ('$compareVal' <=> '$compareVal') !== 0\n"; - $failed = true; - } - } - - if (($typeToTest <=> $typeToTest) === 0) { - // do nothing - } - else { - echo "FAILED: ('$typeToTest' <=> '$typeToTest') !== 0\n"; - $failed = true; - } -} -if ($failed == false) { - echo "Test Passed\n"; -} -?> -===DONE=== ---EXPECT-- -Test Passed +--TEST-- +Test <=> operator : different types +--FILE-- + true for example +// also note that a string of "0" is converted to false but a string of "0.0" is converted to true +// false cannot be tested as 0 can never be > 0 or 1 + true, $valid_false, $valid_true, + $int1, $valid_int1, $invalid_int1, + $int2, $valid_int2, $invalid_int2, + $float1, $valid_float1, $invalid_float1, + $float2, $valid_float2, $invalid_float2 +); + +$failed = false; +for ($i = 0; $i < count($toCompare); $i +=3) { + $typeToTest = $toCompare[$i]; + $valid_compares = $toCompare[$i + 1]; + $invalid_compares = $toCompare[$i + 2]; + + foreach($valid_compares as $compareVal) { + if (($typeToTest <=> $compareVal) === 1) { + // do nothing + } + else { + echo "FAILED: ('$typeToTest' <=> '$compareVal') !== 1\n"; + $failed = true; + } + if (($compareVal <=> $typeToTest) === -1) { + // do nothing + } + else { + echo "FAILED: ('$compareVal' <=> '$typeToTest') !== -1\n"; + $failed = true; + } + if (($compareVal <=> $compareVal) === 0) { + // do nothing + } + else { + echo "FAILED: ('$compareVal' <=> '$compareVal') !== 0\n"; + $failed = true; + } + } + + foreach($invalid_compares as $compareVal) { + if (($typeToTest <=> $compareVal) === 1) { + echo "FAILED: ('$typeToTest' <=> '$compareVal') === 1\n"; + $failed = true; + } + if (($compareVal <=> $typeToTest) === -1) { + echo "FAILED: ('$compareVal' <=> '$typeToTest') === -1\n"; + $failed = true; + } + if (($compareVal <=> $compareVal) !== 0) { + echo "FAILED: ('$compareVal' <=> '$compareVal') !== 0\n"; + $failed = true; + } + } + + if (($typeToTest <=> $typeToTest) === 0) { + // do nothing + } + else { + echo "FAILED: ('$typeToTest' <=> '$typeToTest') !== 0\n"; + $failed = true; + } +} +if ($failed == false) { + echo "Test Passed\n"; +} +?> +===DONE=== +--EXPECT-- +Test Passed ===DONE=== diff --git a/tests/lang/operators/postdec_basiclong_64bit.phpt b/tests/lang/operators/postdec_basiclong_64bit.phpt index 9875df85ae6..f3e825ca3d1 100644 --- a/tests/lang/operators/postdec_basiclong_64bit.phpt +++ b/tests/lang/operators/postdec_basiclong_64bit.phpt @@ -1,61 +1,61 @@ ---TEST-- -Test N-- operator : 64bit long tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- ---- testing: 9223372036854775807 --- -int(9223372036854775806) ---- testing: -9223372036854775808 --- -float(-9.2233720368548E+18) ---- testing: 2147483647 --- -int(2147483646) ---- testing: -2147483648 --- -int(-2147483649) ---- testing: 9223372034707292160 --- -int(9223372034707292159) ---- testing: -9223372034707292160 --- -int(-9223372034707292161) ---- testing: 2147483648 --- -int(2147483647) ---- testing: -2147483649 --- -int(-2147483650) ---- testing: 4294967294 --- -int(4294967293) ---- testing: 4294967295 --- -int(4294967294) ---- testing: 4294967293 --- -int(4294967292) ---- testing: 9223372036854775806 --- -int(9223372036854775805) ---- testing: 9.2233720368548E+18 --- -float(9.2233720368548E+18) ---- testing: -9223372036854775807 --- -int(-9223372036854775808) ---- testing: -9.2233720368548E+18 --- -float(-9.2233720368548E+18) -===DONE=== +--TEST-- +Test N-- operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 --- +int(9223372036854775806) +--- testing: -9223372036854775808 --- +float(-9.2233720368548E+18) +--- testing: 2147483647 --- +int(2147483646) +--- testing: -2147483648 --- +int(-2147483649) +--- testing: 9223372034707292160 --- +int(9223372034707292159) +--- testing: -9223372034707292160 --- +int(-9223372034707292161) +--- testing: 2147483648 --- +int(2147483647) +--- testing: -2147483649 --- +int(-2147483650) +--- testing: 4294967294 --- +int(4294967293) +--- testing: 4294967295 --- +int(4294967294) +--- testing: 4294967293 --- +int(4294967292) +--- testing: 9223372036854775806 --- +int(9223372036854775805) +--- testing: 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775807 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/postdec_variationStr.phpt b/tests/lang/operators/postdec_variationStr.phpt index ee5a8cd4b72..0db326d27e6 100644 --- a/tests/lang/operators/postdec_variationStr.phpt +++ b/tests/lang/operators/postdec_variationStr.phpt @@ -1,49 +1,49 @@ ---TEST-- -Test N-- operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- ---- testing: '0' --- -int(-1) ---- testing: '65' --- -int(64) ---- testing: '-44' --- -int(-45) ---- testing: '1.2' --- -float(0.2) ---- testing: '-7.7' --- -float(-8.7) ---- testing: 'abc' --- -string(3) "abc" ---- testing: '123abc' --- -string(6) "123abc" ---- testing: '123e5' --- -float(12299999) ---- testing: '123e5xyz' --- -string(8) "123e5xyz" ---- testing: ' 123abc' --- -string(7) " 123abc" ---- testing: '123 abc' --- -string(7) "123 abc" ---- testing: '123abc ' --- -string(7) "123abc " ---- testing: '3.4a' --- -string(4) "3.4a" ---- testing: 'a5.9' --- -string(4) "a5.9" -===DONE=== +--TEST-- +Test N-- operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' --- +int(-1) +--- testing: '65' --- +int(64) +--- testing: '-44' --- +int(-45) +--- testing: '1.2' --- +float(0.2) +--- testing: '-7.7' --- +float(-8.7) +--- testing: 'abc' --- +string(3) "abc" +--- testing: '123abc' --- +string(6) "123abc" +--- testing: '123e5' --- +float(12299999) +--- testing: '123e5xyz' --- +string(8) "123e5xyz" +--- testing: ' 123abc' --- +string(7) " 123abc" +--- testing: '123 abc' --- +string(7) "123 abc" +--- testing: '123abc ' --- +string(7) "123abc " +--- testing: '3.4a' --- +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 494259acd86..18e8bddedd6 100644 --- a/tests/lang/operators/postinc_basiclong_64bit.phpt +++ b/tests/lang/operators/postinc_basiclong_64bit.phpt @@ -1,61 +1,61 @@ ---TEST-- -Test N++ operator : 64bit long tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- ---- testing: 9223372036854775807 --- -float(9.2233720368548E+18) ---- testing: -9223372036854775808 --- -int(-9223372036854775807) ---- testing: 2147483647 --- -int(2147483648) ---- testing: -2147483648 --- -int(-2147483647) ---- testing: 9223372034707292160 --- -int(9223372034707292161) ---- testing: -9223372034707292160 --- -int(-9223372034707292159) ---- testing: 2147483648 --- -int(2147483649) ---- testing: -2147483649 --- -int(-2147483648) ---- testing: 4294967294 --- -int(4294967295) ---- testing: 4294967295 --- -int(4294967296) ---- testing: 4294967293 --- -int(4294967294) ---- testing: 9223372036854775806 --- -int(9223372036854775807) ---- testing: 9.2233720368548E+18 --- -float(9.2233720368548E+18) ---- testing: -9223372036854775807 --- -int(-9223372036854775806) ---- testing: -9.2233720368548E+18 --- -float(-9.2233720368548E+18) -===DONE=== +--TEST-- +Test N++ operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775808 --- +int(-9223372036854775807) +--- testing: 2147483647 --- +int(2147483648) +--- testing: -2147483648 --- +int(-2147483647) +--- testing: 9223372034707292160 --- +int(9223372034707292161) +--- testing: -9223372034707292160 --- +int(-9223372034707292159) +--- testing: 2147483648 --- +int(2147483649) +--- testing: -2147483649 --- +int(-2147483648) +--- testing: 4294967294 --- +int(4294967295) +--- testing: 4294967295 --- +int(4294967296) +--- testing: 4294967293 --- +int(4294967294) +--- testing: 9223372036854775806 --- +int(9223372036854775807) +--- testing: 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775807 --- +int(-9223372036854775806) +--- testing: -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/postinc_variationStr.phpt b/tests/lang/operators/postinc_variationStr.phpt index 6fbe8043193..35e19888e18 100644 --- a/tests/lang/operators/postinc_variationStr.phpt +++ b/tests/lang/operators/postinc_variationStr.phpt @@ -1,49 +1,49 @@ ---TEST-- -Test N++ operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- ---- testing: '0' --- -int(1) ---- testing: '65' --- -int(66) ---- testing: '-44' --- -int(-43) ---- testing: '1.2' --- -float(2.2) ---- testing: '-7.7' --- -float(-6.7) ---- testing: 'abc' --- -string(3) "abd" ---- testing: '123abc' --- -string(6) "123abd" ---- testing: '123e5' --- -float(12300001) ---- testing: '123e5xyz' --- -string(8) "123e5xza" ---- testing: ' 123abc' --- -string(7) " 123abd" ---- testing: '123 abc' --- -string(7) "123 abd" ---- testing: '123abc ' --- -string(7) "123abc " ---- testing: '3.4a' --- -string(4) "3.4b" ---- testing: 'a5.9' --- -string(4) "a5.0" -===DONE=== +--TEST-- +Test N++ operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' --- +int(1) +--- testing: '65' --- +int(66) +--- testing: '-44' --- +int(-43) +--- testing: '1.2' --- +float(2.2) +--- testing: '-7.7' --- +float(-6.7) +--- testing: 'abc' --- +string(3) "abd" +--- testing: '123abc' --- +string(6) "123abd" +--- testing: '123e5' --- +float(12300001) +--- testing: '123e5xyz' --- +string(8) "123e5xza" +--- testing: ' 123abc' --- +string(7) " 123abd" +--- testing: '123 abc' --- +string(7) "123 abd" +--- testing: '123abc ' --- +string(7) "123abc " +--- testing: '3.4a' --- +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 c1b15fdf347..b2b11709b31 100644 --- a/tests/lang/operators/predec_basiclong_64bit.phpt +++ b/tests/lang/operators/predec_basiclong_64bit.phpt @@ -1,32 +1,32 @@ ---TEST-- -Test --N operator : 64bit long tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test --N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- --- testing: 9223372036854775807 --- int(9223372036854775806) --- testing: -9223372036854775808 --- @@ -56,5 +56,5 @@ float(9.2233720368548E+18) --- testing: -9223372036854775807 --- int(-9223372036854775808) --- testing: -9.2233720368548E+18 --- -float(-9.2233720368548E+18) -===DONE=== +float(-9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/predec_variationStr.phpt b/tests/lang/operators/predec_variationStr.phpt index c7fb5744a01..1d1fade74d8 100644 --- a/tests/lang/operators/predec_variationStr.phpt +++ b/tests/lang/operators/predec_variationStr.phpt @@ -1,22 +1,22 @@ ---TEST-- -Test --N operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test --N operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- --- testing: '0' --- int(-1) --- testing: '65' --- @@ -44,5 +44,5 @@ string(7) "123abc " --- testing: '3.4a' --- string(4) "3.4a" --- testing: 'a5.9' --- -string(4) "a5.9" -===DONE=== +string(4) "a5.9" +===DONE=== diff --git a/tests/lang/operators/preinc_basiclong_64bit.phpt b/tests/lang/operators/preinc_basiclong_64bit.phpt index 599aa4e001b..e24cc283aa7 100644 --- a/tests/lang/operators/preinc_basiclong_64bit.phpt +++ b/tests/lang/operators/preinc_basiclong_64bit.phpt @@ -1,32 +1,32 @@ ---TEST-- -Test ++N operator : 64bit long tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test ++N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- --- testing: 9223372036854775807 --- float(9.2233720368548E+18) --- testing: -9223372036854775808 --- @@ -56,5 +56,5 @@ float(9.2233720368548E+18) --- testing: -9223372036854775807 --- int(-9223372036854775806) --- testing: -9.2233720368548E+18 --- -float(-9.2233720368548E+18) -===DONE=== +float(-9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/subtract_basiclong_64bit.phpt b/tests/lang/operators/subtract_basiclong_64bit.phpt index f52b9514420..ca80e3f52d7 100644 --- a/tests/lang/operators/subtract_basiclong_64bit.phpt +++ b/tests/lang/operators/subtract_basiclong_64bit.phpt @@ -1,44 +1,44 @@ ---TEST-- -Test - operator : 64bit long tests ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test - operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- --- testing: 9223372036854775807 - 0 --- int(9223372036854775807) --- testing: 9223372036854775807 - 1 --- @@ -578,5 +578,5 @@ float(0) --- testing: 9223372036854775807 - -9223372036854775807 --- float(1.844674407371E+19) --- testing: 9223372036854775807 - -9.2233720368548E+18 --- -float(1.844674407371E+19) -===DONE=== +float(1.844674407371E+19) +===DONE=== diff --git a/tests/lang/operators/subtract_variationStr.phpt b/tests/lang/operators/subtract_variationStr.phpt index 5b5bae2e355..51b5ed4dca8 100644 --- a/tests/lang/operators/subtract_variationStr.phpt +++ b/tests/lang/operators/subtract_variationStr.phpt @@ -1,26 +1,26 @@ ---TEST-- -Test - operator : various numbers as strings ---FILE-- - -===DONE=== ---EXPECT-- +--TEST-- +Test - operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- --- testing: '0' - '0' --- int(0) --- testing: '0' - '65' --- @@ -412,5 +412,5 @@ int(-123) --- testing: 'a5.9' - '3.4a' --- float(-3.4) --- testing: 'a5.9' - 'a5.9' --- -int(0) -===DONE=== +int(0) +===DONE=== diff --git a/tests/lang/returnByReference.001.phpt b/tests/lang/returnByReference.001.phpt index 51e63b8694b..1feccd4a97e 100644 --- a/tests/lang/returnByReference.001.phpt +++ b/tests/lang/returnByReference.001.phpt @@ -1,20 +1,20 @@ ---TEST-- -Returning a reference from a function ---FILE-- - ---EXPECT-- -int(7) +--TEST-- +Returning a reference from a function +--FILE-- + +--EXPECT-- +int(7) int(8) diff --git a/tests/lang/returnByReference.002.phpt b/tests/lang/returnByReference.002.phpt index 1c635b52980..99365f1b144 100644 --- a/tests/lang/returnByReference.002.phpt +++ b/tests/lang/returnByReference.002.phpt @@ -1,29 +1,29 @@ ---TEST-- -Returning a reference from a function. ---FILE-- - ---EXPECTF-- - -Notice: Only variables should be assigned by reference in %s on line 13 -string(8) "original" -string(7) "changed" +--TEST-- +Returning a reference from a function. +--FILE-- + +--EXPECTF-- + +Notice: Only variables should be assigned by reference in %s on line 13 +string(8) "original" +string(7) "changed" diff --git a/tests/lang/returnByReference.003.phpt b/tests/lang/returnByReference.003.phpt index 3f03037bf59..b14ae69549d 100644 --- a/tests/lang/returnByReference.003.phpt +++ b/tests/lang/returnByReference.003.phpt @@ -1,55 +1,55 @@ ---TEST-- -Returning a reference from a function ---FILE-- - 1. Trying to assign by reference the return value of a function that returns by value:\n"; -unset($a, $b); -$a = 4; -$b = &returnConstantByValue(); -$a++; -var_dump($a, $b); - -echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n"; -unset($a, $b); -$a = 4; -$b = &returnConstantByRef(); -$a++; -var_dump($a, $b); - -echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n"; -unset($a, $b); -$a = 4; -$b = &returnVariableByRef(); -$a++; -var_dump($a, $b); - -?> ---EXPECTF-- - ----> 1. Trying to assign by reference the return value of a function that returns by value: - -Notice: Only variables should be assigned by reference in %s on line 17 -int(5) -int(100) - ----> 2. Trying to assign by reference the return value of a function that returns a constant by ref: - -Notice: Only variable references should be returned by reference in %s on line 7 -int(5) -int(100) - ----> 3. Trying to assign by reference the return value of a function that returns by ref: -int(5) -int(5) +--TEST-- +Returning a reference from a function +--FILE-- + 1. Trying to assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &returnConstantByValue(); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &returnConstantByRef(); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &returnVariableByRef(); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Trying to assign by reference the return value of a function that returns by value: + +Notice: Only variables should be assigned by reference in %s on line 17 +int(5) +int(100) + +---> 2. Trying to assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 7 +int(5) +int(100) + +---> 3. Trying to assign by reference the return value of a function that returns by ref: +int(5) +int(5) diff --git a/tests/lang/returnByReference.004.phpt b/tests/lang/returnByReference.004.phpt index f7d1165a223..b37506ce0a4 100644 --- a/tests/lang/returnByReference.004.phpt +++ b/tests/lang/returnByReference.004.phpt @@ -1,57 +1,57 @@ ---TEST-- -Returning a reference from a static method ---FILE-- - 1. Trying to assign by reference the return value of a function that returns by value:\n"; -unset($a, $b); -$a = 4; -$b = &C::returnConstantByValue(); -$a++; -var_dump($a, $b); - -echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n"; -unset($a, $b); -$a = 4; -$b = &C::returnConstantByRef(); -$a++; -var_dump($a, $b); - -echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n"; -unset($a, $b); -$a = 4; -$b = &C::returnVariableByRef(); -$a++; -var_dump($a, $b); - -?> ---EXPECTF-- - ----> 1. Trying to assign by reference the return value of a function that returns by value: - -Notice: Only variables should be assigned by reference in %s on line 19 -int(5) -int(100) - ----> 2. Trying to assign by reference the return value of a function that returns a constant by ref: - -Notice: Only variable references should be returned by reference in %s on line 8 -int(5) -int(100) - ----> 3. Trying to assign by reference the return value of a function that returns by ref: -int(5) -int(5) +--TEST-- +Returning a reference from a static method +--FILE-- + 1. Trying to assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnConstantByValue(); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnConstantByRef(); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnVariableByRef(); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Trying to assign by reference the return value of a function that returns by value: + +Notice: Only variables should be assigned by reference in %s on line 19 +int(5) +int(100) + +---> 2. Trying to assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 8 +int(5) +int(100) + +---> 3. Trying to assign by reference the return value of a function that returns by ref: +int(5) +int(5) diff --git a/tests/lang/returnByReference.005.phpt b/tests/lang/returnByReference.005.phpt index 840b89fa53a..adb11617c40 100644 --- a/tests/lang/returnByReference.005.phpt +++ b/tests/lang/returnByReference.005.phpt @@ -1,58 +1,58 @@ ---TEST-- -Returning a reference from a method ---FILE-- - 1. Trying to assign by reference the return value of a function that returns by value:\n"; -unset($a, $b); -$a = 4; -$b = &$c->returnConstantByValue(); -$a++; -var_dump($a, $b); - -echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n"; -unset($a, $b); -$a = 4; -$b = &$c->returnConstantByRef(); -$a++; -var_dump($a, $b); - -echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n"; -unset($a, $b); -$a = 4; -$b = &$c->returnVariableByRef(); -$a++; -var_dump($a, $b); - -?> ---EXPECTF-- - ----> 1. Trying to assign by reference the return value of a function that returns by value: - -Notice: Only variables should be assigned by reference in %s on line 20 -int(5) -int(100) - ----> 2. Trying to assign by reference the return value of a function that returns a constant by ref: - -Notice: Only variable references should be returned by reference in %s on line 8 -int(5) -int(100) - ----> 3. Trying to assign by reference the return value of a function that returns by ref: -int(5) -int(5) +--TEST-- +Returning a reference from a method +--FILE-- + 1. Trying to assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnConstantByValue(); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnConstantByRef(); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnVariableByRef(); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Trying to assign by reference the return value of a function that returns by value: + +Notice: Only variables should be assigned by reference in %s on line 20 +int(5) +int(100) + +---> 2. Trying to assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 8 +int(5) +int(100) + +---> 3. Trying to assign by reference the return value of a function that returns by ref: +int(5) +int(5) diff --git a/tests/lang/returnByReference.006.phpt b/tests/lang/returnByReference.006.phpt index 4019f3ab458..d2c7041be80 100644 --- a/tests/lang/returnByReference.006.phpt +++ b/tests/lang/returnByReference.006.phpt @@ -1,60 +1,60 @@ ---TEST-- -Returning a reference from a function via another function ---INI-- -error_reporting = E_ALL & ~E_STRICT ---FILE-- - 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; -unset($a, $b); -$a = 4; -$b = &returnFunctionCallByRef('returnConstantByValue'); -$a++; -var_dump($a, $b); - -echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n"; -unset($a, $b); -$a = 4; -$b = &returnFunctionCallByRef('returnConstantByRef'); -$a++; -var_dump($a, $b); - -echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n"; -unset($a, $b); -$a = 4; -$b = &returnFunctionCallByRef('returnVariableByRef'); -$a++; -var_dump($a, $b); - -?> ---EXPECTF-- ----> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value: - -Notice: Only variable references should be returned by reference in %s on line 15 -int(5) -int(100) - ----> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref: - -Notice: Only variable references should be returned by reference in %s on line 7 -int(5) -int(100) - ----> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref: -int(5) -int(5) +--TEST-- +Returning a reference from a function via another function +--INI-- +error_reporting = E_ALL & ~E_STRICT +--FILE-- + 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &returnFunctionCallByRef('returnConstantByValue'); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &returnFunctionCallByRef('returnConstantByRef'); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &returnFunctionCallByRef('returnVariableByRef'); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- +---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value: + +Notice: Only variable references should be returned by reference in %s on line 15 +int(5) +int(100) + +---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 7 +int(5) +int(100) + +---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref: +int(5) +int(5) diff --git a/tests/lang/returnByReference.007.phpt b/tests/lang/returnByReference.007.phpt index badb7365f5d..45fa0ddc880 100644 --- a/tests/lang/returnByReference.007.phpt +++ b/tests/lang/returnByReference.007.phpt @@ -1,63 +1,63 @@ ---TEST-- -Returning a reference from a static method via another static method ---INI-- -error_reporting = E_ALL & ~E_STRICT ---FILE-- - 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; -unset($a, $b); -$a = 4; -$b = &C::returnFunctionCallByRef('returnConstantByValue'); -$a++; -var_dump($a, $b); - -echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n"; -unset($a, $b); -$a = 4; -$b = &C::returnFunctionCallByRef('returnConstantByRef'); -$a++; -var_dump($a, $b); - -echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n"; -unset($a, $b); -$a = 4; -$b = &C::returnFunctionCallByRef('returnVariableByRef'); -$a++; -var_dump($a, $b); - -?> ---EXPECTF-- - ----> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value: - -Notice: Only variable references should be returned by reference in %s on line 16 -int(5) -int(100) - ----> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref: - -Notice: Only variable references should be returned by reference in %s on line 8 -int(5) -int(100) - ----> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref: -int(5) +--TEST-- +Returning a reference from a static method via another static method +--INI-- +error_reporting = E_ALL & ~E_STRICT +--FILE-- + 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnFunctionCallByRef('returnConstantByValue'); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnFunctionCallByRef('returnConstantByRef'); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnFunctionCallByRef('returnVariableByRef'); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value: + +Notice: Only variable references should be returned by reference in %s on line 16 +int(5) +int(100) + +---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 8 +int(5) +int(100) + +---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref: +int(5) int(5) diff --git a/tests/lang/returnByReference.008.phpt b/tests/lang/returnByReference.008.phpt index 9c396be1bc1..3774a917c5c 100644 --- a/tests/lang/returnByReference.008.phpt +++ b/tests/lang/returnByReference.008.phpt @@ -1,64 +1,64 @@ ---TEST-- -Returning a reference from a non-static method via another non-static method ---INI-- -error_reporting = E_ALL & ~E_STRICT ---FILE-- -$functionToCall(); - } -} -$c = new C; - -echo "\n---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; -unset($a, $b); -$a = 4; -$b = &$c->returnFunctionCallByRef('returnConstantByValue'); -$a++; -var_dump($a, $b); - -echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n"; -unset($a, $b); -$a = 4; -$b = &$c->returnFunctionCallByRef('returnConstantByRef'); -$a++; -var_dump($a, $b); - -echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n"; -unset($a, $b); -$a = 4; -$b = &$c->returnFunctionCallByRef('returnVariableByRef'); -$a++; -var_dump($a, $b); - -?> ---EXPECTF-- - ----> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value: - -Notice: Only variable references should be returned by reference in %s on line 16 -int(5) -int(100) - ----> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref: - -Notice: Only variable references should be returned by reference in %s on line 8 -int(5) -int(100) - ----> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref: -int(5) +--TEST-- +Returning a reference from a non-static method via another non-static method +--INI-- +error_reporting = E_ALL & ~E_STRICT +--FILE-- +$functionToCall(); + } +} +$c = new C; + +echo "\n---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnFunctionCallByRef('returnConstantByValue'); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnFunctionCallByRef('returnConstantByRef'); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnFunctionCallByRef('returnVariableByRef'); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value: + +Notice: Only variable references should be returned by reference in %s on line 16 +int(5) +int(100) + +---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 8 +int(5) +int(100) + +---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref: +int(5) int(5) diff --git a/tests/lang/returnByReference.009.phpt b/tests/lang/returnByReference.009.phpt index 63203757de4..9e7470edbc2 100644 --- a/tests/lang/returnByReference.009.phpt +++ b/tests/lang/returnByReference.009.phpt @@ -1,39 +1,39 @@ ---TEST-- -Returning a references returned by another function ---FILE-- - 1. Return a variable by reference -> No warning:\n"; - -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) - ----> 2. Return a value by reference -> Warning: - -Notice: Only variable references should be returned by reference in %s on line %d -int(1) +--TEST-- +Returning a references returned by another function +--FILE-- + 1. Return a variable by reference -> No warning:\n"; + +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) + +---> 2. Return a value by reference -> Warning: + +Notice: Only variable references should be returned by reference in %s on line %d +int(1)