3v4l.org

run code in 500+ 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:  11
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        FRAMELESS_ICALL_3                strtr               ~7      !2, !0
          4        OP_DATA                                                      !1
          5        ECHO                                                         ~7
   11     6        ECHO                                                         '%0A---%0A'
   14     7        ASSIGN                                                       !3, <array>
   29     8        FRAMELESS_ICALL_2                strtr               ~9      !2, !3
          9        ECHO                                                         ~9
         10      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.88 ms | 1767 KiB | 13 Q