3v4l.org

run code in 300+ PHP versions simultaneously
<?php //if (version_compare(PHP_VERSION, '5.2', '<')) { // exit 'no json_encode() support'; //} $array = array('text' => "<h1>Кириллический URL</h1>\n<p>This is Cyrillic URL example. Try <a class=js-as dir=rtl href=עברית>RTL עברית</a>.</p>\n"); if (version_compare(PHP_VERSION, '5.4', '>=')) { $data = json_encode($array, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); } else { //$data = str_replace('\\/', '/', json_encode($array)); $data = preg_replace("/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", json_encode($array)); } echo $data;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ntK3A
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'version_compare'
          2        SEND_VAL                                                 '8.3.0'
          3        SEND_VAL                                                 '5.4'
          4        SEND_VAL                                                 '%3E%3D'
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->13
   10     7    >   INIT_FCALL                                               'json_encode'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 320
         10        DO_ICALL                                         $4      
         11        ASSIGN                                                   !1, $4
    9    12      > JMP                                                      ->22
   13    13    >   INIT_FCALL                                               'preg_replace'
         14        SEND_VAL                                                 '%2F%5C%5Cu%28%5Ba-f0-9%5D%7B4%7D%29%2Fe'
         15        SEND_VAL                                                 'iconv%28%27UCS-4LE%27%2C%27UTF-8%27%2Cpack%28%27V%27%2C+hexdec%28%27U%241%27%29%29%29'
         16        INIT_FCALL                                               'json_encode'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $6      
         19        SEND_VAR                                                 $6
         20        DO_ICALL                                         $7      
         21        ASSIGN                                                   !1, $7
   16    22    >   ECHO                                                     !1
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.99 ms | 1461 KiB | 16 Q