3v4l.org

run code in 300+ PHP versions simultaneously
<?php $reverse = FALSE; $separator = '/'; $str = 'test/ezifh'; $f = $reverse ? 'strrpos' : 'strpos'; if (($pos = $f($str, $separator)) !== FALSE) { $str = substr($str, $pos + 1); } var_dump($str);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
Branch analysis from position: 21
filename:       /in/RX4Rp
function name:  (null)
number of ops:  25
compiled vars:  !0 = $reverse, !1 = $separator, !2 = $str, !3 = $f, !4 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <false>
    3     1        ASSIGN                                                   !1, '%2F'
    4     2        ASSIGN                                                   !2, 'test%2Fezifh'
    5     3      > JMPZ                                                     !0, ->6
          4    >   QM_ASSIGN                                        ~8      'strrpos'
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~8      'strpos'
          7    >   ASSIGN                                                   !3, ~8
    6     8        INIT_DYNAMIC_CALL                                        !3
          9        SEND_VAR_EX                                              !2
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0  $10     
         12        ASSIGN                                           ~11     !4, $10
         13        TYPE_CHECK                                  1018          ~11
         14      > JMPZ                                                     ~12, ->21
    7    15    >   INIT_FCALL                                               'substr'
         16        SEND_VAR                                                 !2
         17        ADD                                              ~13     !4, 1
         18        SEND_VAL                                                 ~13
         19        DO_ICALL                                         $14     
         20        ASSIGN                                                   !2, $14
    9    21    >   INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.82 ms | 1395 KiB | 17 Q