3v4l.org

run code in 300+ PHP versions simultaneously
<?php $output = "a b\tc"; $preg_match_matches = NULL; $preg_match_all_matches = NULL; $preg_replace_callback_array_count = NULL; var_dump([ 'preg_filter' => preg_filter('/[a-z]+/', 'X', $output, NULL), 'preg_grep' => preg_grep('/^[a-z]+/', [$output, 'x'], NULL), 'preg_match' => preg_match('/^[a-z]+/', $output, $preg_match_matches, NULL, NULL), 'preg_match $matches' => $preg_match_matches, 'preg_match_all' => preg_match_all('/^[a-z]+/', $output, $preg_match_all_matches, NULL, NULL), 'preg_match_all $matches' => $preg_match_all_matches, 'preg_replace' => preg_replace('/[a-z]+/', 'X', $output, NULL), 'preg_replace_callback' => preg_replace_callback('/[a-z]+/', function($word) { return $word; }, $output, NULL), 'preg_replace_callback_array' => preg_replace_callback_array([ '~[a]+~i' => function ($match) { return 'X'; }, '~[b]+~i' => function ($match) { return 'Y'; }, ], $output, NULL, $preg_replace_callback_array_count, NULL), 'preg_split' => preg_split('/\s/', $output, NULL, PREG_SPLIT_NO_EMPTY), ]); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dLJSU
function name:  (null)
number of ops:  75
compiled vars:  !0 = $output, !1 = $preg_match_matches, !2 = $preg_match_all_matches, !3 = $preg_replace_callback_array_count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'a++b%09c'
    4     1        ASSIGN                                                   !1, null
    5     2        ASSIGN                                                   !2, null
    6     3        ASSIGN                                                   !3, null
    7     4        INIT_FCALL                                               'var_dump'
    8     5        INIT_FCALL                                               'preg_filter'
          6        SEND_VAL                                                 '%2F%5Ba-z%5D%2B%2F'
          7        SEND_VAL                                                 'X'
          8        SEND_VAR                                                 !0
          9        SEND_VAL                                                 null
         10        DO_ICALL                                         $8      
         11        INIT_ARRAY                                       ~9      $8, 'preg_filter'
    9    12        INIT_FCALL                                               'preg_grep'
         13        SEND_VAL                                                 '%2F%5E%5Ba-z%5D%2B%2F'
         14        INIT_ARRAY                                       ~10     !0
         15        ADD_ARRAY_ELEMENT                                ~10     'x'
         16        SEND_VAL                                                 ~10
         17        SEND_VAL                                                 null
         18        DO_ICALL                                         $11     
         19        ADD_ARRAY_ELEMENT                                ~9      $11, 'preg_grep'
   10    20        INIT_FCALL                                               'preg_match'
         21        SEND_VAL                                                 '%2F%5E%5Ba-z%5D%2B%2F'
         22        SEND_VAR                                                 !0
         23        SEND_REF                                                 !1
         24        SEND_VAL                                                 null
         25        SEND_VAL                                                 null
         26        DO_ICALL                                         $12     
         27        ADD_ARRAY_ELEMENT                                ~9      $12, 'preg_match'
   11    28        ADD_ARRAY_ELEMENT                                ~9      !1, 'preg_match+%24matches'
   12    29        INIT_FCALL                                               'preg_match_all'
         30        SEND_VAL                                                 '%2F%5E%5Ba-z%5D%2B%2F'
         31        SEND_VAR                                                 !0
         32        SEND_REF                                                 !2
         33        SEND_VAL                                                 null
         34        SEND_VAL                                                 null
         35        DO_ICALL                                         $13     
         36        ADD_ARRAY_ELEMENT                                ~9      $13, 'preg_match_all'
   13    37        ADD_ARRAY_ELEMENT                                ~9      !2, 'preg_match_all+%24matches'
   14    38        INIT_FCALL                                               'preg_replace'
         39        SEND_VAL                                                 '%2F%5Ba-z%5D%2B%2F'
         40        SEND_VAL                                                 'X'
         41        SEND_VAR                                                 !0
         42        SEND_VAL                                                 null
         43        DO_ICALL                                         $14     
         44        ADD_ARRAY_ELEMENT                                ~9      $14, 'preg_replace'
   15    45        INIT_FCALL                                               'preg_replace_callback'
         46        SEND_VAL                                                 '%2F%5Ba-z%5D%2B%2F'
         47        DECLARE_LAMBDA_FUNCTION                          ~15     [0]
   17    48        SEND_VAL                                                 ~15
         49        SEND_VAR                                                 !0
         50        SEND_VAL                                                 null
   15    51        DO_ICALL                                         $16     
   17    52        ADD_ARRAY_ELEMENT                                ~9      $16, 'preg_replace_callback'
   18    53        INIT_FCALL                                               'preg_replace_callback_array'
   19    54        DECLARE_LAMBDA_FUNCTION                          ~17     [1]
   21    55        INIT_ARRAY                                       ~18     ~17, '%7E%5Ba%5D%2B%7Ei'
   22    56        DECLARE_LAMBDA_FUNCTION                          ~19     [2]
   24    57        ADD_ARRAY_ELEMENT                                ~18     ~19, '%7E%5Bb%5D%2B%7Ei'
         58        SEND_VAL                                                 ~18
   25    59        SEND_VAR                                                 !0
         60        SEND_VAL                                                 null
         61        SEND_REF                                                 !3
         62        SEND_VAL                                                 null
   18    63        DO_ICALL                                         $20     
   25    64        ADD_ARRAY_ELEMENT                                ~9      $20, 'preg_replace_callback_array'
   26    65        INIT_FCALL                                               'preg_split'
         66        SEND_VAL                                                 '%2F%5Cs%2F'
         67        SEND_VAR                                                 !0
         68        SEND_VAL                                                 null
         69        SEND_VAL                                                 1
         70        DO_ICALL                                         $21     
         71        ADD_ARRAY_ELEMENT                                ~9      $21, 'preg_split'
         72        SEND_VAL                                                 ~9
    7    73        DO_ICALL                                                 
   28    74      > 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/dLJSU
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $word
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1      > RETURN                                                   !0
   17     2*     > RETURN                                                   null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dLJSU
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1      > RETURN                                                   'X'
   21     2*     > RETURN                                                   null

End of Dynamic Function 1

Dynamic Function 2
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dLJSU
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   23     1      > RETURN                                                   'Y'
   24     2*     > RETURN                                                   null

End of Dynamic Function 2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.28 ms | 1023 KiB | 22 Q