3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * DO NOT USE IN PRODUCTION */ function link_urls( $str ) { $linked = ''; $words = explode( ' ', $str ); foreach ( $words as &$word ) { if ( false === strpos( $word, '://' ) ) { continue; } $last_char = mb_substr( $word, -1 ); preg_match( '/[^a-zA-Z0-9\/]/', $last_char, $match ); $extra = ( $match ) ? $last_char : ''; $word = sprintf( '<a href="%1$s">%1$s</a>%2$s', ( '' === $extra ) ? $word : mb_substr( $word, 0, -1 ), $extra ); } return implode( ' ', $words ); } // Not this, keep scrolling. $body = <<<EOD Hello, This is the body of the email. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com/. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com/index.php. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com/index.php?why=whoknows. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com:80. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com/#welcome. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com/! No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com/- No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com/? No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com/: No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at http://example.com/; No further action is needed on your part. Regards, Email Service EOD; echo link_urls( $body );
Output for git.master, git.master_jit, rfc.property-hooks
Hello, This is the body of the email. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com">http://example.com</a>. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com/">http://example.com/</a>. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com/index.php">http://example.com/index.php</a>. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com/index.php?why=whoknows">http://example.com/index.php?why=whoknows</a>. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com:80">http://example.com:80</a>. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com/#welcome">http://example.com/#welcome</a>. No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com/">http://example.com/</a>! No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com/">http://example.com/</a>- No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com/">http://example.com/</a>? No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com/">http://example.com/</a>: No further action is needed on your part. Howdy! Some plugins and themes have automatically updated to their latest versions on your site at <a href="http://example.com/">http://example.com/</a>; No further action is needed on your part. Regards, Email Service

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:
76.31 ms | 415 KiB | 5 Q