3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fullURLSample = /*str_replace( "\r", '',*/ 'https://www.facebook.com/dialog/feed?app_id={app_id}&link={url}&picture={img}&name={title}&description={desc}&redirect_uri={redirect_url} https://twitter.com/share?url={url}&text={title}&via={via}&hashtags={hashtags} https://plus.google.com/share?url={url} https://pinterest.com/pin/create/bookmarklet/?media={img}&url={url}&is_video={is_video}&description={title} http://www.youtube.com/watch?v=uMdl80k-3yo https://vimeo.com/391720 https://www.flickr.com/photos/eshu/galleries/72157621948084368/ http://picasa.google.com.au/ http://instagram.com/username111 https://foursquare.com/explore?cat=food&mode=url&near=Wollongong%2C%20NSW http://every1-knows-its-butters.tumblr.com/ http://www.tumblr.com/share/link?url={url}&name={title}&description={desc} skype://notsurewhatgoeshere https://soundcloud.com/iambrodydalle http://www.linkedin.com/shareArticle?url={url}&title={title} https://github.com/chrisburgess7 http://dribbble.com/MailChimp https://itunes.apple.com/au/podcast/the-history-of-britain/id802163163?mt=2'; $urlRegex1 = '_' . '(?:(?:https?)://)' . '(?>[a-z\x{00a1}-\x{ffff}0-9]+-?)*\.?'; $urlRegex2 = '(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*' . // domain name '(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,}))' . // TLD identifier '(?::\d{2,5})?(?:/[^\s]*)?' . // rest of path '_iuS'; var_dump( preg_match( $urlRegex1 . 'facebook' . $urlRegex2, $fullURLSample ) ); $urls = preg_replace( $urlRegex1 . 'facebook' . $urlRegex2, 'http://www.facebook.com', $fullURLSample ); $err = preg_last_error(); var_dump( $err ); if ( $err === PREG_BACKTRACK_LIMIT_ERROR ) { echo 'Error!'; } var_dump( $urls );
Output for 5.2.0 - 7.1.0
int(1) int(0) string(902) "http://www.facebook.com https://twitter.com/share?url={url}&text={title}&via={via}&hashtags={hashtags} https://plus.google.com/share?url={url} https://pinterest.com/pin/create/bookmarklet/?media={img}&url={url}&is_video={is_video}&description={title} http://www.youtube.com/watch?v=uMdl80k-3yo https://vimeo.com/391720 https://www.flickr.com/photos/eshu/galleries/72157621948084368/ http://picasa.google.com.au/ http://instagram.com/username111 https://foursquare.com/explore?cat=food&mode=url&near=Wollongong%2C%20NSW http://every1-knows-its-butters.tumblr.com/ http://www.tumblr.com/share/link?url={url}&name={title}&description={desc} skype://notsurewhatgoeshere https://soundcloud.com/iambrodydalle http://www.linkedin.com/shareArticle?url={url}&title={title} https://github.com/chrisburgess7 http://dribbble.com/MailChimp https://itunes.apple.com/au/podcast/the-history-of-britain/id802163163?mt=2"
Output for 5.0.0 - 5.1.6
int(1) Fatal error: Call to undefined function preg_last_error() in /in/cUjY9 on line 30
Process exited with code 255.
Output for 4.4.5 - 4.4.9
int(1) Fatal error: Call to undefined function: preg_last_error() in /in/cUjY9 on line 30
Process exited with code 255.
Output for 4.3.3 - 4.4.4
int(1) Fatal error: Call to undefined function: preg_last_error() in /in/cUjY9 on line 30
Process exited with code 255.
Output for 4.3.2
Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 40 in /in/cUjY9 on line 28 bool(false) Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 40 in /in/cUjY9 on line 29 Fatal error: Call to undefined function: preg_last_error() in /in/cUjY9 on line 30
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 40 in /in/cUjY9 on line 28 bool(false) Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 40 in /in/cUjY9 on line 29 Fatal error: Call to undefined function: preg_last_error() in /in/cUjY9 on line 30