3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parse_value_string($string) { preg_match_all('/([a-z_]+):\s+(.*),/', $string, $matches); return array_combine($matches[1], array_map(function($val) { return trim($val, '"'); }, $matches[2])); } $test = '{ refresh_token: "xxxx", access_token: "xxxx", expires_in: 21600, }'; $values = parse_value_string($test); print_r($values); /* Array ( [refresh_token] => xxxx [access_token] => xxxx [expires_in] => 21600 ) */
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [refresh_token] => xxxx [access_token] => xxxx [expires_in] => 21600 )

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:
62.09 ms | 405 KiB | 5 Q