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) { if (strpos($video_url, $needle) === false) { $video_url = 'http://' . $video_url; } } echo $video_url;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 13
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/ILu7A
function name:  (null)
number of ops:  16
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, ->13
          3    > > FE_FETCH_R                                               $5, !2, ->13
   10     4    >   INIT_FCALL                                               'strpos'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $6      
          8        TYPE_CHECK                                    4          $6
          9      > JMPZ                                                     ~7, ->12
   11    10    >   CONCAT                                           ~8      'http%3A%2F%2F', !0
         11        ASSIGN                                                   !0, ~8
    9    12    > > JMP                                                      ->3
         13    >   FE_FREE                                                  $5
   15    14        ECHO                                                     !0
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.98 ms | 1395 KiB | 15 Q