3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = '14'; $encodings = ['ASCII', 'UTF-8', 'UTF-16', 'UTF-16LE']; echo bin2hex($str) . ' - ' . mb_detect_encoding($str, $encodings, true)."\n"; $str = 'DQ'; echo bin2hex($str) . ' - ' . mb_detect_encoding($str, $encodings, true)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0fOjG
function name:  (null)
number of ops:  28
compiled vars:  !0 = $str, !1 = $encodings
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '14'
    4     1        ASSIGN                                                       !1, <array>
    5     2        INIT_FCALL                                                   'bin2hex'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $4      
          5        CONCAT                                               ~5      $4, '+-+'
          6        INIT_FCALL                                                   'mb_detect_encoding'
          7        SEND_VAR                                                     !0
          8        SEND_VAR                                                     !1
          9        SEND_VAL                                                     <true>
         10        DO_ICALL                                             $6      
         11        CONCAT                                               ~7      ~5, $6
         12        CONCAT                                               ~8      ~7, '%0A'
         13        ECHO                                                         ~8
    6    14        ASSIGN                                                       !0, 'DQ'
    7    15        INIT_FCALL                                                   'bin2hex'
         16        SEND_VAR                                                     !0
         17        DO_ICALL                                             $10     
         18        CONCAT                                               ~11     $10, '+-+'
         19        INIT_FCALL                                                   'mb_detect_encoding'
         20        SEND_VAR                                                     !0
         21        SEND_VAR                                                     !1
         22        SEND_VAL                                                     <true>
         23        DO_ICALL                                             $12     
         24        CONCAT                                               ~13     ~11, $12
         25        CONCAT                                               ~14     ~13, '%0A'
         26        ECHO                                                         ~14
         27      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
128.02 ms | 479 KiB | 9 Q