3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isTribune($imagePath){ return strpos($imagePath,'tmsimg.com') !== false; } /* function makePath($imagePath) { if(!isTribune($imagePath) { return false; } } */ $basePath = "images/bin/channels/"; $noImageNegative = "images/bin/channels/nochan_neg.png"; $noImageTribune = "http://aiotv.tmsimg.com/sources/generic/generic_sources_h3.png"; $path = "http://aiotv.tmsimg.com/sources/h3/NowShowing/21633/s21633_h3_aa.png"; if($path == $noImageTribune){ $newPath = $noImageNegative; } else { $fileName = pathinfo($path,PATHINFO_FILENAME); $negName = $fileName . "_neg.png"; $newPath = $basePath . $negName; } print $newPath;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZMTWV
function name:  (null)
number of ops:  19
compiled vars:  !0 = $basePath, !1 = $noImageNegative, !2 = $noImageTribune, !3 = $path, !4 = $newPath, !5 = $fileName, !6 = $negName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'images%2Fbin%2Fchannels%2F'
   14     1        ASSIGN                                                   !1, 'images%2Fbin%2Fchannels%2Fnochan_neg.png'
   15     2        ASSIGN                                                   !2, 'http%3A%2F%2Faiotv.tmsimg.com%2Fsources%2Fgeneric%2Fgeneric_sources_h3.png'
   16     3        ASSIGN                                                   !3, 'http%3A%2F%2Faiotv.tmsimg.com%2Fsources%2Fh3%2FNowShowing%2F21633%2Fs21633_h3_aa.png'
   17     4        IS_EQUAL                                                 !3, !2
          5      > JMPZ                                                     ~11, ->8
   18     6    >   ASSIGN                                                   !4, !1
          7      > JMP                                                      ->17
   20     8    >   INIT_FCALL                                               'pathinfo'
          9        SEND_VAR                                                 !3
         10        SEND_VAL                                                 8
         11        DO_ICALL                                         $13     
         12        ASSIGN                                                   !5, $13
   21    13        CONCAT                                           ~15     !5, '_neg.png'
         14        ASSIGN                                                   !6, ~15
   22    15        CONCAT                                           ~17     !0, !6
         16        ASSIGN                                                   !4, ~17
   25    17    >   ECHO                                                     !4
         18      > RETURN                                                   1

Function istribune:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZMTWV
function name:  isTribune
number of ops:  8
compiled vars:  !0 = $imagePath
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'tmsimg.com'
          4        DO_ICALL                                         $1      
          5        TYPE_CHECK                                  1018  ~2      $1
          6      > RETURN                                                   ~2
    5     7*     > RETURN                                                   null

End of function istribune

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.26 ms | 1396 KiB | 17 Q