3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = strrpos('test/bild.jpg','/'); $x = ''; $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 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B3bqY
function name:  (null)
number of ops:  30
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        ASSIGN                                                   !0, ''
    4     6      > JMPZ                                                     !0, ->10
          7    >   POST_INC                                         ~7      !0
          8        QM_ASSIGN                                        ~8      ~7
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~8      ''
         11    >   ASSIGN                                                   !0, ~8
    5    12        INIT_FCALL                                               'substr'
         13        SEND_VAL                                                 'test%2Fbild.jpg'
         14        SEND_VAL                                                 0
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !1, $10
    6    18        INIT_FCALL                                               'substr'
         19        SEND_VAL                                                 'test%2Fbild.jpg'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !2, $12
    7    23        CONCAT                                           ~14     'folder%3A+', !1
         24        CONCAT                                           ~15     ~14, '+oldname%3A'
         25        CONCAT                                           ~16     ~15, !2
         26        CONCAT                                           ~17     ~16, '+newname%3A+'
         27        CONCAT                                           ~18     ~17, !3
         28        ECHO                                                     ~18
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.37 ms | 1396 KiB | 17 Q