3v4l.org

run code in 300+ PHP versions simultaneously
<?php const PRIV_API_KEY = '1234-5678-8426'; const PRIV_ACCESS_TOKEN = 'fnse0segh-23hfoeghl-fseuhosz'; const NONPRIV_CONST = 42; $priv_constants = array_filter(get_defined_constants(true)['user'], function ($k) { return substr($k, 0, 4) == 'PRIV'; }, ARRAY_FILTER_USE_KEY); $regexes = array_map(function ($v) { return '/' . preg_quote($v) . '/' ; }, $priv_constants); $message = 'Lorem ipsum dolor sit ammet 1234-5678-8426 bibendum id et dolor. Lorem ipsum dolor fnse0segh-23hfoeghl-fseuhosz sit ammet bibendum id et dolor.'; $message = preg_replace_callback($regexes, function ($m) { return preg_replace('/[^-]/', '*', $m[0]); }, $message); echo $message;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eMOiE
function name:  (null)
number of ops:  30
compiled vars:  !0 = $priv_constants, !1 = $regexes, !2 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'PRIV_API_KEY', '1234-5678-8426'
    4     1        DECLARE_CONST                                            'PRIV_ACCESS_TOKEN', 'fnse0segh-23hfoeghl-fseuhosz'
    5     2        DECLARE_CONST                                            'NONPRIV_CONST', 42
    7     3        INIT_FCALL                                               'array_filter'
          4        INIT_FCALL                                               'get_defined_constants'
          5        SEND_VAL                                                 <true>
          6        DO_ICALL                                         $3      
          7        FETCH_DIM_R                                      ~4      $3, 'user'
          8        SEND_VAL                                                 ~4
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FeMOiE%3A7%240'
         10        SEND_VAL                                                 ~5
         11        SEND_VAL                                                 2
         12        DO_ICALL                                         $6      
         13        ASSIGN                                                   !0, $6
    8    14        INIT_FCALL                                               'array_map'
         15        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FeMOiE%3A8%241'
         16        SEND_VAL                                                 ~8
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $9      
         19        ASSIGN                                                   !1, $9
   10    20        ASSIGN                                                   !2, 'Lorem+ipsum+dolor+sit+ammet+1234-5678-8426+bibendum+id+et+dolor.+Lorem+ipsum+dolor+fnse0segh-23hfoeghl-fseuhosz+sit+ammet+bibendum+id+et+dolor.'
   12    21        INIT_FCALL                                               'preg_replace_callback'
         22        SEND_VAR                                                 !1
         23        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FeMOiE%3A12%242'
         24        SEND_VAL                                                 ~12
         25        SEND_VAR                                                 !2
         26        DO_ICALL                                         $13     
         27        ASSIGN                                                   !2, $13
   13    28        ECHO                                                     !2
   14    29      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FeMOiE%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eMOiE
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 4
          5        DO_ICALL                                         $1      
          6        IS_EQUAL                                         ~2      $1, 'PRIV'
          7      > RETURN                                                   ~2
          8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FeMOiE%3A7%240

Function %00%7Bclosure%7D%2Fin%2FeMOiE%3A8%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eMOiE
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'preg_quote'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        CONCAT                                           ~2      '%2F', $1
          5        CONCAT                                           ~3      ~2, '%2F'
          6      > RETURN                                                   ~3
          7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FeMOiE%3A8%241

Function %00%7Bclosure%7D%2Fin%2FeMOiE%3A12%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eMOiE
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5B%5E-%5D%2F'
          3        SEND_VAL                                                 '%2A'
          4        FETCH_DIM_R                                      ~1      !0, 0
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
          8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FeMOiE%3A12%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.63 ms | 1405 KiB | 27 Q