3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "♫"; $len = mb_strlen($string, '8bit'); function substr_unicode($str, $s, $l = null) { return join("", array_slice( preg_split("//u", $str, -1, PREG_SPLIT_NO_EMPTY), $s, $l)); } echo ord(mb_substr($string, 0, $len))." ";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6bjZD
function name:  (null)
number of ops:  17
compiled vars:  !0 = $string, !1 = $len
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%E2%99%AB'
    3     1        INIT_FCALL                                               'mb_strlen'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '8bit'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   10     6        INIT_FCALL                                               'ord'
          7        INIT_FCALL                                               'mb_substr'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $5      
         12        SEND_VAR                                                 $5
         13        DO_ICALL                                         $6      
         14        CONCAT                                           ~7      $6, '+'
         15        ECHO                                                     ~7
         16      > RETURN                                                   1

Function substr_unicode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6bjZD
function name:  substr_unicode
number of ops:  20
compiled vars:  !0 = $str, !1 = $s, !2 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      null
    6     3        INIT_FCALL                                               'join'
          4        SEND_VAL                                                 ''
          5        INIT_FCALL                                               'array_slice'
    7     6        INIT_FCALL                                               'preg_split'
          7        SEND_VAL                                                 '%2F%2Fu'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 -1
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $3      
         12        SEND_VAR                                                 $3
         13        SEND_VAR                                                 !1
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                         $5      
         18      > RETURN                                                   $5
    8    19*     > RETURN                                                   null

End of function substr_unicode

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.98 ms | 1396 KiB | 25 Q