3v4l.org

run code in 300+ PHP versions simultaneously
<?php function wp_kses_split( $string, $allowed_html, $allowed_protocols ) { global $pass_allowed_html, $pass_allowed_protocols; $pass_allowed_html = $allowed_html; $pass_allowed_protocols = $allowed_protocols; return preg_replace_callback( '%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%', '_wp_kses_split_callback', $string ); } function _wp_kses_split_callback( $match ) { global $pass_allowed_html, $pass_allowed_protocols; return wp_kses_split2( $match[1], $pass_allowed_html, $pass_allowed_protocols ); } function wp_kses_split2($string, $allowed_html, $allowed_protocols) { wp_kses_split('', array(), array()); // this overrides the globals. print_r( array( $allowed_html, $allowed_protocols ) ); } wp_kses_split("<a style='color: red;'>I link this</a>", array('a'=>array( 'style' => array() )), array('http') );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YmYTZ
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'wp_kses_split'
          1        SEND_VAL                                                 '%3Ca+style%3D%27color%3A+red%3B%27%3EI+link+this%3C%2Fa%3E'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 <array>
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function wp_kses_split:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YmYTZ
function name:  wp_kses_split
number of ops:  14
compiled vars:  !0 = $string, !1 = $allowed_html, !2 = $allowed_protocols, !3 = $pass_allowed_html, !4 = $pass_allowed_protocols
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        BIND_GLOBAL                                              !3, 'pass_allowed_html'
          4        BIND_GLOBAL                                              !4, 'pass_allowed_protocols'
    5     5        ASSIGN                                                   !3, !1
    6     6        ASSIGN                                                   !4, !2
    7     7        INIT_FCALL                                               'preg_replace_callback'
          8        SEND_VAL                                                 '%25%28%28%3C%21--.%2A%3F%28--%3E%7C%24%29%29%7C%28%3C%5B%5E%3E%5D%2A%28%3E%7C%24%29%7C%3E%29%29%25'
          9        SEND_VAL                                                 '_wp_kses_split_callback'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $7      
         12      > RETURN                                                   $7
    8    13*     > RETURN                                                   null

End of function wp_kses_split

Function _wp_kses_split_callback:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YmYTZ
function name:  _wp_kses_split_callback
number of ops:  12
compiled vars:  !0 = $match, !1 = $pass_allowed_html, !2 = $pass_allowed_protocols
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        BIND_GLOBAL                                              !1, 'pass_allowed_html'
          2        BIND_GLOBAL                                              !2, 'pass_allowed_protocols'
   11     3        INIT_FCALL_BY_NAME                                       'wp_kses_split2'
          4        CHECK_FUNC_ARG                                           
          5        FETCH_DIM_FUNC_ARG                               $3      !0, 1
          6        SEND_FUNC_ARG                                            $3
          7        SEND_VAR_EX                                              !1
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $4      
         10      > RETURN                                                   $4
   12    11*     > RETURN                                                   null

End of function _wp_kses_split_callback

Function wp_kses_split2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YmYTZ
function name:  wp_kses_split2
number of ops:  14
compiled vars:  !0 = $string, !1 = $allowed_html, !2 = $allowed_protocols
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   15     3        INIT_FCALL                                               'wp_kses_split'
          4        SEND_VAL                                                 ''
          5        SEND_VAL                                                 <array>
          6        SEND_VAL                                                 <array>
          7        DO_FCALL                                      0          
   16     8        INIT_FCALL                                               'print_r'
          9        INIT_ARRAY                                       ~4      !1
         10        ADD_ARRAY_ELEMENT                                ~4      !2
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                                 
   17    13      > RETURN                                                   null

End of function wp_kses_split2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.84 ms | 1403 KiB | 19 Q