3v4l.org

run code in 300+ 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 = 27
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 20
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/FTV2L
function name:  (null)
number of ops:  29
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, ->27
          2    > > FE_FETCH_R                                       ~6      $5, !1, ->27
          3    >   ASSIGN                                                   !2, ~6
   11     4        INIT_FCALL                                               'strtr'
          5        SEND_VAR                                                 !2
          6        SEND_VAL                                                 <array>
          7        DO_ICALL                                         $8      
          8        ASSIGN                                           ~9      !3, $8
          9        IS_NOT_IDENTICAL                                         !1, ~9
         10      > JMPZ                                                     ~10, ->20
   12    11    >   ROPE_INIT                                     7  ~12     'KO+%60'
         12        ROPE_ADD                                      1  ~12     ~12, !2
         13        ROPE_ADD                                      2  ~12     ~12, '%60+became+%60'
         14        ROPE_ADD                                      3  ~12     ~12, !3
         15        ROPE_ADD                                      4  ~12     ~12, '%60+instead+of+%60'
         16        ROPE_ADD                                      5  ~12     ~12, !1
         17        ROPE_END                                      6  ~11     ~12, '%60%0A'
         18        ECHO                                                     ~11
         19      > JMP                                                      ->26
   14    20    >   ROPE_INIT                                     5  ~17     'OK+%60'
         21        ROPE_ADD                                      1  ~17     ~17, !2
         22        ROPE_ADD                                      2  ~17     ~17, '%60+became+%60'
         23        ROPE_ADD                                      3  ~17     ~17, !1
         24        ROPE_END                                      4  ~16     ~17, '%60%0A'
         25        ECHO                                                     ~16
   10    26    > > JMP                                                      ->2
         27    >   FE_FREE                                                  $5
   16    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.15 ms | 1396 KiB | 15 Q