CakePHP str_replace errors? - php

I am trying to setup my CakePHP project on a localhost environment, but i get this error:
Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\xampp\htdocs\Bakesystem\vendor\cakephp\cakephp\src\Utility\Text.php on line 232
Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\xampp\htdocs\Bakesystem\vendor\cakephp\cakephp\src\Utility\Text.php on line 232
Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\xampp\htdocs\Bakesystem\vendor\cakephp\cakephp\src\Utility\Text.php on line 232
Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\xampp\htdocs\Bakesystem\vendor\cakephp\cakephp\src\Utility\Text.php on line 232
Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\xampp\htdocs\Bakesystem\vendor\cakephp\cakephp\src\Utility\Text.php on line 232
And then i get like 30 of these errors...
After all these errors gets printed out, the rest displays fine. I can obviously toggle errors off and keep going, but i would like to fix the error if possible.
Can anyone direct me to anything that might help me? I'm kinda lost as to how i can debug this and resolve it...

Related

Error message: Deprecated Functionality: strpos(): Passing null to parameter #1 ($haystack)

Since a upgrade to PHP 8.1 from 7.4 we are getting this error in an application:
Error message: Deprecated Functionality: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /Model/Plugin/Order.php on line 33
Line 33 is a IF-statement
33. if (strpos($orderStatus, '_') !== false) {
34. do stuff...
35. }
Is it possible to change it in someway to be able to handle null values?
Thanks,

Deprecated: Function ereg_replace() is deprecated in /home/user/public_html/includes/functions.php on line 62 [duplicate]

This question already has answers here:
How can I convert ereg expressions to preg in PHP?
(4 answers)
Closed 9 years ago.
When I type my Website URL It's all right. But When I press the sub-category to view the inner content then the problem is occur. There is 5 folder in my public_html..
They are:
1.admin
2.avatars
3.FTP
4.images
5.includes
and some php files. This is a script.
I can't php.
There's some Error...
Deprecated: Function ereg_replace() is deprecated in /home/exwggayd/public_html/includes/functions.php on line 62
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/phpFlickr.php on line 91
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/phpFlickr.php on line 330
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/phpFlickr.php on line 399
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/phpFlickr.php on line 468
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 228
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 324
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 602
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 621
Strict Standards: Redefining already defined constructor for class Net_URL in /home/exwggayd/public_html/includes/phpflickr/PEAR/Net/URL.php on line 122
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 590
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 591
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 603
#
The function.php inside the "includes" folder...may be there is the problem. But When I reload the page Everything Seems allright.
Here is the Codes...Paste on Pastebin!!
function.php# http://pastebin.com/PR4RKSJS
phpFlickr.php# http://pastebin.com/zzaVehBx
Request.php# hxxp://pastebin.com/MPfq5zAL
URL.php# hxxp://pastebin.com/yDMvA7e5
You should use preg_replace() instead.
ereg_replace() is now deprecated : http://php.net/manual/en/function.ereg-replace.php
It's a warning about using old function "ereg_replace", which could be easilly replaced by preg_replace.
For example, the code at line#62 of yours functions.php file:
$string = ereg_replace(' +', ' ', trim($string));
could be replaced to:
$string = preg_replace('# +#', ' ',trim($string));
where '#' - is a regular expresiion start and end sign, you can use "/", "|" or some others special signs instead of it ('/' it not recommended in your case, because it require to escape '/' characters in the regexp string, and, as you are "cant php", this could be difficult to you)
Other lines with "ereg_replace" can be fixed just the same way

how to solve the Deprecated problem For SEO

I've just got an error.
When I try to assign an object like this: am doing for SEO by google php seo scripts.
Deprecated: Assigning the return value of new by reference is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3703
Deprecated: Function ereg() is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3876
Deprecated: Function ereg() is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3896
Deprecated: Function ereg() is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 1451
Notice: Uninitialized string offset: 0 in E:\wamp\www\subgoogle\searchgoosimple.php on line 89
Sorry, no search results found
The error I get is "Assigning the return value of new by reference is deprecated". Actually I've been looking for a solution but the only one I've seen is just turn down the politicy of nusoap.php (error_reporting). I've tried it too, but it didn't work.
It's so confusing..I hope you could help me. Thanks in advance.
Each of these error messages carries a line number and a filename:
Deprecated: Assigning the return value of new by reference is deprecated in E:\wamp\www\subgoogle\nusoap.php on line 3703
Go there, and remove the & before the new.
To get rid of the other warnings, use following setting in your main script to reduce the error reporting level:
error_reporting(E_ALL);
You'll have to find eventual other instances of error_reporting( and adapt them too.

Php, DbSimple error

I work with DbSimple in my site-engine. Everything worked fine but some time ago I began to get an error:
Deprecated: Assigning the return value of new by reference is deprecated in Z:\home\localhost\www\ololo\DbSimple\Generic.php on line 113
Deprecated: Assigning the return value of new by reference is deprecated in Z:\home\localhost\www\ololo\DbSimple\Generic.php on line 133
Deprecated: Assigning the return value of new by reference is deprecated in Z:\home\localhost\www\ololo\DbSimple\Mysql.php on line 73
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'mysqlErrorHandler' not found or invalid function name in Z:\home\localhost\www\ololo\DbSimple\Generic.php on line 1278
SELECT * FROM `configuration`
NULL
What can it be?
My guess is that you upgraded PHP from 5.2.x to 5.3. I've seen similar issues with Joomla.
EDIT:
Deprecated features in PHP 5.3.x

Pear error messages with PHP5.3.0

I get a LOT of errors when i Open up a newly installed PEAR package on a WAMP server.
Here's the error messages.
What can i do?
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 650
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 697
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 757
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 786
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 914
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 1577
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 1607
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 2038
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 2091
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 322
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 1450
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 1458
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Frontend.php on line 91
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Command.php on line 137
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Command.php on line 154
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 1026
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 1033
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\DependencyDB.php on line 554
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\DependencyDB.php on line 558
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 1179
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 1183
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 199
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 1504
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 1516
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 1524
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 1527
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 492
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 511
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 530
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 574
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 607
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 629
"Deprecated" means that a function or feature is no longer considered a good idea and will be removed in a future version of PHP. Since these are warnings about libraries you're using, you don't need to do anything yet except to make sure your PEAR version and packages are up to date. The libraries you use will need to be updated to make these warnings go away.
In a future version of PHP, the functions listed in your warnings will go away. You will then get fatal errors if your libraries have not been updated. Before you do another big PHP upgrade, make sure you have no deprecation warnings, or check them against the PHP upgrade docs to see if you will be impacted.
If you're getting these errors in your browser, adjust your error reporting settings. One way to do it:
error_reporting(E_ALL & ~E_DEPRECATED);

Categories