3v4l.org

run code in 300+ PHP versions simultaneously
<?php $from = 'ľľščťžýáíŕďňäô'; // these chars are in UTF-8 $to = 'llsctzyairdnao'; $str = 'Kŕdeľ ďatľov učí koňa žrať kôru.'; // bad because $from and $to are related by their byte offsets echo strtr($str, $from, $to); echo "\n---\n"; // good because not evaluated by individual bytes $trans = [ 'ľ' => 'l', 'š' => 's', 'č' => 'c', 'ť' => 't', 'ž' => 'z', 'ý' => 'y', 'á' => 'a', 'í' => 'i', 'ŕ' => 'r', 'ď' => 'd', 'ň' => 'n', 'ä' => 'a', 'ô' => 'o', ]; echo strtr($str, $trans);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Z9PRj
function name:  (null)
number of ops:  17
compiled vars:  !0 = $from, !1 = $to, !2 = $str, !3 = $trans
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%C4%BE%C4%BE%C5%A1%C4%8D%C5%A5%C5%BE%C3%BD%C3%A1%C3%AD%C5%95%C4%8F%C5%88%C3%A4%C3%B4'
    4     1        ASSIGN                                                   !1, 'llsctzyairdnao'
    6     2        ASSIGN                                                   !2, 'K%C5%95de%C4%BE+%C4%8Fat%C4%BEov+u%C4%8D%C3%AD+ko%C5%88a+%C5%BEra%C5%A5+k%C3%B4ru.'
    9     3        INIT_FCALL                                               'strtr'
          4        SEND_VAR                                                 !2
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8        ECHO                                                     $7
   11     9        ECHO                                                     '%0A---%0A'
   14    10        ASSIGN                                                   !3, <array>
   29    11        INIT_FCALL                                               'strtr'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                         $9      
         15        ECHO                                                     $9
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.61 ms | 996 KiB | 14 Q