3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = '14'; $str2 = 'DQ'; $encodings1 = ['ASCII', 'UTF-8', 'UTF-16', 'UTF-16LE']; $encodings2 = ['UTF-8', 'UTF-16', 'UTF-16LE']; echo bin2hex($str1) . ' - ' . mb_detect_encoding($str1, $encodings1, true)."\n"; echo bin2hex($str1) . ' - ' . mb_detect_encoding($str1, $encodings2, true)."\n"; echo bin2hex($str2) . ' - ' . mb_detect_encoding($str2, $encodings1, true)."\n"; echo bin2hex($str2) . ' - ' . mb_detect_encoding($str2, $encodings2, true)."\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ehb6U
function name:  (null)
number of ops:  53
compiled vars:  !0 = $str1, !1 = $str2, !2 = $encodings1, !3 = $encodings2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '14'
    4     1        ASSIGN                                                   !1, 'DQ'
    5     2        ASSIGN                                                   !2, <array>
    6     3        ASSIGN                                                   !3, <array>
    7     4        INIT_FCALL                                               'bin2hex'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $8      
          7        CONCAT                                           ~9      $8, '+-+'
          8        INIT_FCALL                                               'mb_detect_encoding'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 <true>
         12        DO_ICALL                                         $10     
         13        CONCAT                                           ~11     ~9, $10
         14        CONCAT                                           ~12     ~11, '%0A'
         15        ECHO                                                     ~12
    8    16        INIT_FCALL                                               'bin2hex'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $13     
         19        CONCAT                                           ~14     $13, '+-+'
         20        INIT_FCALL                                               'mb_detect_encoding'
         21        SEND_VAR                                                 !0
         22        SEND_VAR                                                 !3
         23        SEND_VAL                                                 <true>
         24        DO_ICALL                                         $15     
         25        CONCAT                                           ~16     ~14, $15
         26        CONCAT                                           ~17     ~16, '%0A'
         27        ECHO                                                     ~17
    9    28        INIT_FCALL                                               'bin2hex'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                         $18     
         31        CONCAT                                           ~19     $18, '+-+'
         32        INIT_FCALL                                               'mb_detect_encoding'
         33        SEND_VAR                                                 !1
         34        SEND_VAR                                                 !2
         35        SEND_VAL                                                 <true>
         36        DO_ICALL                                         $20     
         37        CONCAT                                           ~21     ~19, $20
         38        CONCAT                                           ~22     ~21, '%0A'
         39        ECHO                                                     ~22
   10    40        INIT_FCALL                                               'bin2hex'
         41        SEND_VAR                                                 !1
         42        DO_ICALL                                         $23     
         43        CONCAT                                           ~24     $23, '+-+'
         44        INIT_FCALL                                               'mb_detect_encoding'
         45        SEND_VAR                                                 !1
         46        SEND_VAR                                                 !3
         47        SEND_VAL                                                 <true>
         48        DO_ICALL                                         $25     
         49        CONCAT                                           ~26     ~24, $25
         50        CONCAT                                           ~27     ~26, '%0A'
         51        ECHO                                                     ~27
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.96 ms | 1006 KiB | 15 Q