3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'Vanilla', 'Curaçao', 'Vanilla Ice', "Vanilla\nIce", 'वैनिला', 'فانيليا', 'དྲི་ཞིམ་ལྡན་པའི་རྩྭ།', '12345!?', "\t", " ", ]; function is_utf8_printable($string): bool { return (bool) preg_match('~^[[:print:]]+$~u', $string); } $printable = array_map(function($string) { // $is = ctype_print($string); $is = is_utf8_printable($string); return [$string => $is]; }, $strings); var_dump($printable);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9DOIE
function name:  (null)
number of ops:  11
compiled vars:  !0 = $strings, !1 = $printable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   21     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
   26     3        SEND_VAL                                                 ~3
          4        SEND_VAR                                                 !0
   21     5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
   28     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9DOIE
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $string, !1 = $is
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   23     1        INIT_FCALL                                               'is_utf8_printable'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !1, $2
   24     5        INIT_ARRAY                                       ~4      !1, !0
          6      > RETURN                                                   ~4
   26     7*     > RETURN                                                   null

End of Dynamic Function 0

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

End of function is_utf8_printable

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.11 ms | 1016 KiB | 17 Q