3v4l.org

run code in 500+ PHP versions simultaneously
<?php $text="('x-csrf-token', 'whatever')"; preg_match("/x-csrf-token',\s*'([^']+)/mi",$text,$matches); $token=$matches[1]; var_dump($token);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WjKhb
function name:  (null)
number of ops:  12
compiled vars:  !0 = $text, !1 = $matches, !2 = $token
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%28%27x-csrf-token%27%2C+%27whatever%27%29'
    3     1        INIT_FCALL                                                   'preg_match'
          2        SEND_VAL                                                     '%2Fx-csrf-token%27%2C%5Cs%2A%27%28%5B%5E%27%5D%2B%29%2Fmi'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                                     
    4     6        FETCH_DIM_R                                          ~5      !1, 1
          7        ASSIGN                                                       !2, ~5
    5     8        INIT_FCALL                                                   'var_dump'
          9        SEND_VAR                                                     !2
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.41 ms | 1851 KiB | 15 Q