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); $new_string = ""; if( in_array($first_letter,$vowels) ) { $new_string = "an <strong>".ucfirst($string)."</strong>"; } else { $new_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/6oDoV
function name:  (null)
number of ops:  6
compiled vars:  !0 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'get_position'
          1        SEND_VAL                                                 'Advertising'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   18     4        ECHO                                                     !0
          5      > RETURN                                                   1

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

End of function get_position

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.2 ms | 1402 KiB | 24 Q