3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test_str = "I&#039;ll"; function setup_functions(){ global $smcFunc; $smcFunc = array(); $utf8=1; $ent_list = '&(#\d{1,7}|quot|amp|lt|gt|nbsp);'; $ent_check = array('preg_replace(\'~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~e\', \'$smcFunc[\\\'entity_fix\\\'](\\\'\\2\\\')\', ', ')'); $smcFunc += array( 'entity_fix' => create_function('$string', ' $num = substr($string, 0, 1) === \'x\' ? hexdec(substr($string, 1)) : (int) $string; return $num < 0x20 || $num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF) || $num === 0x202E || $num === 0x202D ? \'\' : \'&#\' . $num . \';\';'), 'strlen' => create_function('$string', ' global $smcFunc; return strlen(preg_replace(\'~' . $ent_list . '|.~u' . '\', \'_\', ' . implode('$string', $ent_check) . '));') ); } setup_functions(); echo "Length = " . $smcFunc['strlen']($test_str) . "\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7vgnr
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test_str, !1 = $smcFunc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'I%26%23039%3Bll'
   23     1        INIT_FCALL                                               'setup_functions'
          2        DO_FCALL                                      0          
   24     3        FETCH_DIM_R                                      ~4      !1, 'strlen'
          4        INIT_DYNAMIC_CALL                                        ~4
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0  $5      
          7        CONCAT                                           ~6      'Length+%3D+', $5
          8        CONCAT                                           ~7      ~6, '%0A'
          9        ECHO                                                     ~7
   25    10      > RETURN                                                   1

Function setup_functions:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7vgnr
function name:  setup_functions
number of ops:  26
compiled vars:  !0 = $smcFunc, !1 = $utf8, !2 = $ent_list, !3 = $ent_check
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_GLOBAL                                              !0, 'smcFunc'
    7     1        ASSIGN                                                   !0, <array>
    8     2        ASSIGN                                                   !1, 1
    9     3        ASSIGN                                                   !2, '%26%28%23%5Cd%7B1%2C7%7D%7Cquot%7Camp%7Clt%7Cgt%7Cnbsp%29%3B'
   10     4        ASSIGN                                                   !3, <array>
   13     5        INIT_FCALL_BY_NAME                                       'create_function'
          6        SEND_VAL_EX                                              '%24string'
          7        SEND_VAL_EX                                              '%0A%09%09%09%24num+%3D+substr%28%24string%2C+0%2C+1%29+%3D%3D%3D+%27x%27+%3F+hexdec%28substr%28%24string%2C+1%29%29+%3A+%28int%29+%24string%3B%0A%09%09%09return+%24num+%3C+0x20+%7C%7C+%24num+%3E+0x10FFFF+%7C%7C+%28%24num+%3E%3D+0xD800+%26%26+%24num+%3C%3D+0xDFFF%29+%7C%7C+%24num+%3D%3D%3D+0x202E+%7C%7C+%24num+%3D%3D%3D+0x202D+%3F+%27%27+%3A+%27%26%23%27+.+%24num+.+%27%3B%27%3B'
          8        DO_FCALL                                      0  $8      
          9        INIT_ARRAY                                       ~9      $8, 'entity_fix'
   16    10        INIT_FCALL_BY_NAME                                       'create_function'
         11        SEND_VAL_EX                                              '%24string'
   18    12        CONCAT                                           ~10     '%0A%09%09%09global+%24smcFunc%3B%0A%09%09%09return+strlen%28preg_replace%28%27%7E', !2
         13        CONCAT                                           ~11     ~10, '%7C.%7Eu'
         14        CONCAT                                           ~12     ~11, '%27%2C+%27_%27%2C+'
         15        INIT_FCALL                                               'implode'
         16        SEND_VAL                                                 '%24string'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                         $13     
         19        CONCAT                                           ~14     ~12, $13
         20        CONCAT                                           ~15     ~14, '%29%29%3B'
         21        SEND_VAL_EX                                              ~15
         22        DO_FCALL                                      0  $16     
         23        ADD_ARRAY_ELEMENT                                ~9      $16, 'strlen'
         24        ASSIGN_OP                                     1          !0, ~9
   20    25      > RETURN                                                   null

End of function setup_functions

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.24 ms | 1403 KiB | 16 Q