3v4l.org

run code in 500+ PHP versions simultaneously
<?php $json = array( "Sample" => array( "context" => 'جمهوری اسلامی ایران', "test" => '\u1234', ) ); $encoded = json_encode($json); var_dump($encoded); $unescaped = preg_replace_callback('/(?<!\\\\)\\\\u(\w{4})/', function ($matches) { return html_entity_decode('&#x' . $matches[1] . ';', ENT_COMPAT, 'UTF-8'); }, $encoded); var_dump($unescaped);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XslFJ
function name:  (null)
number of ops:  19
compiled vars:  !0 = $json, !1 = $encoded, !2 = $unescaped
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        INIT_FCALL                                                   'json_encode'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $4      
          4        ASSIGN                                                       !1, $4
   11     5        INIT_FCALL                                                   'var_dump'
          6        SEND_VAR                                                     !1
          7        DO_ICALL                                                     
   13     8        INIT_FCALL                                                   'preg_replace_callback'
          9        SEND_VAL                                                     '%2F%28%3F%3C%21%5C%5C%29%5C%5Cu%28%5Cw%7B4%7D%29%2F'
         10        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
   15    11        SEND_VAL                                                     ~7
         12        SEND_VAR                                                     !1
   13    13        DO_ICALL                                             $8      
         14        ASSIGN                                                       !2, $8
   16    15        INIT_FCALL                                                   'var_dump'
         16        SEND_VAR                                                     !2
         17        DO_ICALL                                                     
         18      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XslFJ
function name:  {closure:/in/XslFJ:13}
number of ops:  11
compiled vars:  !0 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
   14     1        INIT_FCALL                                                   'html_entity_decode'
          2        FETCH_DIM_R                                          ~1      !0, 1
          3        CONCAT                                               ~2      '%26%23x', ~1
          4        CONCAT                                               ~3      ~2, '%3B'
          5        SEND_VAL                                                     ~3
          6        SEND_VAL                                                     2
          7        SEND_VAL                                                     'UTF-8'
          8        DO_ICALL                                             $4      
          9      > RETURN                                                       $4
   15    10*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
172.06 ms | 3069 KiB | 18 Q