3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dwellingInfo = [ ["AAA", "Chimney with red bricks"], ["BBB", "Two wide windows in the main floor"], ["CCC", "Roof tiles renewed in 2015"] ]; $haystack = implode( ',', array_column($dwellingInfo, 1) ); $dwellingAttributes = [ ["0001", 'Chimney', '/\b(?:Chimney with|Big stove)\b/i'], ["0002", 'Garden', '/\bgarden\b/i'], ["0003", 'Roof tiles', '/\bRoof tiles\b/i'], ["0004", 'Windows', '/\bwindows?\b/i'], ["0005", 'Garage', '/\b(?:garage|car port|under cover area)\b/i'] ]; foreach ($dwellingAttributes as [$id, $term, $pattern]) { printf( "%s - %s - %s\n", $id, $term, preg_match($pattern, $haystack) ? 'available' : 'unavailable' ); }

preferences:
24.08 ms | 407 KiB | 5 Q