草庐IT

deprecation-warning

全部标签

php - 为什么我得到 : Warning: printf() Too few arguments in php

我得到了错误Warning:printf()[function.printf]:Toofewarguments看看我看到的代码:functiontwentyten_posted_on(){printf(sprintf('%3$s',get_permalink(),esc_attr(get_the_time()),get_the_date()));}似乎是什么问题? 最佳答案 printf()和sprintf()函数是相同的;它们行为的唯一区别在于,一个是语句(它做某事),另一个是函数表达式(它计算出某物)。(有关差异的描述,请参阅t

php - 间歇性 simplexml_load_file() : I/O warning on local Joomla site

我刚刚开始在本地主机上运行的joomla开发站点的所有页面上出现间歇性错误。完整的警告是:警告:simplexml_load_file():I/O警告:无法在/site/libraries/joomla/language/language中加载外部实体“/site/language/en-GB/en-GB.xml”。第1354行的php奇怪的是它是间歇性的,刷新几次通常会解决问题。是否存在可能导致此问题的代码问题或其他原因? 最佳答案 让我把它放在这里以防万一有人会用谷歌搜索答案,并且非线程安全libxml_disable_enti

PHP curl : The usage of the @filename API for file uploading is deprecated

我收到这条消息:Deprecated:curl_setopt_array():Theusageofthe@filenameAPIforfileuploadingisdeprecated.PleaseusetheCURLFileclassinstead我知道我可以使用CURLFile类重写我的代码,但它只能从5.5开始使用。我的网站必须在PHP5.3、PHP5.4或PHP5.5上运行,所以我不能放弃5.3和5.4的兼容性。所以我不能使用CURLFile。如何重写代码以使其在没有任何PHP版本检查的情况下在任何PHP上运行? 最佳答案

php - 由于 E_WARNING,我是否需要在 PHP 中尝试/捕获 opendir?

我正在为家庭作业制作一个小文件浏览器-我已经按照我的需要让它正常工作,但是我对PHP中的错误场景处理有点困惑,因为我正在尝试重构我的编码。我习惯于C++/C#try/catch错误处理,PHP似乎有一些变体。令我困惑的是:resourceopendir(string$path[,resource$context])Returnsadirectoryhandleresourceonsuccess,orFALSEonfailure.Ifpathisnotavaliddirectoryorthedirectorycannotbeopenedduetopermissionrestriction

php - 可怕的 "Warning: imagecreatefromjpeg() : '/tmp/filename' 不是一个有效的 JPEG 文件 in/phpfile.php on line xxx”

当有人将图片上传到我们的网站时,我一直收到此警告:Warning:imagecreatefromjpeg()[function.imagecreatefromjpeg]:gd-jpeg:JPEGlibraryreportsunrecoverableerror:in/home/pathremoved/includes/snapsutils.phponline220Warning:imagecreatefromjpeg()[function.imagecreatefromjpeg]:'/tmp/phpiw4MFk'isnotavalidJPEGfilein/home/pathremoved

php - 弃用 : preg_replace(): The/e modifier is deprecated, 改用 preg_replace_callback

我需要一点帮助。因为preg_replace已弃用,我必须将所有mypreg_replace转换为preg_replace_callback...我尝试过的:改变:$template=preg_replace("#\\[aviable=(.+?)\\](.*?)\\[/aviable\\]#ies","\$this->check_module('\\1','\\2')",$template);收件人:$template=preg_replace_callback("#\\[aviable=(.+?)\\](.*?)\\[/aviable\\]#isu",return$this->che

mysqli - php5.3 - mysqli_stmt :bind_params with call_user_func_array warnings

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:Isitpossibletopassparametersbyreferenceusingcall_user_func_array()?我有以下代码行在PHP5.1中有效,但在PHP5.3中无效。$input=array('ss','john','programmer');call_user_func_array(array($mysqli_stmt,'bind_param'),$input);在PHP5.3中,我收到以下警告消息:Warning:Parameter2tomysqli_stmt::bind_pa

php - count() 发出 E_WARNING

PHP7.2之前使用count()在标量值或不可数对象上将返回1或0。例如:https://3v4l.org/tGRDEvar_dump(count(123));//int(1)var_dump(count(newstdclass));//int(1)var_dump(count('helloworld'));//int(1)var_dump(count(null));//int(0)在updatestoPHP7.2+,如上所示使用count()将发出警告消息。AnE_WARNINGwillnowbeemittedwhenattemptingtocount()non-countable

已解决FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future

已解决(pandas中DataFrame数据拼接报错)FutureWarning:Theframe.appendmethodisdeprecatedandwillberemovedfrompandasinafutureversion.Usepandas.concatinstead.df=df1.append(df2)文章目录报错代码报错翻译报错原因解决方法千人全栈VIP答疑群联系博主帮忙解决报错报错代码在pandas模块中,通常我们都需要对类型为DataFrame的数据进行操作,其中最为常见的操作便是拼接了。比如我们将两个Excel表格中的数据读入,随后拼接完成后保存进一个新的Excel表格文

PHP 5.4 : disable warning "Creating default object from empty value"

我想将代码从PHP5.2迁移到5.4。到目前为止,这工作得很好,除了我使用的所有代码都广泛使用了一个没有任何初始化的成员的对象,比如:$MyObject->MyMember="Hello";这导致警告:“从空值创建默认对象”我知道解决方案是使用:$MyObject=newstdClass();$MyObject->MyMember="Hello";但要在我的所有代码中更改它需要大量工作,因为我在不同的项目中多次使用它。我知道,这不是很好的风格,但不幸的是,我无法在接下来的几周内将其添加到我的所有代码中。我知道我可以将phperror_reporting设置为不报告警告,但我仍希望能够收