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)); $new_string = ""; if( in_array($first_letter,$vowels) ) { $new_string = "an <strong>".ucfirst($string)."</strong>"; } else { $new_string = "a <strong>".ucfirst($string)."</strong>"; } return $new_string; } $output1 = get_position("Advertising"); $output2 = get_position("Marketing"); echo $output1."<br>"; echo $output2."<br>";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/arChL
function name:  (null)
number of ops:  13
compiled vars:  !0 = $output1, !1 = $output2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'get_position'
          1        SEND_VAL                                                 'Advertising'
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
   16     4        INIT_FCALL                                               'get_position'
          5        SEND_VAL                                                 'Marketing'
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                                   !1, $4
   17     8        CONCAT                                           ~6      !0, '%3Cbr%3E'
          9        ECHO                                                     ~6
   18    10        CONCAT                                           ~7      !1, '%3Cbr%3E'
         11        ECHO                                                     ~7
         12      > RETURN                                                   1

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

End of function get_position

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.87 ms | 1403 KiB | 23 Q