3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* https://www.php.net/manual/en/function.ctype-print.php Returns true if every character in text will actually create output (including blanks). Returns false if text contains control characters or characters that do not have any output or control function at all. */ function ctype_print_utf(string $string): bool { return preg_match('/[[:cntrl:]]/', $string) === 0; } $items = ["Curaçao", "Curaçao\n"]; foreach ($items as $item) { var_dump($item, ctype_print_utf($item)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 11
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/N6NRK
function name:  (null)
number of ops:  13
compiled vars:  !0 = $items, !1 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   14     1      > FE_RESET_R                                       $3      !0, ->11
          2    > > FE_FETCH_R                                               $3, !1, ->11
   15     3    >   INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !1
          5        INIT_FCALL                                               'ctype_print_utf'
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0  $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   14    10      > JMP                                                      ->2
         11    >   FE_FREE                                                  $3
   16    12      > RETURN                                                   1

Function ctype_print_utf:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N6NRK
function name:  ctype_print_utf
number of ops:  10
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   10     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5B%5B%3Acntrl%3A%5D%5D%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        IS_IDENTICAL                                     ~2      $1, 0
          6        VERIFY_RETURN_TYPE                                       ~2
          7      > RETURN                                                   ~2
   11     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function ctype_print_utf

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.86 ms | 1012 KiB | 17 Q