3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lines = [ '"#InstaFamous: How to Become Famous on Instagram" (2013) 2013-????', '"#1 Single" (2006) {The Rules of Dating (#1.3)} 2006', '"WWE Velocity" (2002) {(2005-11-05)} 2005', '"#Follow" (2011) 2011-????', '"!Next?" (1994) 1994-1995', ]; foreach ($lines as $key => $line) { preg_match('~ ("?(?<showTitle>.*?)"?) \s \((?<showDate>\d{4})\) ([^{}\d]+) ( ({\(.*?\)}) | ({ (?<partTitle>.*?)? (\( \#(?<season>\d+)\.(?<episode>\d+) \))? }) )? \s? (?<partDate>([\d\-\?]+)) ~misx', $line, $data); foreach($data as $key => $value) if(is_int($key)) unset($data[$key]); var_dump($line, $data); }
Output for git.master, git.master_jit, rfc.property-hooks
string(66) ""#InstaFamous: How to Become Famous on Instagram" (2013) 2013-????" array(6) { ["showTitle"]=> string(47) "#InstaFamous: How to Become Famous on Instagram" ["showDate"]=> string(4) "2013" ["partTitle"]=> string(0) "" ["season"]=> string(0) "" ["episode"]=> string(0) "" ["partDate"]=> string(9) "2013-????" } string(52) ""#1 Single" (2006) {The Rules of Dating (#1.3)} 2006" array(6) { ["showTitle"]=> string(9) "#1 Single" ["showDate"]=> string(4) "2006" ["partTitle"]=> string(20) "The Rules of Dating " ["season"]=> string(1) "1" ["episode"]=> string(1) "3" ["partDate"]=> string(4) "2006" } string(41) ""WWE Velocity" (2002) {(2005-11-05)} 2005" array(6) { ["showTitle"]=> string(12) "WWE Velocity" ["showDate"]=> string(4) "2002" ["partTitle"]=> string(0) "" ["season"]=> string(0) "" ["episode"]=> string(0) "" ["partDate"]=> string(4) "2005" } string(26) ""#Follow" (2011) 2011-????" array(6) { ["showTitle"]=> string(7) "#Follow" ["showDate"]=> string(4) "2011" ["partTitle"]=> string(0) "" ["season"]=> string(0) "" ["episode"]=> string(0) "" ["partDate"]=> string(9) "2011-????" } string(25) ""!Next?" (1994) 1994-1995" array(6) { ["showTitle"]=> string(6) "!Next?" ["showDate"]=> string(4) "1994" ["partTitle"]=> string(0) "" ["season"]=> string(0) "" ["episode"]=> string(0) "" ["partDate"]=> string(9) "1994-1995" }

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:
38.89 ms | 404 KiB | 8 Q