3v4l.org

run code in 300+ PHP versions simultaneously
<?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_PATTERN_ORDER ) { echo 'Error!'; } var_dump( $urls );
Output for 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.17 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
int(1) int(2) NULL
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
int(1) Fatal error: Call to undefined function preg_last_error() in /in/WJed4 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/WJed4 on line 30
Process exited with code 255.
Output for 4.3.3 - 4.3.11, 4.4.0 - 4.4.4
int(1) Fatal error: Call to undefined function: preg_last_error() in /in/WJed4 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/WJed4 on line 28 bool(false) Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 40 in /in/WJed4 on line 29 Fatal error: Call to undefined function: preg_last_error() in /in/WJed4 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/WJed4 on line 28 bool(false) Warning: Compilation failed: characters with values > 255 are not yet supported in classes at offset 40 in /in/WJed4 on line 29 Fatal error: Call to undefined function: preg_last_error() in /in/WJed4 on line 30

preferences:
245.94 ms | 402 KiB | 337 Q