3v4l.org

run code in 300+ PHP versions simultaneously
<?php # -*- coding: utf-8 -*- declare( encoding = 'UTF-8' ); header('Content-Type: text/plain;charset=utf-8'); $string = 'Doppelgänger'; print 'strlen(): ' . strlen( $string ) . "\n"; print 'mb_strlen(): ' . mb_strlen( $string, 'utf8' ) . "\n\n"; print 'substr(): ' . substr( $string, 0, 8 ) . "\n"; print 'mb_substr(): ' . mb_substr( $string, 0, 8, 'utf8' );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/odW4r
function name:  (null)
number of ops:  32
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Content-Type%3A+text%2Fplain%3Bcharset%3Dutf-8'
          2        DO_ICALL                                                 
    5     3        ASSIGN                                                   !0, 'Doppelg%C3%A4nger'
    6     4        STRLEN                                           ~3      !0
          5        CONCAT                                           ~4      'strlen%28%29%3A++++', ~3
          6        CONCAT                                           ~5      ~4, '%0A'
          7        ECHO                                                     ~5
    7     8        INIT_FCALL                                               'mb_strlen'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 'utf8'
         11        DO_ICALL                                         $6      
         12        CONCAT                                           ~7      'mb_strlen%28%29%3A+', $6
         13        CONCAT                                           ~8      ~7, '%0A%0A'
         14        ECHO                                                     ~8
    9    15        INIT_FCALL                                               'substr'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 8
         19        DO_ICALL                                         $9      
         20        CONCAT                                           ~10     'substr%28%29%3A++++', $9
         21        CONCAT                                           ~11     ~10, '%0A'
         22        ECHO                                                     ~11
   10    23        INIT_FCALL                                               'mb_substr'
         24        SEND_VAR                                                 !0
         25        SEND_VAL                                                 0
         26        SEND_VAL                                                 8
         27        SEND_VAL                                                 'utf8'
         28        DO_ICALL                                         $12     
         29        CONCAT                                           ~13     'mb_substr%28%29%3A+', $12
         30        ECHO                                                     ~13
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.32 ms | 1396 KiB | 21 Q