3v4l.org

run code in 300+ PHP versions simultaneously
<?php $video_url = 'http://google.com'; $needles = array('http://', 'https://'); // Normalise the URLs foreach ($needles as $needle) { var_dump(strpos($video_url, $needle)); if (strpos($video_url, $needle) !== 0) { echo 'hello'; break; } } echo $video_url;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 20
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 20
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
Branch analysis from position: 20
filename:       /in/iHDWO
function name:  (null)
number of ops:  23
compiled vars:  !0 = $video_url, !1 = $needles, !2 = $needle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fgoogle.com'
    6     1        ASSIGN                                                   !1, <array>
    9     2      > FE_RESET_R                                       $5      !1, ->20
          3    > > FE_FETCH_R                                               $5, !2, ->20
   10     4    >   INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   12    11        INIT_FCALL                                               'strpos'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $8      
         15        IS_NOT_IDENTICAL                                         $8, 0
         16      > JMPZ                                                     ~9, ->19
   13    17    >   ECHO                                                     'hello'
   14    18      > JMP                                                      ->20
    9    19    > > JMP                                                      ->3
         20    >   FE_FREE                                                  $5
   18    21        ECHO                                                     !0
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.83 ms | 1395 KiB | 17 Q