3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); $text = "It seems that they found us? We must urgently leave here, before it's too late. Let's run fast!"; //$text = "Ну, прости меня! Не хотела я тебе зла сделать; да в себе не вольна была. Что говорила, что делала, себя не помнила."; //$text = "Идет гражданская война. Космические корабли повстанцев, наносящие удар с тайной базы, одержали первую победу, в схватке со зловещей Галактической Империей."; $editedText =""; function makeYodaStyleText($text) { $arrayOffers = preg_split('!(\\.)|(\\!)|(\\?)!ui',$text,-1,PREG_SPLIT_NO_EMPTY); foreach ($arrayOffers as $key=>$value){ $arrayWords = preg_split("/[\s]+/",$value); $arrayWords2 = array_reverse ($arrayWords); $glue = " "; $editedText .= implode($glue,$arrayWords2); echo $editedText."1\n"; $editedText.="."; } $editedText = strtolower($text); $editedText = preg_replace('/([а-яёА-ЯЁa-z0-9«]*)(\s)([\.\,\;\:\!\?\»])/iu', '$1$3', $editedText); $editedText = preg_replace('/([\.\,\;\:\!\?\»])([а-яёА-ЯЁa-z0-9«])/iu', '$1 $2', $editedText); return $text; } $yodaText = makeYodaStyleText($text); echo "Йода говорит: {$yodaText}\n";
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $editedText in /in/8jWC9 on line 15 us found they that seems It1 us found they that seems It.late too it's before here, leave urgently must We 1 us found they that seems It.late too it's before here, leave urgently must We .fast run Let's 1 Йода говорит: It seems that they found us? We must urgently leave here, before it's too late. Let's run fast!

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:
52.31 ms | 402 KiB | 8 Q