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,1,0)); 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/6dJmf
function name:  (null)
number of ops:  6
compiled vars:  !0 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'get_position'
          1        SEND_VAL                                                 'Advertising'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   15     4        ECHO                                                     !0
          5      > RETURN                                                   1

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

End of function get_position

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.26 ms | 1403 KiB | 22 Q