3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "[1,1x,1x,1x][2,2x,2x,2x]"; $arr = ""; preg_replace_callback('/\[(.*?)\]/', function($m) use (&$arr){ $arr[] = explode(',',preg_replace('/([\w]+)/', "[$1]", $m[1])); }, $str); print_r($arr); var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: [] operator not supported for strings in /in/Ye983:6 Stack trace: #0 [internal function]: {closure}(Array) #1 /in/Ye983(5): preg_replace_callback('/\\[(.*?)\\]/', Object(Closure), '[1,1x,1x,1x][2,...') #2 {main} thrown in /in/Ye983 on line 6
Process exited with code 255.

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:
54.7 ms | 401 KiB | 8 Q