3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<TEXT <div class="myclass" id="id123" data-foo="bar">content</div> <div class="myclass" id="id123" data-foo="bar" >content</div> <div class="myclass" id="id123" data-foo="bar" data-baz="qux">content</div> <div class="myclass" id="id123" data-foo="bar" data-baz="qux" >content</div> TEXT; preg_match_all('~<div class="myclass" id="(.*?)" data-foo="(.*?)" ?(?:data-baz="(.*?)" ?)?>~', $text, $matches); var_export(array_slice($matches, 1));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 0 => 'id123', 1 => 'id123', 2 => 'id123', 3 => 'id123', ), 1 => array ( 0 => 'bar', 1 => 'bar', 2 => 'bar', 3 => 'bar', ), 2 => array ( 0 => '', 1 => '', 2 => 'qux', 3 => 'qux', ), )

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:
97.5 ms | 406 KiB | 5 Q