3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sentence = "One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen."; for ($i = 1; $i <= 15; $i++) { if (preg_match('/^((\s*\S+){45}(\s*\S+)*?\.).*?\.\s*\S)/', $sentence, $match)) { echo "Summary {$i}: {$match[1]}\n"; } else { echo "Full text {$i}: {$sentence}\n"; } }
Output for 4.3.11 - 7.2.0
Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 1: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 2: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 3: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 4: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 5: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 6: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 7: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 8: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 9: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 10: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 11: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 12: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 13: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 14: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: preg_match(): Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 15: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen.
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 1: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 2: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 3: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 4: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 5: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 6: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 7: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 8: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 9: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 10: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 11: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 12: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 13: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 14: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen. Warning: Compilation failed: unmatched parentheses at offset 37 in /in/8N6WP on line 5 Full text 15: One two three. Four five six. Seven eight nine. Ten eleven twelve. Thirteen fourteen fifteen.