3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Doplňkové služby"; $e = htmlentities($str, ENT_COMPAT, "UTF-8"); $d = html_entity_decode($e, ENT_COMPAT, "UTF-8"); print_r($e); echo "\n"; print_r($d); echo "\n\n"; $ee = _decodeAccented($e); print_r($ee); function _decodeAccented($encodedValue, $options = array()) { $options += array( 'quote' => ENT_NOQUOTES, 'encoding' => 'UTF-8', ); return preg_replace_callback( '/&\w(acute|uml|tilde);/', create_function( '$m', 'return html_entity_decode($m[0], ' . $options['quote'] . ', "' . $options['encoding'] . '");' ), $encodedValue ); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QKgh2
function name:  (null)
number of ops:  29
compiled vars:  !0 = $str, !1 = $e, !2 = $d, !3 = $ee
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Dopl%C5%88kov%C3%A9+slu%C5%BEby'
    5     1        INIT_FCALL                                               'htmlentities'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 2
          4        SEND_VAL                                                 'UTF-8'
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
    6     7        INIT_FCALL                                               'html_entity_decode'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 2
         10        SEND_VAL                                                 'UTF-8'
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
    8    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
    9    16        ECHO                                                     '%0A'
   10    17        INIT_FCALL                                               'print_r'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   12    20        ECHO                                                     '%0A%0A'
   13    21        INIT_FCALL_BY_NAME                                       '_decodeAccented'
         22        SEND_VAR_EX                                              !1
         23        DO_FCALL                                      0  $11     
         24        ASSIGN                                                   !3, $11
   14    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                                 
   31    28      > RETURN                                                   1

Function _decodeaccented:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QKgh2
function name:  _decodeAccented
number of ops:  20
compiled vars:  !0 = $encodedValue, !1 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
   19     2        ASSIGN_OP                                     1          !1, <array>
   22     3        INIT_FCALL                                               'preg_replace_callback'
   23     4        SEND_VAL                                                 '%2F%26%5Cw%28acute%7Cuml%7Ctilde%29%3B%2F'
   24     5        INIT_FCALL_BY_NAME                                       'create_function'
   25     6        SEND_VAL_EX                                              '%24m'
   26     7        FETCH_DIM_R                                      ~3      !1, 'quote'
          8        CONCAT                                           ~4      'return+html_entity_decode%28%24m%5B0%5D%2C+', ~3
          9        CONCAT                                           ~5      ~4, '%2C+%22'
   27    10        FETCH_DIM_R                                      ~6      !1, 'encoding'
         11        CONCAT                                           ~7      ~5, ~6
         12        CONCAT                                           ~8      ~7, '%22%29%3B'
         13        SEND_VAL_EX                                              ~8
         14        DO_FCALL                                      0  $9      
         15        SEND_VAR                                                 $9
   29    16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $10     
         18      > RETURN                                                   $10
   31    19*     > RETURN                                                   null

End of function _decodeaccented

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.39 ms | 1405 KiB | 24 Q