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; } function efs_extendstr( $params, $add_common=true ) { $_extend = ""; foreach ($params as $paramkey => $paramvalue) { if ($paramkey != 'src') $_extend .= " $paramkey=\"$paramvalue\""; } if ($add_common) $_extend .= ' webkitallowfullscreen mozallowfullscreen allowfullscreen'; return $_extend;} var_dump($src); $p = efs_param_decode( $src, EFS_URI ); var_dump($p); $s = efs_extendstr( $p, false); var_dump($s);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aMmgt
function name:  (null)
number of ops:  38
compiled vars:  !0 = $src, !1 = $efs_contents, !2 = $efs_params, !3 = $p, !4 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'EFS_IFRAME'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
          4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'EFS_URI'
          6        SEND_VAL                                                 2
          7        DO_ICALL                                                 
    4     8        ASSIGN                                                   !0, 'https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttps%253A%2F%2Fapi.soundcloud.com%2Ftracks%2F156742959%26color%3Dff5500%26auto_play%3Dfalse%26hide_related%3Dfalse%26show_comments%3Dtrue%26show_user%3Dtrue%26show_reposts%3Dfalse'
    5     9        FETCH_CONSTANT                                   ~8      'EFS_IFRAME'
         10        INIT_ARRAY                                       ~9      <array>, ~8
         11        ASSIGN                                                   !1, ~9
    6    12        FETCH_CONSTANT                                   ~11     'EFS_IFRAME'
         13        INIT_ARRAY                                       ~12     <array>, ~11
         14        FETCH_CONSTANT                                   ~13     'EFS_URI'
         15        ADD_ARRAY_ELEMENT                                ~12     <array>, ~13
         16        ASSIGN                                                   !2, ~12
   16    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
   17    20        INIT_FCALL                                               'efs_param_decode'
         21        SEND_VAR                                                 !0
         22        FETCH_CONSTANT                                   ~16     'EFS_URI'
         23        SEND_VAL                                                 ~16
         24        DO_FCALL                                      0  $17     
         25        ASSIGN                                                   !3, $17
   18    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                                 
   19    29        INIT_FCALL                                               'efs_extendstr'
         30        SEND_VAR                                                 !3
         31        SEND_VAL                                                 <false>
         32        DO_FCALL                                      0  $20     
         33        ASSIGN                                                   !4, $20
   20    34        INIT_FCALL                                               'var_dump'
         35        SEND_VAR                                                 !4
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Function efs_param_decode:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 21
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 20
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 20
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/aMmgt
function name:  efs_param_decode
number of ops:  24
compiled vars:  !0 = $str, !1 = $context, !2 = $efs_params, !3 = $getparams, !4 = $params, !5 = $regex, !6 = $key, !7 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <const ast>
    8     2        BIND_GLOBAL                                              !2, 'efs_params'
    9     3        FETCH_DIM_R                                      ~8      !2, !1
          4        ASSIGN                                                   !3, ~8
   10     5        ASSIGN                                                   !4, <array>
   11     6      > FE_RESET_R                                       $11     !3, ->21
          7    > > FE_FETCH_R                                       ~12     $11, !5, ->21
          8    >   ASSIGN                                                   !6, ~12
   12     9        INIT_FCALL                                               'preg_match'
         10        SEND_VAR                                                 !5
         11        SEND_VAR                                                 !0
         12        SEND_REF                                                 !7
         13        DO_ICALL                                         $14     
         14      > JMPZ                                                     $14, ->20
         15    >   INIT_FCALL                                               'end'
         16        SEND_REF                                                 !7
         17        DO_ICALL                                         $16     
         18        ASSIGN_DIM                                               !4, !6
         19        OP_DATA                                                  $16
   11    20    > > JMP                                                      ->7
         21    >   FE_FREE                                                  $11
   13    22      > RETURN                                                   !4
   14    23*     > RETURN                                                   null

End of function efs_param_decode

Function efs_extendstr:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 15
filename:       /in/aMmgt
function name:  efs_extendstr
number of ops:  20
compiled vars:  !0 = $params, !1 = $add_common, !2 = $_extend, !3 = $paramvalue, !4 = $paramkey
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <true>
          2        ASSIGN                                                   !2, ''
          3      > FE_RESET_R                                       $6      !0, ->15
          4    > > FE_FETCH_R                                       ~7      $6, !3, ->15
          5    >   ASSIGN                                                   !4, ~7
          6        IS_NOT_EQUAL                                             !4, 'src'
          7      > JMPZ                                                     ~9, ->14
          8    >   ROPE_INIT                                     5  ~11     '+'
          9        ROPE_ADD                                      1  ~11     ~11, !4
         10        ROPE_ADD                                      2  ~11     ~11, '%3D%22'
         11        ROPE_ADD                                      3  ~11     ~11, !3
         12        ROPE_END                                      4  ~10     ~11, '%22'
         13        ASSIGN_OP                                     8          !2, ~10
         14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $6
         16      > JMPZ                                                     !1, ->18
         17    >   ASSIGN_OP                                     8          !2, '+webkitallowfullscreen+mozallowfullscreen+allowfullscreen'
         18    > > RETURN                                                   !2
         19*     > RETURN                                                   null

End of function efs_extendstr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.26 ms | 1398 KiB | 23 Q