3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dec = json_decode('{"a":"A\u2028B"}'); print_r(json_encode($dec)); $json = json_encode($dec); $json = strtr( $json, array( "\xE2\x80\xA8" => '', // \u2028 "\xE2\x80\xA9" => '', // \u2029 ) ); $test = json_encode($dec, JSON_UNESCAPED_UNICODE); echo strlen($json), ' ', strlen($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z704X
function name:  (null)
number of ops:  30
compiled vars:  !0 = $dec, !1 = $json, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%22a%22%3A%22A%5Cu2028B%22%7D'
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    4     4        INIT_FCALL                                               'print_r'
          5        INIT_FCALL                                               'json_encode'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
    5    10        INIT_FCALL                                               'json_encode'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !1, $7
    6    14        INIT_FCALL                                               'strtr'
    7    15        SEND_VAR                                                 !1
    9    16        SEND_VAL                                                 <array>
         17        DO_ICALL                                         $9      
    6    18        ASSIGN                                                   !1, $9
   13    19        INIT_FCALL                                               'json_encode'
         20        SEND_VAR                                                 !0
         21        SEND_VAL                                                 256
         22        DO_ICALL                                         $11     
         23        ASSIGN                                                   !2, $11
   14    24        STRLEN                                           ~13     !1
         25        ECHO                                                     ~13
         26        ECHO                                                     '+'
         27        STRLEN                                           ~14     !2
         28        ECHO                                                     ~14
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.21 ms | 1399 KiB | 21 Q