calmchess Posted January 15, 2010 Share Posted January 15, 2010 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 More sharing options...
oni-kun Posted January 15, 2010 Share Posted January 15, 2010 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 https://forums.phpfreaks.com/topic/188531-php-to-throw-error-if-split-is-found/#findComment-995328 Share on other sites More sharing options...
calmchess Posted January 15, 2010 Author Share Posted January 15, 2010 if i turn on strict in php.ini will this also show the deprected error also if i don't use a version of php that its deprecated in will it still throw an error if i have strict turned on? Link to comment https://forums.phpfreaks.com/topic/188531-php-to-throw-error-if-split-is-found/#findComment-995332 Share on other sites More sharing options...
trq Posted January 15, 2010 Share Posted January 15, 2010 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 https://forums.phpfreaks.com/topic/188531-php-to-throw-error-if-split-is-found/#findComment-995347 Share on other sites More sharing options...
calmchess Posted January 15, 2010 Author Share Posted January 15, 2010 yeah i'm thinking searching would be better too......I just have to search over 100 pages just looking for a simpler way. *shrugs* nothing like brute force. Link to comment https://forums.phpfreaks.com/topic/188531-php-to-throw-error-if-split-is-found/#findComment-995348 Share on other sites More sharing options...
trq Posted January 15, 2010 Share Posted January 15, 2010 The code above doesn't get much simpler. Link to comment https://forums.phpfreaks.com/topic/188531-php-to-throw-error-if-split-is-found/#findComment-995349 Share on other sites More sharing options...
calmchess Posted January 15, 2010 Author Share Posted January 15, 2010 oh yeah lol @ me ............i'll load it to my linux o/s and use your search script.....i'm gonna turn it into a shell script for future use thankyou Link to comment https://forums.phpfreaks.com/topic/188531-php-to-throw-error-if-split-is-found/#findComment-995356 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.