3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sentences = [ 'India is great country.', 'Indiana is great state.', 'I have worked in India.', 'India-based research.', 'India78 is not very strong password.' ]; $search = "India"; foreach ($sentences as $sentence) { var_dump(preg_match("/\b$search\b/i", $sentence)); }
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.7, 7.2.29 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
int(1) int(0) int(1) int(1) int(0)

preferences:
214.42 ms | 404 KiB | 266 Q