3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_position($string) { $vowels = array("a,e,i,o,u"); $first_letter = strtolower(substr($string,0,1)); echo $first_letter."<br>"; print_r($vowels); if( in_array($first_letter,$vowels) ) { $string = "an <strong>".ucfirst($string)."</strong>"; } else { $string = "a <strong>".ucfirst($string)."</strong>"; } return $string; } $output = get_position("Advertising"); echo $output;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7SXKB
function name:  (null)
number of ops:  6
compiled vars:  !0 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'get_position'
          1        SEND_VAL                                                 'Advertising'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   17     4        ECHO                                                     !0
          5      > RETURN                                                   1

Function get_position:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7SXKB
function name:  get_position
number of ops:  36
compiled vars:  !0 = $string, !1 = $vowels, !2 = $first_letter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'strtolower'
          3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 1
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                         $5      
         10        ASSIGN                                                   !2, $5
    6    11        CONCAT                                           ~7      !2, '%3Cbr%3E'
         12        ECHO                                                     ~7
    7    13        INIT_FCALL                                               'print_r'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
    8    16        INIT_FCALL                                               'in_array'
         17        SEND_VAR                                                 !2
         18        SEND_VAR                                                 !1
         19        DO_ICALL                                         $9      
         20      > JMPZ                                                     $9, ->28
    9    21    >   INIT_FCALL                                               'ucfirst'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $10     
         24        CONCAT                                           ~11     'an+%3Cstrong%3E', $10
         25        CONCAT                                           ~12     ~11, '%3C%2Fstrong%3E'
         26        ASSIGN                                                   !0, ~12
         27      > JMP                                                      ->34
   11    28    >   INIT_FCALL                                               'ucfirst'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $14     
         31        CONCAT                                           ~15     'a+%3Cstrong%3E', $14
         32        CONCAT                                           ~16     ~15, '%3C%2Fstrong%3E'
         33        ASSIGN                                                   !0, ~16
   13    34    > > RETURN                                                   !0
   14    35*     > RETURN                                                   null

End of function get_position

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.9 ms | 1403 KiB | 24 Q