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
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.

Link to comment
Share on other sites

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' {} \;

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.