3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseErrorMessage($string) { $pairs=array_chunk(preg_split('/\R*(Error \w+) - /',$string,NULL,PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE),2); return array_combine(array_column($pairs,0),array_column($pairs,1)); } $string ="Error Type - Database Error Message - Error Executing Database Something is wrong. Error Detail - [Macromedia] [SQLServer JDBC Driver] [SQLServer]Incorrect syntax near '1'."; var_export(parseErrorMessage($string));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated in /in/UECG1 on line 3 array ( 'Error Type' => 'Database', 'Error Message' => 'Error Executing Database Something is wrong.', 'Error Detail' => '[Macromedia] [SQLServer JDBC Driver] [SQLServer]Incorrect syntax near \'1\'.', )

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