3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text="سلام دوستان خسته نباشید تو ‌این‌ شبِ‌زیبا پاییز برایت ‌آرزو می‌کنم رویایی‌که هیچ‌وقت، پایان نداشته باشه! و آرزوهایی‌که پرشور باشه‌و از بینشون یه‌چندتاییش برآورده بشه ایشالا امشب‌که ای مهربونت‌رو واسه، این‌که "; $create_subject = function ($text){ $stop_words = ['ها', 'های', 'هایی', 'دوستان', 'سلام', 'خسته', 'نباشید']; while(1){ $text = trim($text); preg_match("/^([^ ]+)/", $text, $first_word); if (isset($first_word[1]) && in_array($first_word[1], $stop_words)){ $text = preg_replace("/^".$first_word[1]."/", "", $text); } else { break; } } return $text; }; echo $subject = implode(' ', array_slice(explode(' ', $create_subject($text)), 0, 5)).'..؟';
Output for git.master, git.master_jit, rfc.property-hooks
تو ‌این‌ شبِ‌زیبا پاییز برایت..؟

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
59.48 ms | 401 KiB | 8 Q