3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'u4F60u597Du4E16u754C'; $string = json_decode('"' . $string . '"'); $valid = mb_check_encoding($string, 'UTF-8'); echo ($valid) ? 'valid' : 'invalid';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uEqmo
function name:  (null)
number of ops:  18
compiled vars:  !0 = $string, !1 = $valid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'u4F60u597Du4E16u754C'
    4     1        INIT_FCALL                                               'json_decode'
          2        CONCAT                                           ~3      '%22', !0
          3        CONCAT                                           ~4      ~3, '%22'
          4        SEND_VAL                                                 ~4
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !0, $5
    5     7        INIT_FCALL                                               'mb_check_encoding'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 'UTF-8'
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !1, $7
    6    12      > JMPZ                                                     !1, ->15
         13    >   QM_ASSIGN                                        ~9      'valid'
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~9      'invalid'
         16    >   ECHO                                                     ~9
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.78 ms | 1399 KiB | 17 Q