3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA Main{ NetworkAccess 1; MaxCPE 6; MaxClassifiers 20; GlobalPrivacyEnable 1; BaselinePrivacy{ AuthTimeout 10; ReAuthTimeout 10; AuthGraceTime 600; OperTimeout 10; ReKeyTimeout 10; TEKGraceTime 600; AuthRejectTimeout 60; SAMapWaitTimeout 1; SAMapMaxRetries 4; } UsServiceFlow{ UsServiceFlowRef 1; QosParamSetType 7; TrafficPriority 2; MaxRateSustained 1000000; SchedulingType 2; MaxTrafficBurst 8000; MaxConcatenatedBurst 8000; } DsServiceFlow{ DsServiceFlowRef 101; QosParamSetType 7; TrafficPriority 2; MaxRateSustained 10000000; } } DATA; function processItems($items, &$current, &$parent) { $item = trim(array_shift($items)); if ($item) { if (substr($item, -1) === '{') { $key = rtrim($item, '{'); $current[$key] = []; processItems($items, $current[$key], $parent); return; } if (trim($item) === '}') { processItems($items, $parent, $parent); return; } $parts = explode(' ', $item); $current[$parts[0]] = rtrim($parts[1], ';'); processItems($items, $current, $parent); } } $curr = []; processItems(explode("\n", $data), $curr, $curr); print_r($curr);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /in/2XmSV on line 39 Array ( [Main] => Array ( [NetworkAccess] => 1 [MaxCPE] => 6 [MaxClassifiers] => 20 [GlobalPrivacyEnable] => 1 [BaselinePrivacy] => Array ( [AuthTimeout] => 10 [ReAuthTimeout] => 10 [AuthGraceTime] => 600 [OperTimeout] => 10 [ReKeyTimeout] => 10 [TEKGraceTime] => 600 [AuthRejectTimeout] => 60 [SAMapWaitTimeout] => 1 [SAMapMaxRetries] => 4 ) ) [UsServiceFlow] => Array ( [UsServiceFlowRef] => 1 [QosParamSetType] => 7 [TrafficPriority] => 2 [MaxRateSustained] => 1000000 [SchedulingType] => 2 [MaxTrafficBurst] => 8000 [MaxConcatenatedBurst] => 8000 ) [DsServiceFlow] => Array ( [DsServiceFlowRef] => 101 [QosParamSetType] => 7 [TrafficPriority] => 2 [MaxRateSustained] => 10000000 ) )

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:
113.71 ms | 409 KiB | 5 Q