3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dec = json_decode('{"a":"A\u2028B"}'); $dec = json_encode($dec, JSON_UNESCAPED_UNICODE); $json = $dec; $json = strtr( $json, array( "\xE2\x80\xA8" => '', // \u2028 "\xE2\x80\xA9" => '', // \u2029 ) ); var_dump($json); var_dump($dec); echo strlen($json), ' ', strlen($dec);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LDcmF
function name:  (null)
number of ops:  27
compiled vars:  !0 = $dec, !1 = $json
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                                         $2      
          3        ASSIGN                                                   !0, $2
    4     4        INIT_FCALL                                               'json_encode'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 256
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !0, $4
    6     9        ASSIGN                                                   !1, !0
    7    10        INIT_FCALL                                               'strtr'
    8    11        SEND_VAR                                                 !1
   10    12        SEND_VAL                                                 <array>
         13        DO_ICALL                                         $7      
    7    14        ASSIGN                                                   !1, $7
   14    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   15    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
   17    21        STRLEN                                           ~11     !1
         22        ECHO                                                     ~11
         23        ECHO                                                     '+'
         24        STRLEN                                           ~12     !0
         25        ECHO                                                     ~12
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.06 ms | 1395 KiB | 21 Q