3v4l.org

run code in 500+ PHP versions simultaneously
<?php function starts_with_upper($str) { $chr = mb_substr ($str, 0, 1, "UTF-8"); return mb_strtolower($chr, "UTF-8") != $chr; } print("STARTS WITH 'a': Hello " . starts_with_upper('Hello') . "\n\n"); print("STARTS WITH 'a': hello " . starts_with_upper('hello') . "\n\n");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/96LHf
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                                   'starts_with_upper'
          1        SEND_VAL                                                     'Hello'
          2        DO_FCALL                                          0  $0      
          3        CONCAT                                               ~1      'STARTS+WITH+%27a%27%3A+Hello+', $0
          4        CONCAT                                               ~2      ~1, '%0A%0A'
          5        ECHO                                                         ~2
    9     6        INIT_FCALL                                                   'starts_with_upper'
          7        SEND_VAL                                                     'hello'
          8        DO_FCALL                                          0  $3      
          9        CONCAT                                               ~4      'STARTS+WITH+%27a%27%3A+hello+', $3
         10        CONCAT                                               ~5      ~4, '%0A%0A'
         11        ECHO                                                         ~5
         12      > RETURN                                                       1

Function starts_with_upper:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/96LHf
function name:  starts_with_upper
number of ops:  15
compiled vars:  !0 = $str, !1 = $chr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        INIT_FCALL                                                   'mb_substr'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     0
          4        SEND_VAL                                                     1
          5        SEND_VAL                                                     'UTF-8'
          6        DO_ICALL                                             $2      
          7        ASSIGN                                                       !1, $2
    5     8        INIT_FCALL                                                   'mb_strtolower'
          9        SEND_VAR                                                     !1
         10        SEND_VAL                                                     'UTF-8'
         11        DO_ICALL                                             $4      
         12        IS_NOT_EQUAL                                         ~5      !1, $4
         13      > RETURN                                                       ~5
    6    14*     > RETURN                                                       null

End of function starts_with_upper

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.26 ms | 1302 KiB | 12 Q