3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "don&#39;t-break-me-über"; print htmlspecialchars_decode($str, ENT_QUOTES) . PHP_EOL; print html_entity_decode($str, ENT_QUOTES) . PHP_EOL; print html_entity_decode($str, ENT_QUOTES, 'ISO-8859-1') . PHP_EOL; print html_entity_decode($str, ENT_QUOTES | ENT_XML1, 'ISO-8859-1') . PHP_EOL; print html_entity_decode($str, ENT_QUOTES, 'UTF-8') . PHP_EOL; // Decode ALL entities (double quotes (&#34;), // single quotes (&#39; + &apos;) and non printable chars (e.g. &#13;)) print html_entity_decode($str, ENT_QUOTES | ENT_XML1, 'UTF-8') . PHP_EOL; // Convert &#[0-9]+ entities to UTF-8 $new = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $str); print $new . PHP_EOL; // Convert &#[0-9]+ entities to ISO-8859-1 $new2 = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "ISO-8859-1", "HTML-ENTITIES"); }, $str); print $new2 . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/27kar
function name:  (null)
number of ops:  60
compiled vars:  !0 = $str, !1 = $new, !2 = $new2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'don%26%2339%3Bt-break-me-%C3%BCber'
    5     1        INIT_FCALL                                               'htmlspecialchars_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 3
          4        DO_ICALL                                         $4      
          5        CONCAT                                           ~5      $4, '%0A'
          6        ECHO                                                     ~5
    6     7        INIT_FCALL                                               'html_entity_decode'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 3
         10        DO_ICALL                                         $6      
         11        CONCAT                                           ~7      $6, '%0A'
         12        ECHO                                                     ~7
    8    13        INIT_FCALL                                               'html_entity_decode'
         14        SEND_VAR                                                 !0
         15        SEND_VAL                                                 3
         16        SEND_VAL                                                 'ISO-8859-1'
         17        DO_ICALL                                         $8      
         18        CONCAT                                           ~9      $8, '%0A'
         19        ECHO                                                     ~9
   10    20        INIT_FCALL                                               'html_entity_decode'
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 19
         23        SEND_VAL                                                 'ISO-8859-1'
         24        DO_ICALL                                         $10     
         25        CONCAT                                           ~11     $10, '%0A'
         26        ECHO                                                     ~11
   12    27        INIT_FCALL                                               'html_entity_decode'
         28        SEND_VAR                                                 !0
         29        SEND_VAL                                                 3
         30        SEND_VAL                                                 'UTF-8'
         31        DO_ICALL                                         $12     
         32        CONCAT                                           ~13     $12, '%0A'
         33        ECHO                                                     ~13
   16    34        INIT_FCALL                                               'html_entity_decode'
         35        SEND_VAR                                                 !0
         36        SEND_VAL                                                 19
         37        SEND_VAL                                                 'UTF-8'
         38        DO_ICALL                                         $14     
         39        CONCAT                                           ~15     $14, '%0A'
         40        ECHO                                                     ~15
   19    41        INIT_FCALL                                               'preg_replace_callback'
         42        SEND_VAL                                                 '%2F%28%26%23%5B0-9%5D%2B%3B%29%2F'
         43        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F27kar%3A19%240'
   21    44        SEND_VAL                                                 ~16
         45        SEND_VAR                                                 !0
         46        DO_ICALL                                         $17     
   19    47        ASSIGN                                                   !1, $17
   22    48        CONCAT                                           ~19     !1, '%0A'
         49        ECHO                                                     ~19
   25    50        INIT_FCALL                                               'preg_replace_callback'
         51        SEND_VAL                                                 '%2F%28%26%23%5B0-9%5D%2B%3B%29%2F'
         52        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F27kar%3A25%241'
   27    53        SEND_VAL                                                 ~20
         54        SEND_VAR                                                 !0
         55        DO_ICALL                                         $21     
   25    56        ASSIGN                                                   !2, $21
   28    57        CONCAT                                           ~23     !2, '%0A'
         58        ECHO                                                     ~23
         59      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F27kar%3A19%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/27kar
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        INIT_FCALL                                               'mb_convert_encoding'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        SEND_VAL                                                 'UTF-8'
          5        SEND_VAL                                                 'HTML-ENTITIES'
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   21     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F27kar%3A19%240

Function %00%7Bclosure%7D%2Fin%2F27kar%3A25%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/27kar
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        INIT_FCALL                                               'mb_convert_encoding'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        SEND_VAL                                                 'ISO-8859-1'
          5        SEND_VAL                                                 'HTML-ENTITIES'
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   27     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F27kar%3A25%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.6 ms | 1400 KiB | 21 Q