3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.67 ms | 1395 KiB | 15 Q