--- /dev/null
+--TEST--
+Bug #40815 (using strings like "class::func" and static methods in set_exception_handler() might result in crash).
+--FILE--
+<?php
+
+class ehandle{
+ static public function exh ($ex) {
+ echo 'foo';
+ }
+}
+
+set_exception_handler("ehandle::exh");
+
+throw new Exception ("Whiii");
+echo "Done\n";
+?>
+--EXPECTF--
+foo
fname = Z_STRVAL_P(fci->function_name);
fname_len = Z_STRLEN_P(fci->function_name);
- if (calling_scope && (colon = strstr(fname, "::")) != NULL) {
+ if ((colon = strstr(fname, "::")) != NULL) {
int clen = colon - fname;
int mlen = fname_len - clen - 2;
zend_class_entry **pce, *ce_child = NULL;