3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('EFS_IFRAME', 1);define('EFS_URI', 2); $src = 'https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/156742959&color=ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false'; $efs_contents = array( EFS_IFRAME => array('regex' => '#(?:<(div|span)[^>]*>[\s]*)*<iframe[\s]*([^>]+)>[\s]*<\/iframe[^>]*>(?:[\s]*<embed[^>]*>[^<]*<\/embed[^>]*>[\s]*)*(?:<\/(?:div|span)[^>]*>)*#iu', 'callback' => 'efs_iframe_callback' ) ); $efs_params = array( EFS_IFRAME => array( 'src' => '#src[\s]*=[\s]*[\'"]([^\'"]*)[\'"]#i', 'width' => '#width[\s]*=[\s]*[\'"]([^\'"]*)[\'"]#i', 'height' => '#height[\s]*=[\s]*[\'"]([^\'"]*)[\'"]#i', 'title' => '#title[\s]*=[\s]*[\'"]([^\'"]*)[\'"]#i', 'scrolling' => '#scrolling[\s]*=[\s]*[\'"]([^\'"]*)[\'"]#i', 'frameborder' => '#frameborder[\s]*=[\s]*[\'"]([^\'"]*)[\'"]#i' /* 'allowfullscreen' => '#allowfullscreen#i' */ ), EFS_URI => array( 'url' => '#url=([^&]*)#i', 'color' => '#color=([^&]*)#i', 'autoplay' => '#autoplay=([^&]*)#i', 'hide_related' => '#hide_related=([^&]*)#i', 'show_comments' => '#show_comments=([^&]*)#i', 'show_user' => '#show_user=([^&]*)#i', 'show_reposts' => '#show_reposts=([^&]*)#i' ) ); function efs_param_decode( $str, $context=EFS_IFRAME ) { global $efs_params; $getparams = $efs_params[$context]; $params = array(); foreach ($getparams as $key => $regex) { if(preg_match($regex, $str, $output)) $params[$key] = end($output); } return $params; } var_dump($src); $v = efs_param_decode( $src, EFS_URI ); var_dump($v);
Output for git.master, git.master_jit, rfc.property-hooks
string(183) "https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/156742959&color=ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false" array(6) { ["url"]=> string(45) "https%3A//api.soundcloud.com/tracks/156742959" ["color"]=> string(6) "ff5500" ["hide_related"]=> string(5) "false" ["show_comments"]=> string(4) "true" ["show_user"]=> string(4) "true" ["show_reposts"]=> string(5) "false" }

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