Jump to content

php to throw error if split is found??


calmchess

Recommended Posts

Is there anyway for me to tell php to throw an errror if split is used......split has become depercated and is not included in php 6.0 so i need to change it out for explode.....problem is i don't know what pages use split anymore so i want to make split an error or notice condition then surf my pages waiting for the error to occur so i know where split is used.

Link to comment
https://forums.phpfreaks.com/topic/188531-php-to-throw-error-if-split-is-found/
Share on other sites

Is there anyway for me to tell php to throw an errror if split is used......split has become depercated and is not included in php 6.0 so i need to change it out for explode.....problem is i don't know what pages use split anymore so i want to make split an error or notice condition then surf my pages waiting for the error to occur so i know where split is used.

 

Turn error reporting to strict at the top of your page, and it will list the deprecation error:

ini_set("display_errors", "1");
error_reporting(E_STRICT);

 

You can as well with error reporting write the errors to log.

Surely searching your source code would be simpler?

 

find src/ -type f -name '*.php' -exec grep 'split' -Hn {} \; > splitlist.txt

 

Hell, you could even replace it right there and then (maybe after taking a look at splitlist.txt).

 

find src/ -type f -name '*.php' -exec sed -i -e 's/split/explode/g' {} \;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.