3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = array( "Sample" => array( "context" => 'جمهوری اسلامی ایران' ) ); $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/gYeNs
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>
    9     1        INIT_FCALL                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   10     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   12     8        INIT_FCALL                                               'preg_replace_callback'
          9        SEND_VAL                                                 '%2F%5C%5Cu%28%5Cw%7B4%7D%29%2F'
         10        DECLARE_LAMBDA_FUNCTION                          ~7      [0]
   14    11        SEND_VAL                                                 ~7
         12        SEND_VAR                                                 !1
   12    13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !2, $8
   15    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/gYeNs
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     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
   14    10*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.1 ms | 1457 KiB | 17 Q