3v4l.org

run code in 500+ PHP versions simultaneously
<?php $tests = array( 'bar' => '', 'foo' => 'o', 'foobar' => '', 'hello' => 'hello' ); foreach ($tests as $input => $expected) { if ($expected !== ($actual = strtr($input, array("fo" => "", "foobar" => "", "bar" => "")))) { echo "KO `$input` became `$actual` instead of `$expected`\n"; } else { echo "OK `$input` became `$expected`\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 24
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/FTV2L
function name:  (null)
number of ops:  26
compiled vars:  !0 = $tests, !1 = $expected, !2 = $input, !3 = $actual
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1      > FE_RESET_R                                           $5      !0, ->24
          2    > > FE_FETCH_R                                           ~6      $5, !1, ->24
          3    >   ASSIGN                                                       !2, ~6
   11     4        FRAMELESS_ICALL_2                strtr               ~8      !2, <array>
          5        ASSIGN                                               ~9      !3, ~8
          6        IS_NOT_IDENTICAL                                             !1, ~9
          7      > JMPZ                                                         ~10, ->17
   12     8    >   ROPE_INIT                                         7  ~12     'KO+%60'
          9        ROPE_ADD                                          1  ~12     ~12, !2
         10        ROPE_ADD                                          2  ~12     ~12, '%60+became+%60'
         11        ROPE_ADD                                          3  ~12     ~12, !3
         12        ROPE_ADD                                          4  ~12     ~12, '%60+instead+of+%60'
         13        ROPE_ADD                                          5  ~12     ~12, !1
         14        ROPE_END                                          6  ~11     ~12, '%60%0A'
         15        ECHO                                                         ~11
   11    16      > JMP                                                          ->23
   14    17    >   ROPE_INIT                                         5  ~17     'OK+%60'
         18        ROPE_ADD                                          1  ~17     ~17, !2
         19        ROPE_ADD                                          2  ~17     ~17, '%60+became+%60'
         20        ROPE_ADD                                          3  ~17     ~17, !1
         21        ROPE_END                                          4  ~16     ~17, '%60%0A'
         22        ECHO                                                         ~16
   10    23    > > JMP                                                          ->2
         24    >   FE_FREE                                                      $5
   16    25      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
221.74 ms | 2716 KiB | 13 Q