3v4l.org

run code in 300+ PHP versions simultaneously
<?php $encoding = 'UTF-8'; $orig = PHP_VERSION_ID < 50600 ? iconv_get_encoding('internal_encoding') : ini_get('default_charset'); if (PHP_VERSION_ID < 50600) { if ($encoding) { $result = iconv_set_encoding('internal_encoding', $encoding); } else { $result = false; } } else { ini_set('default_charset', $encoding); $result = ini_get('default_charset'); } if (!$result) { echo 'Given encoding not supported on this OS!'; } else { echo 'All good'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 7
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 20
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
Branch analysis from position: 34
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 22
Branch analysis from position: 13
Branch analysis from position: 22
filename:       /in/dEboh
function name:  (null)
number of ops:  36
compiled vars:  !0 = $encoding, !1 = $orig, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'UTF-8'
    3     1      > JMPZ                                                     <false>, ->7
    4     2    >   INIT_FCALL_BY_NAME                                       'iconv_get_encoding'
          3        SEND_VAL_EX                                              'internal_encoding'
          4        DO_FCALL                                      0  $4      
          5        QM_ASSIGN                                        ~5      $4
          6      > JMP                                                      ->11
    5     7    >   INIT_FCALL                                               'ini_get'
          8        SEND_VAL                                                 'default_charset'
          9        DO_ICALL                                         $6      
         10        QM_ASSIGN                                        ~5      $6
    3    11    >   ASSIGN                                                   !1, ~5
    6    12      > JMPZ                                                     <false>, ->22
    7    13    > > JMPZ                                                     !0, ->20
    8    14    >   INIT_FCALL_BY_NAME                                       'iconv_set_encoding'
         15        SEND_VAL_EX                                              'internal_encoding'
         16        SEND_VAR_EX                                              !0
         17        DO_FCALL                                      0  $8      
         18        ASSIGN                                                   !2, $8
         19      > JMP                                                      ->21
   10    20    >   ASSIGN                                                   !2, <false>
         21    > > JMP                                                      ->30
   13    22    >   INIT_FCALL                                               'ini_set'
         23        SEND_VAL                                                 'default_charset'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                                 
   14    26        INIT_FCALL                                               'ini_get'
         27        SEND_VAL                                                 'default_charset'
         28        DO_ICALL                                         $12     
         29        ASSIGN                                                   !2, $12
   16    30    >   BOOL_NOT                                         ~14     !2
         31      > JMPZ                                                     ~14, ->34
   17    32    >   ECHO                                                     'Given+encoding+not+supported+on+this+OS%21'
         33      > JMP                                                      ->35
   19    34    >   ECHO                                                     'All+good'
   20    35    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.9 ms | 1400 KiB | 23 Q