草庐IT

fnon-call-exceptions

全部标签

php - 为什么 Exception 不是 Throwable 的实例?

我认为在所有编程语言中,Exception类都是Throwable接口(interface)的实例。看看下面的代码,它显示Exception不是php中Throwable的实例。try{thrownewInvalidArgumentException("errormessage");}catch(InvalidArgumentException$e){if($einstanceofException){echo'$eisexception';//thislinegetsexecuted}if($einstanceofThrowable){echo'$eisthrowable';//bu

PHP 和 FPDI/FPDF : Fatal error: Uncaught Exception: FPDF error: Incorrect output destination

我有一个PDF文件,我想用FDI/FPDF添加一个新页面Fatalerror:UncaughtException:FPDFerror:Incorrectoutputdestination:outfiles/111111.pdfinC:\wamp\www\pdf\fpdi\fpdf.phponline271(!)Exception:FPDFerror:Incorrectoutputdestination:outfiles/111111.pdfinC:\wamp\www\pdf\fpdi\fpdf.phponline271require_once('fpdi/fpdf.php');requ

php - Facebook 通知 API : "This method must be called with an app access_token"

我正在尝试使用GraphAPIExplorer从我的应用程序发送Facebook通知。所以我选择了我的应用程序,POST,并在/之后输入了这个字符串11093774316/notifications?access_token=430xxxxxx156|HU0ygMtxxxxxxxxxxxxikVKg&template=Hello&href=index.php访问字符串是我在“访问token调试器”上得到的,我检查它是否正常。但是,我收到此错误消息:{"error":{"message":"(#15)Thismethodmustbecalledwithanappaccess_token.

php - 类上下文中的 call_user_func(定义了 $this)

有没有一种方法可以在对象的上下文中执行PHP5.3中的闭包?classTest{public$name='John';functiongreet(){eval('echo"Hello,".$this->name;');call_user_func(function(){echo"Goodbye,".$this->name;});}}$c=newTest;$c->greet();eval()可以正常工作,但是call_user_func将无法访问$this。(不在对象上下文中时使用$this)。我现在将“$this”作为参数传递给闭包,但这并不是我所需要的。

php - fatal error : Call to undefined function validation_errors() using codeIgniter

fatalerror:使用codeIgniter调用未定义函数validation_errors()这是我的comments.phpViewNameEmailComment这是我的news_model.phpload->database();}//setcommentpublicfunctionset_comment(){$this->load->helper('url');$this->load->helper('date');$data_c=array('comment_name'=>$this->input->post('comment_name'),'comment_email

php - call_user_func() 和 $var() 之间有区别吗?

call_user_func()和它的语法糖版本之间有什么区别吗...//Globalfunction$a='max';echocall_user_func($a,1,2);//2echo$a(1,2);//2//ClassmethodclassA{publicfunctionb(){return__CLASS__;}staticfunctionc(){return'Iamstatic!';}}$a=newA;$b='b';echocall_user_func(array($a,$b));//Aecho$a->$b();//A//Staticclassmethod$c='c';echo

php - ( fatal error : Call to a member function bind_param() on a non-object)

这个问题在这里已经有了答案:Whattodowithmysqliproblems?Errorslikemysqli_fetch_array():Argument#1mustbeoftypemysqli_resultandsuch(1个回答)关闭4个月前。我收到此文本的错误:(抱歉我的英语不好,我来自德国!)错误:fatalerror:在第44行/users/ftf/www/ccache.php中的非对象上调用成员函数bind_param()部分代码来自ccache.php//NeuesDatenbank-Objekterzeugen$db=@newmysqli('localhost',

php - 更新到 PHP 7 后出现 CodeIgniter CI_Exceptions::show_exception 错误

我在PHP5.6中使用CodeIgniter3.0.0。昨天我更新到PHP7并开始出现以下错误:-UncaughtTypeError:Argument1passedtoCI_Exceptions::show_exception()mustbeaninstanceofException,instanceofErrorgiven,calledin/my/file/path/app/system/core/Common.phponline658anddefinedin/my/file/path/hgx_portal/app/system/core/Exceptions.php:190Stac

php - CURLM_CALL_MULTI_PERFORM 弃用

CURLM_CALL_MULTI_PERFORMwasdeprecated.do{$mrc=curl_multi_exec($mc,$active);}while($mrc==CURLM_CALL_MULTI_PERFORM);还有其他选择吗?curl版本7.27.0 最佳答案 您应该保持代码不变,因为这仍然是调用curl_multi_exec的最佳方式。常量本身仍然存在;在Curl7.20.0及更高版本中根本不使用它。但是,更改是以这样一种方式完成的,即您以前的代码根本不需要修改,并且将继续工作。在Curl7.20.0之前,cur

php - fatal error : Uncaught exception 'Exception' in PHPExcel classes

谁能告诉我,为什么从PHPExcel类中抛出以下错误Fatalerror:Uncaughtexception'Exception'withmessage'Couldnotclosezipfile/var/www/mydomain/myexcel.xlsx.'in/var/www/mydomain/Classes/PHPExcel/Writer/Excel2007.php:400Stacktrace:#0/var/www/mydomain/myexcel.php(173):PHPExcel_Writer_Excel2007->save('/var/www/mydomain...')#1{