3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sepChmp = '`'; $dlmtTxt = '§'; $sepLigne = "\v"; $chaines = '§Laurent TOGIER§`§19\` Rue Bréa§`75006`PARIS'. $sepLigne . 'Laurent TOGIER`§\` Rue Bréa§`75006`PARIS'. $sepLigne . 'Laurent TOGIER`§19\`§`75006`PARIS'. $sepLigne . 'Laurent TOGIER`§\`§`75006`PARIS'. $sepLigne . 'Laurent TOGIER`§19\` Rue\` Bréa§`75006`PARIS '. $sepLigne . 'Laurent TOGIER`§\`\`§`75006`PARIS'. $sepLigne . '§il a dit §§aie§§ ` en \\criant§'; $lignes = []; $regexp = sprintf( '#(?<![%1$s\\\])%1$s(?!%1$s)(?<data>.*?)(?<![%1$s\\\])%1$s(?<sep>[%2$s%3$s]|$)|(?<data>[^%2$s%3$s]*)(?<sep>[%2$s%3$s]|$)#Jus', $dlmtTxt, $sepChmp, $sepLigne ); if( preg_match_all($regexp, $chaines, $matches, PREG_SET_ORDER) ) { $ligne = []; foreach($matches as $match) { $ligne[] = stripslashes(str_replace(["\\$dlmtTxt", "$dlmtTxt$dlmtTxt"], $dlmtTxt, $match['data'])); if($match['sep'] !== $sepChmp && count(array_filter($ligne))) { $lignes[] = $ligne; $ligne = []; } } } var_dump($lignes);
Output for git.master, git.master_jit, rfc.property-hooks
array(7) { [0]=> array(4) { [0]=> string(14) "Laurent TOGIER" [1]=> string(13) "19` Rue Bréa" [2]=> string(5) "75006" [3]=> string(5) "PARIS" } [1]=> array(4) { [0]=> string(14) "Laurent TOGIER" [1]=> string(11) "` Rue Bréa" [2]=> string(5) "75006" [3]=> string(5) "PARIS" } [2]=> array(4) { [0]=> string(14) "Laurent TOGIER" [1]=> string(3) "19`" [2]=> string(5) "75006" [3]=> string(5) "PARIS" } [3]=> array(4) { [0]=> string(14) "Laurent TOGIER" [1]=> string(1) "`" [2]=> string(5) "75006" [3]=> string(5) "PARIS" } [4]=> array(4) { [0]=> string(14) "Laurent TOGIER" [1]=> string(14) "19` Rue` Bréa" [2]=> string(5) "75006" [3]=> string(6) "PARIS " } [5]=> array(4) { [0]=> string(14) "Laurent TOGIER" [1]=> string(2) "``" [2]=> string(5) "75006" [3]=> string(5) "PARIS" } [6]=> array(1) { [0]=> string(28) "il a dit §aie§ ` en criant" } }

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:
25.53 ms | 403 KiB | 8 Q