3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $result = new stdclass(); $result->introtext = "<p class=\"text_titel_ohne_autor\">Spoiler!</p>" if(strpos($result->introtext, "<p class=\"text_titel\"") !== false){ $titleStart = strpos($result->introtext, "<p class=\"text_titel\">") + 22; $titleEnd = strpos($result->introtext, "</p>", $titleStart); $result->maintitle = strip_tags(substr($result->introtext, $titleStart, $titleEnd - $titleStart)); } else if(strpos($result->introtext, "<p class=\"text_titel_ohne_autor\"") !== false){ $titleStart = strpos($result->introtext, "<p class=\"text_titel_ohne_autor\">") + 33; $titleEnd = strpos($result->introtext, "</p>", $titleStart); $result->maintitle = strip_tags(substr($result->introtext, $titleStart, $titleEnd - $titleStart)); } else if(strpos($result->introtext, "<span class=\"text_titel\">") !== false){ $titleStart = strpos($result->introtext, "<span class=\"text_titel\">") + 25; $titleEnd = strpos($result->introtext, "</span>", $titleStart); $result->maintitle = strip_tags(substr($result->introtext, $titleStart, $titleEnd - $titleStart)); }
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'if' (T_IF) in /in/6UHZR on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_IF in /in/6UHZR on line 6
Process exited with code 255.