3v4l.org

run code in 300+ PHP versions simultaneously
<?php function NewUrl($x) { $url = $x; if ( substr($url, 0, 7) == 'http://') { $url = substr($url, 7); } if ( substr($url, 0, 8) == 'https://') { $url = substr($url, 8); } if ( substr($url, 0, 4) == 'www.') { $url = substr($url, 4); } return $url; } echo NewUrl('http://www.127.0.0.1/wp'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n62qL
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'newurl'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.127.0.0.1%2Fwp'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   17     4      > RETURN                                                   1

Function newurl:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 38
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
Branch analysis from position: 26
Branch analysis from position: 14
filename:       /in/n62qL
function name:  NewUrl
number of ops:  40
compiled vars:  !0 = $x, !1 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, !0
    4     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 7
          6        DO_ICALL                                         $3      
          7        IS_EQUAL                                                 $3, 'http%3A%2F%2F'
          8      > JMPZ                                                     ~4, ->14
          9    >   INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 7
         12        DO_ICALL                                         $5      
         13        ASSIGN                                                   !1, $5
    6    14    >   INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !1
         16        SEND_VAL                                                 0
         17        SEND_VAL                                                 8
         18        DO_ICALL                                         $7      
         19        IS_EQUAL                                                 $7, 'https%3A%2F%2F'
         20      > JMPZ                                                     ~8, ->26
         21    >   INIT_FCALL                                               'substr'
         22        SEND_VAR                                                 !1
         23        SEND_VAL                                                 8
         24        DO_ICALL                                         $9      
         25        ASSIGN                                                   !1, $9
    8    26    >   INIT_FCALL                                               'substr'
         27        SEND_VAR                                                 !1
         28        SEND_VAL                                                 0
         29        SEND_VAL                                                 4
         30        DO_ICALL                                         $11     
         31        IS_EQUAL                                                 $11, 'www.'
         32      > JMPZ                                                     ~12, ->38
         33    >   INIT_FCALL                                               'substr'
         34        SEND_VAR                                                 !1
         35        SEND_VAL                                                 4
         36        DO_ICALL                                         $13     
         37        ASSIGN                                                   !1, $13
   12    38    > > RETURN                                                   !1
   13    39*     > RETURN                                                   null

End of function newurl

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.33 ms | 1403 KiB | 16 Q