3v4l.org

run code in 300+ PHP versions simultaneously
<?php class DudenResponse { protected $response; public function __construct($response) { $this->response = $response; $this ->stripShit() ->decode() ->mockXML(); } protected function stripShit() { $this->response = substr($this->response, 36-1); return $this; } protected function decode() { $response = preg_replace("/\\\\u([0-9a-f]{3,4})/i", "&#x\\1;", $this->response); $this->response = html_entity_decode($response, null, 'UTF-8'); return $this; } protected function mockXML() { $this->response = str_replace([ '<?dpf ', ' ?>', '?>' ], [ '<', '>', '>' ], $this->response); return $this; } public function get() { return $this->response; } public function __toString() { return $this->get(); } } $response = "0;78d13qqoglyszmorspfwfdmwffgnubgr;\u003c?dpf sent len=\"1\"?\u003e\u003c?dpf orth code=\"unknown\" prop=\"Lesen;Lehnen;Lehren;Leasen;Leisen\" ?\u003elehsen\u003c?dpf /orth ?\u003e\u003c?dpf /sent ?\u003e"; /*$response = preg_replace("/\\\\u([0-9a-f]{3,4})/i", "&#x\\1;", $response); $response = html_entity_decode($response , null, 'UTF-8'); $response = str_replace([ '<?dpf ', ' ?>', '?>' ], [ '<', '>', '>' ], $response); $response = substr($response, 36-1);*/ $response = new DudenResponse($response); echo $response; echo "\n"; $xml = simplexml_load_string($response); foreach ($xml as $node) { echo $node . " => "; print_r(explode(';', $node->attributes()['prop'])); echo "\n\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: html_entity_decode(): Passing null to parameter #2 ($flags) of type int is deprecated in /in/p2vil on line 25 <sent len="1"><orth code="unknown" prop="Lesen;Lehnen;Lehren;Leasen;Leisen">lehsen</orth></sent> lehsen => Array ( [0] => Lesen [1] => Lehnen [2] => Lehren [3] => Leasen [4] => Leisen )

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