3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = strrpos('test/bild.jpg','/'); $x = $x? $x++ : ''; $folder = substr('test/bild.jpg',0,$x); $oldname = substr('test/bild.jpg',$x); echo 'folder: '.$folder.' oldname:'.$oldname.' newname: '.$newname;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qphrv
function name:  (null)
number of ops:  29
compiled vars:  !0 = $x, !1 = $folder, !2 = $oldname, !3 = $newname
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'strrpos'
          1        SEND_VAL                                                 'test%2Fbild.jpg'
          2        SEND_VAL                                                 '%2F'
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
    3     5      > JMPZ                                                     !0, ->9
          6    >   POST_INC                                         ~6      !0
          7        QM_ASSIGN                                        ~7      ~6
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~7      ''
         10    >   ASSIGN                                                   !0, ~7
    4    11        INIT_FCALL                                               'substr'
         12        SEND_VAL                                                 'test%2Fbild.jpg'
         13        SEND_VAL                                                 0
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $9      
         16        ASSIGN                                                   !1, $9
    5    17        INIT_FCALL                                               'substr'
         18        SEND_VAL                                                 'test%2Fbild.jpg'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $11     
         21        ASSIGN                                                   !2, $11
    6    22        CONCAT                                           ~13     'folder%3A+', !1
         23        CONCAT                                           ~14     ~13, '+oldname%3A'
         24        CONCAT                                           ~15     ~14, !2
         25        CONCAT                                           ~16     ~15, '+newname%3A+'
         26        CONCAT                                           ~17     ~16, !3
         27        ECHO                                                     ~17
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.98 ms | 1396 KiB | 17 Q