3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text="key1=value 1 key2=value 2 key3=val 3"; var_export(array_chunk(preg_split('~=| (?=\w+=)~', $text), 2)); echo "\n---\n"; var_export(array_chunk(preg_split('~ ?(\w+)=~', $text, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE), 2));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 0 => 'key1', 1 => 'value 1', ), 1 => array ( 0 => 'key2', 1 => 'value 2', ), 2 => array ( 0 => 'key3', 1 => 'val 3', ), ) --- Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in /in/GCUq1 on line 6 array ( 0 => array ( 0 => 'key1', 1 => 'value 1', ), 1 => array ( 0 => 'key2', 1 => 'value 2', ), 2 => array ( 0 => 'key3', 1 => 'val 3', ), )

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:
55.3 ms | 402 KiB | 8 Q