3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if(!function_exists(cutstringgf)) { function cutstringgf($stranb, $lengthanb, $theend = "... ") { $stranb = strip_tags($stranb); if (strlen($stranb) > 80) { $text2 = substr($stranb, 0, $lengthanb); $words = explode(" ", $text2); $words = array_reverse($words); array_splice($words, 0, 1); $alexxnb = 0; for ($i = 0; $i < count($words); $i++) { $i = $i - $alexxnb; if (substr($words[$i], - 1) == "," or substr($words[$i], - 1) == "." or substr($words[$i], - 1) == ":" or substr($words[$i], - 1) == ";") { $words[$i] = substr($words[$i], 0, strlen($words[$i]) - 1); } ; $wrd = $words[$i]; if (strlen($wrd) < 4) { array_splice($words, $i, 1); $alexxnb = 1; } else { $i = 1985; } ; } ; $mwords = ""; $words = array_reverse($words); for ($i = 0; $i < count($words); $i++) { $mwords = $mwords . $words[$i]; if ($i != count($words) - 1) { $mwords = $mwords . " "; } else { $mwords = $mwords . $theend; } ; } ; } else { $mwords = $stranb; } echo $mwords; } } $txt = $modx->getDocument($iddoc); $source = '<p>Seth Kimbrough стал совсем модненьким, знатоки помнят с каких "диванов" он начинал. Приятно смотреть на его катание в любом обличии. Катается не в напряг и это чувствуется после просмотра любого видео. Эта реклама <a title="shadow" href="brands/shadow_conspiracy_bmx.html" target="_blank">Shadow</a> - не исключение. Здорово!</p> <p>&nbsp;</p>'; echo cutstringgf(stripslashes(preg_replace("/<img(.*?)\>/", "", preg_replace('/<span[^>]*>(.*)<\/span>/Ui', '\\1', $source))), 350); ?>
Output for 7.0.5 - 7.1.0
Notice: Use of undefined constant cutstringgf - assumed 'cutstringgf' in /in/tikQK on line 2 Notice: Undefined variable: modx in /in/tikQK on line 54 Fatal error: Uncaught Error: Call to a member function getDocument() on null in /in/tikQK:54 Stack trace: #0 {main} thrown in /in/tikQK on line 54
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Notice: Use of undefined constant cutstringgf - assumed 'cutstringgf' in /in/tikQK on line 2 Notice: Undefined variable: modx in /in/tikQK on line 54 Fatal error: Uncaught Error: Call to a member function getDocument() on unknown in /in/tikQK:54 Stack trace: #0 {main} thrown in /in/tikQK on line 54
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Use of undefined constant cutstringgf - assumed 'cutstringgf' in /in/tikQK on line 2 Notice: Undefined variable: modx in /in/tikQK on line 54 Fatal error: Call to a member function getDocument() on null in /in/tikQK on line 54
Process exited with code 255.
Output for 5.0.4 - 5.5.35
Notice: Use of undefined constant cutstringgf - assumed 'cutstringgf' in /in/tikQK on line 2 Notice: Undefined variable: modx in /in/tikQK on line 54 Fatal error: Call to a member function getDocument() on a non-object in /in/tikQK on line 54
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Use of undefined constant cutstringgf - assumed 'cutstringgf' in /in/tikQK on line 2 Notice: Undefined variable: modx in /in/tikQK on line 54 Fatal error: Call to a member function getDocument() on a non-object in /in/tikQK on line 54
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Use of undefined constant cutstringgf - assumed 'cutstringgf' in /in/tikQK on line 2 Fatal error: Call to a member function on a non-object in /in/tikQK on line 54
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant cutstringgf - assumed 'cutstringgf' in /in/tikQK on line 2 Fatal error: Call to a member function on a non-object in /in/tikQK on line 54