3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($str){ var_dump($str); var_dump( preg_match_all( '{^(https?://)?([^/\n]+)}', $str, $matches ) ); var_dump($matches); } $strArray = [ 'http://www.answers.com/article/1194427/8-habits-of-extraordinarily-likeable-people', 'https://www.apple.com', 'https://www.apple .com', 'https://www.apple', 'http://www.cnn.com.au', 'http://downloads.news.com.au', 'http://ftp.android.co.nz', 'http://global.news.ca', 'http://www.apple.com', 'apple.com', 'www.apple.com', ]; foreach($strArray as $str){ foo($str); }
Output for git.master_jit, git.master, rfc.property-hooks
string(82) "http://www.answers.com/article/1194427/8-habits-of-extraordinarily-likeable-people" int(1) array(3) { [0]=> array(1) { [0]=> string(22) "http://www.answers.com" } [1]=> array(1) { [0]=> string(7) "http://" } [2]=> array(1) { [0]=> string(15) "www.answers.com" } } string(21) "https://www.apple.com" int(1) array(3) { [0]=> array(1) { [0]=> string(21) "https://www.apple.com" } [1]=> array(1) { [0]=> string(8) "https://" } [2]=> array(1) { [0]=> string(13) "www.apple.com" } } string(22) "https://www.apple .com" int(1) array(3) { [0]=> array(1) { [0]=> string(17) "https://www.apple" } [1]=> array(1) { [0]=> string(8) "https://" } [2]=> array(1) { [0]=> string(9) "www.apple" } } string(17) "https://www.apple" int(1) array(3) { [0]=> array(1) { [0]=> string(17) "https://www.apple" } [1]=> array(1) { [0]=> string(8) "https://" } [2]=> array(1) { [0]=> string(9) "www.apple" } } string(21) "http://www.cnn.com.au" int(1) array(3) { [0]=> array(1) { [0]=> string(21) "http://www.cnn.com.au" } [1]=> array(1) { [0]=> string(7) "http://" } [2]=> array(1) { [0]=> string(14) "www.cnn.com.au" } } string(28) "http://downloads.news.com.au" int(1) array(3) { [0]=> array(1) { [0]=> string(28) "http://downloads.news.com.au" } [1]=> array(1) { [0]=> string(7) "http://" } [2]=> array(1) { [0]=> string(21) "downloads.news.com.au" } } string(24) "http://ftp.android.co.nz" int(1) array(3) { [0]=> array(1) { [0]=> string(24) "http://ftp.android.co.nz" } [1]=> array(1) { [0]=> string(7) "http://" } [2]=> array(1) { [0]=> string(17) "ftp.android.co.nz" } } string(21) "http://global.news.ca" int(1) array(3) { [0]=> array(1) { [0]=> string(21) "http://global.news.ca" } [1]=> array(1) { [0]=> string(7) "http://" } [2]=> array(1) { [0]=> string(14) "global.news.ca" } } string(20) "http://www.apple.com" int(1) array(3) { [0]=> array(1) { [0]=> string(20) "http://www.apple.com" } [1]=> array(1) { [0]=> string(7) "http://" } [2]=> array(1) { [0]=> string(13) "www.apple.com" } } string(9) "apple.com" int(1) array(3) { [0]=> array(1) { [0]=> string(9) "apple.com" } [1]=> array(1) { [0]=> string(0) "" } [2]=> array(1) { [0]=> string(9) "apple.com" } } string(13) "www.apple.com" int(1) array(3) { [0]=> array(1) { [0]=> string(13) "www.apple.com" } [1]=> array(1) { [0]=> string(0) "" } [2]=> array(1) { [0]=> string(13) "www.apple.com" } }

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:
46.58 ms | 409 KiB | 8 Q