]> granicus.if.org Git - php/commitdiff
Fix #72948: Uncatchable "Catchable" fatal error for class to string conversions
authorChristoph M. Becker <cmbecker69@gmx.de>
Sat, 3 Sep 2016 11:05:37 +0000 (13:05 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Sat, 3 Sep 2016 11:05:37 +0000 (13:05 +0200)
E_RECOVERABLE errors are reported as "Catchable fatal error". This is
misleading, because they actually can't be caught via try-catch statements.
Therefore we change the wording to "Recoverable fatal error" as suggested by
Nikita.

44 files changed:
Zend/tests/bug72162.phpt
Zend/tests/class_properties_const.phpt
Zend/tests/exception_009.phpt
Zend/tests/instanceof_001.phpt
Zend/tests/objects_022.phpt
ext/gmp/tests/cast.phpt
ext/mbstring/tests/common.inc
ext/openssl/tests/bug38261.phpt
ext/pcre/tests/preg_replace_error1.phpt
ext/pcre/tests/preg_replace_error2.phpt
ext/phar/tests/open_for_write_existing_b.phpt
ext/phar/tests/open_for_write_existing_b_5_2.phpt
ext/phar/tests/open_for_write_newfile_b.phpt
ext/phar/tests/open_for_write_newfile_b_5_2.phpt
ext/phar/tests/tar/open_for_write_existing_b.phpt
ext/phar/tests/tar/open_for_write_existing_b_5_2.phpt
ext/phar/tests/tar/open_for_write_newfile_b.phpt
ext/phar/tests/tar/open_for_write_newfile_b_5_2.phpt
ext/phar/tests/zip/open_for_write_existing_b.phpt
ext/phar/tests/zip/open_for_write_existing_b_5_2.phpt
ext/phar/tests/zip/open_for_write_newfile_b.phpt
ext/phar/tests/zip/open_for_write_newfile_b_5_2.phpt
ext/posix/tests/posix_getgrgid_variation.phpt
ext/posix/tests/posix_getpgid_variation.phpt
ext/posix/tests/posix_getpwuid_variation.phpt
ext/posix/tests/posix_kill_variation1.phpt
ext/posix/tests/posix_kill_variation2.phpt
ext/posix/tests/posix_strerror_variation1.phpt
ext/standard/tests/math/base_convert_error.phpt
ext/standard/tests/math/bindec_error.phpt
ext/standard/tests/math/hexdec_error.phpt
ext/standard/tests/math/octdec_error.phpt
ext/standard/tests/streams/bug61115.phpt
ext/standard/tests/strings/lcfirst.phpt
ext/standard/tests/strings/str_replace.phpt
ext/standard/tests/strings/str_replace_variation3.phpt
ext/standard/tests/strings/strcasecmp.phpt
ext/standard/tests/strings/strcmp.phpt
ext/standard/tests/strings/strlen.phpt
ext/standard/tests/strings/strpos.phpt
ext/standard/tests/strings/strstr.phpt
ext/standard/tests/strings/strval_error.phpt
ext/standard/tests/strings/ucfirst.phpt
main/main.c

index 5902c585d8b75c3e622aafbf94acada7a5acaa46..493342d8388f340f1d261fec65a23caceb7e6f4c 100644 (file)
@@ -7,4 +7,4 @@ $var11 = new StdClass();
 $var16 = error_reporting($var11);
 ?>
 --EXPECTF--
-Catchable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
index ac871b5c2bf6d6fe978efc938ad168a83baecf8b..8f607bcfe20698a21d0db806b530c9d1cd248186 100644 (file)
@@ -22,4 +22,4 @@ NULL
 Notice: Undefined property: A::$1 in %sclass_properties_const.php on line %d
 NULL
 
-Catchable fatal error: Object of class Closure could not be converted to string in %sclass_properties_const.php on line %d
+Recoverable fatal error: Object of class Closure could not be converted to string in %sclass_properties_const.php on line %d
index b22b3aa66e1de4ebdc2a35d726a941e01d9e5346..32b048c40b267131f681e0c61fd635f492da2601 100644 (file)
@@ -25,4 +25,4 @@ throw new my_exception;
 
 ?>
 --EXPECT--
-Catchable fatal error: Object of class stdClass could not be converted to string in Unknown on line 0
+Recoverable fatal error: Object of class stdClass could not be converted to string in Unknown on line 0
index b88e174c160fc44190db984e6f3d3d45d0ae2b4f..95e43ba5067aef47ca58411f096393e6a090e090 100644 (file)
@@ -26,4 +26,4 @@ bool(true)
 bool(true)
 bool(false)
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d
index 01f961bae1f30f0410c1fd61de46ab1b01ddb56d..5f537feaf48b538c453f23a9bcbdc918cda3d71c 100644 (file)
@@ -25,7 +25,7 @@ $foo = new foo;
 $foo->testFoo(new foo);
 $foo->testBar(new bar);
 $foo->testBaz(new baz);
-$foo->testFoo(new stdClass); // Catchable fatal error
+$foo->testFoo(new stdClass); // Recoverable fatal error
 
 ?>
 --EXPECTF--
index eb1832c4dd9186d331388af68e8727a538dedc7d..8606538bafb17f749bb80956c703f57c5f507643 100644 (file)
@@ -19,4 +19,4 @@ string(2) "42"
 int(42)
 float(42)
 
-Catchable fatal error: Object of class GMP could not be converted to boolean in %s on line %d
+Recoverable fatal error: Object of class GMP could not be converted to boolean in %s on line %d
index a40dde039912eaf36ebb783eb5e170e916f8f77d..4205cce7bc1f66acc11ecedb07903b5c9363073f 100644 (file)
@@ -20,7 +20,7 @@ function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
                                512 => "User Warning",          // E_USER_WARMING
                                1024=> "User Notice",           // E_USER_NOTICE
                                2048=> "Strict Notice",      // E_STRICT
-                               4096=> "Catchable fatal error",      // E_RECOVERABLE_ERROR
+                               4096=> "Recoverable fatal error",      // E_RECOVERABLE_ERROR
                                );
        
        if (!empty($debug)) {
index b06fa4f8fe40e6522ce763fa89776b72d1f1fe53..66de8b876ca8dc6e85d28e64c5dae95cb187c484 100644 (file)
@@ -31,4 +31,4 @@ Warning: openssl_x509_parse() expects at least 1 parameter, 0 given in %sbug3826
 NULL
 bool(false)
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %sbug38261.php on line %d 
+Recoverable fatal error: Object of class stdClass could not be converted to string in %sbug38261.php on line %d 
index ec573c77bfa1340f7ca7dc9fe3eb44e19a1ae283..04eef25e3d9283bcfc5f22facf344893a6ad9b2a 100644 (file)
@@ -55,5 +55,5 @@ string(1) "a"
 Arg value is /[a-zA-Z]/
 string(1) "1"
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %spreg_replace_error1.php on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %spreg_replace_error1.php on line %d
 
index bf5d3e072c84d1509e10a043f9ae88692473891b..79f4c60d69b0a0519c19316f2fceace47eda80f6 100644 (file)
@@ -33,5 +33,5 @@ Arg value is: Array
 Warning: preg_replace(): Parameter mismatch, pattern is a string while replacement is an array in %spreg_replace_error2.php on line %d
 bool(false)
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %spreg_replace_error2.php on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %spreg_replace_error2.php on line %d
 
index ef48906de1d27f4b31283072cadafaf360389152..448b3a3abc351e9aebeaa60cf1cb9035b9fcd640 100644 (file)
@@ -21,7 +21,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
 include 'files/phar_test.inc';
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-  echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+  echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index 03edd54e5fe7f8dc33c14943f587ff0e1d33f7af..b72098c773b5dd4cc92633be4098901b79e3b65d 100644 (file)
@@ -19,7 +19,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
 include 'files/phar_test.inc';
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-  echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+  echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index 45131c48922712e85e53d015c2bb148c523d3fc4..2926140ff51de2561579bf50a57f475e7451a732 100644 (file)
@@ -21,7 +21,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
 include 'files/phar_test.inc';
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-  echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+  echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index 7d43f1c8ee7a8c514785755c87c9f84927504c2e..8d84379fba85021c4f80eaefc73c3a84d412c8d8 100644 (file)
@@ -19,7 +19,7 @@ $files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
 include 'files/phar_test.inc';
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-  echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+  echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index fa631e61816c8a6c17cd718ef71e4b3c27e63149..3c7c67e941f24fb29de88c6e91ef7d0850592384 100644 (file)
@@ -31,7 +31,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-       echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+       echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index a6fea062adeacce4cd416ba8c177db35040254b3..19c2f4023a5396a5450875e4c182224cf426a584 100644 (file)
@@ -29,7 +29,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-       echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+       echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index 2ea557b8a04b8f6b60fae8cfeba35fecf48b3729..83a510436a27a59572894bf6ae565ce02e0a1dc1 100644 (file)
@@ -31,7 +31,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-       echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+       echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index 1bb02a0bec51be695a6d0dedd83d2b87e0378dd1..7906bc9ddf371011c9adcb1df4f49d50c4e6d428 100644 (file)
@@ -29,7 +29,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-       echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+       echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index b997c68291da144ab8f3e189d32983ff8c4781f7..d1f963e9aff69aa147dabc1b79e8a130195a1b78 100644 (file)
@@ -31,7 +31,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-  echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+  echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index b88a4963268287731ec8083ad9cdb92f04035055..522a1deda684fe0f15a7ec66e924ca442b75ddef 100644 (file)
@@ -29,7 +29,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-  echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+  echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index 96fd2e426e11a4ac6250e7350c2c6247b163d9d0..9f5328ff9174e41ceaab8472051fb26841373b31 100644 (file)
@@ -31,7 +31,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-  echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+  echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index 3032427bcc93668bebb1838c5bb2f9c13c60b647..2575201bd1fe1b1bd9aa9aebd1b9ff05a1343114 100644 (file)
@@ -29,7 +29,7 @@ $phar->stopBuffering();
 ini_set('phar.readonly', 1);
 
 function err_handler($errno, $errstr, $errfile, $errline) {
-  echo "Catchable fatal error: $errstr in $errfile on line $errline\n";
+  echo "Recoverable fatal error: $errstr in $errfile on line $errline\n";
 }
 
 set_error_handler("err_handler", E_RECOVERABLE_ERROR);
index 9b9bc25aab15e3f4595c46fd0957da0de76324a2..7abd32b97ff8a7d97ce4a3012a42544af1c6cf97 100644 (file)
@@ -185,4 +185,4 @@ valid output
 Arg value  
 valid output
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d
index 49ed890e950107308d5c8b8159c7bdfb63278f48..478164c210b08cb7c6dc93f3b025d4f178288c2d 100644 (file)
@@ -185,4 +185,4 @@ valid output
 Arg value  
 valid output
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d
index 8a4b83ba76da8275e2871d1bcc3f6e19d690a273..fa000f5b8ad8004afdfb47f8f6ab016589d1c70c 100644 (file)
@@ -185,4 +185,4 @@ valid output
 Arg value  
 valid output
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d
index 99bb8e015113c5628f370b44f9ac00713329391d..d26f11df032424548d0b7c4a1390150f888df2e5 100644 (file)
@@ -179,4 +179,4 @@ bool(false)
 Arg value  
 bool(false)
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d
index 5eeaa1fc5a18541603e6548c767093b5915c87b3..399151a7ed7ce59c9653e4828366a716fecd6a56 100644 (file)
@@ -179,4 +179,4 @@ bool(false)
 Arg value  
 bool(false)
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d
index ed504921259da36d2ba06c8f00aaaf18bb98ba4b..40fff34be87841ed00a0be7b5a11f6d1b7a3e6ef 100644 (file)
@@ -178,4 +178,4 @@ string
 Arg value  
 string
 
-Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d
+Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d
index 4e35a81f36917a9c6b02c487e175bf4db45f6006..a05268ab94e6d5478ba4eb7a927a2c194325745c 100644 (file)
@@ -40,4 +40,4 @@ Warning: base_convert(): Invalid `from base' (1) in %s on line %d
 Warning: base_convert(): Invalid `to base' (37) in %s on line %s
 Incorrect input
 
-Catchable fatal error: Object of class classA could not be converted to string in %s on line %d
\ No newline at end of file
+Recoverable fatal error: Object of class classA could not be converted to string in %s on line %d
\ No newline at end of file
index 8cf3cf70285df77bb7526e56ea2031f42b5fa25b..aa6ac9cdd1f8981b0465fbf5888eb8d2c42ceeb0 100644 (file)
@@ -34,4 +34,4 @@ Warning: bindec() expects exactly 1 parameter, 0 given in %s on line %d
 Warning: bindec() expects exactly 1 parameter, 2 given in %s on line %d
 Incorrect input
 
-Catchable fatal error: Object of class classA could not be converted to string in %s on line %d
\ No newline at end of file
+Recoverable fatal error: Object of class classA could not be converted to string in %s on line %d
\ No newline at end of file
index e9ab9e512de5f9f94f64a55b4dd4324e41db2a52..c45c2aa92b1b20b50d3e016ab8a12ebcb22b42f7 100644 (file)
@@ -33,4 +33,4 @@ Warning: hexdec() expects exactly 1 parameter, 2 given in %s on line %d
 
 -- Incorrect input --
 
-Catchable fatal error: Object of class classA could not be converted to string in %s on line %d
\ No newline at end of file
+Recoverable fatal error: Object of class classA could not be converted to string in %s on line %d
\ No newline at end of file
index 5d2138377489572699a5051a4e38bc432039f1bd..ba5f2116bbc52c19b5e97844d703f09e0cf2b432 100644 (file)
@@ -34,4 +34,4 @@ Warning: octdec() expects exactly 1 parameter, 2 given in %s on line %d
 
 -- Incorrect input --
 
-Catchable fatal error: Object of class classA could not be converted to string in %s on line %d
\ No newline at end of file
+Recoverable fatal error: Object of class classA could not be converted to string in %s on line %d
\ No newline at end of file
index 29dc7c1ccc6376b315f0bd605107f46e59100957..5cfc9c2ac3cb25ab271f6d9218318e19c773add6 100644 (file)
@@ -10,4 +10,4 @@ stream_context_set_params($resourceFileTemp, array());
 preg_replace('', function() {}, $resourceFileTemp);
 ?>
 --EXPECTF--
-Catchable fatal error: Object of class Closure could not be converted to string in %s on line %d
+Recoverable fatal error: Object of class Closure could not be converted to string in %s on line %d
index 6cbd213fbeb6ea78249ea0b675d4f8332dfeb9d8..5424c5018d81b507e17b0619e39138e93040efbf 100644 (file)
Binary files a/ext/standard/tests/strings/lcfirst.phpt and b/ext/standard/tests/strings/lcfirst.phpt differ
index 15c1c8e53d0dd7e23ca4a2f07c98ed36d11f6d37..b53ed665d474e7a42bd3539bfd750d4ef76b6841 100644 (file)
@@ -118,7 +118,7 @@ var_dump($count);
 
 
 echo "\n-- Testing objects --\n";
-/* we get "Catchable fatal error: saying Object of class could not be converted
+/* we get "Recoverable fatal error: saying Object of class could not be converted
         to string" by default, when an object is passed instead of string:
 The error can be  avoided by choosing the __toString magix method as follows: */
 
index 7b46f8b286967c1d8717cdb8e792839057d49ce8..8f6f38f1f97ae7fa568b8a8545936b2e9f572c92 100644 (file)
@@ -31,7 +31,7 @@ var_dump($count);
 
 
 echo "\n-- Testing objects --\n";
-/* we get "Catchable fatal error: saying Object of class could not be converted
+/* we get "Recoverable fatal error: saying Object of class could not be converted
         to string" by default, when an object is passed instead of string:
 The error can be  avoided by choosing the __toString magix method as follows: */
 
index b3452cfd7c0f6322844e435ebd00b43f78dc060e..265b8708ea2f0961c4b4943ffc3a6ad683df3bdf 100644 (file)
Binary files a/ext/standard/tests/strings/strcasecmp.phpt and b/ext/standard/tests/strings/strcasecmp.phpt differ
index e77ed6e46620eae96697c74a01fb13ab62ad0dc9..dea94644aa28219574fe93dd51a6b27c867c03dd 100644 (file)
Binary files a/ext/standard/tests/strings/strcmp.phpt and b/ext/standard/tests/strings/strcmp.phpt differ
index ab5444594363273df67215cea926876eeec02765..52e0200af16fce7b3afa11c0357df556473d513d 100644 (file)
Binary files a/ext/standard/tests/strings/strlen.phpt and b/ext/standard/tests/strings/strlen.phpt differ
index f5d60a69b58cdf45b3c525faaf9032e086d2fc88..a2237fe005abc99d09e7a7a77db1dea477dc6c28 100644 (file)
Binary files a/ext/standard/tests/strings/strpos.phpt and b/ext/standard/tests/strings/strpos.phpt differ
index fd7f58ef1a51a4d6fcb7f585af339874148bf5e7..a16cda9c9367d1a4dc5483691adfd61f22ff5509 100644 (file)
Binary files a/ext/standard/tests/strings/strstr.phpt and b/ext/standard/tests/strings/strstr.phpt differ
index c31a2ab35bcb3361ea17ef11685ec9e27759bbbf..629c003679baf6c3d0beb1cd4a153a45bbc7258c 100644 (file)
@@ -48,4 +48,4 @@ NULL
 
 -- Testing strval() function with object which has not toString() method  --
 
-Catchable fatal error: Object of class MyClass could not be converted to string in %s on line %d
\ No newline at end of file
+Recoverable fatal error: Object of class MyClass could not be converted to string in %s on line %d
\ No newline at end of file
index 8fb1a156b46a78c5fde89267972c0bfd5d4d5bb5..143c4bd426cc2e82431e9ddcf71b7daea8132153 100644 (file)
Binary files a/ext/standard/tests/strings/ucfirst.phpt and b/ext/standard/tests/strings/ucfirst.phpt differ
index 0a1127176e7586a6804b76cebcb7470367fe47c1..dd69734aeabd9206a391e9a7619677486f97db6f 100644 (file)
@@ -1094,7 +1094,7 @@ static ZEND_COLD void php_error_cb(int type, const char *error_filename, const u
                                syslog_type_int = LOG_ERR;
                                break;
                        case E_RECOVERABLE_ERROR:
-                               error_type_str = "Catchable fatal error";
+                               error_type_str = "Recoverable fatal error";
                                syslog_type_int = LOG_ERR;
                                break;
                        case E_WARNING: