3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "nickname": "#FF0000Nick#00FF00name" }'; $data = json_decode($json, true); $garbledData = $data['nickname']; // (?<firstHex>\#[A-F0-9]{6}) match and name the match 'firstHex' - look for a hash, then letters a-f or numbers 0-9, with a length of 6 characters // (?<name>.+) match and name the match 'name' - look for absolutely any characters, any amount // (?<secondHex>\#[A-F0-9]{6}) match and name the match 'secondHex' - look for a hash, then letters a-f or numbers 0-9, with a length of 6 characters $regex = '/(?<firstHex>\#[A-F0-9]{6})(?<name>.+)(?<secondHex>\#[A-F0-9]{6})/'; preg_match($regex, $garbledData, $matches); $firstHex = $matches['firstHex']; $secondHex = $matches['secondHex']; $name = $matches['name']; echo $firstHex . "\n"; echo $secondHex . "\n"; echo $name . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qo2gc
function name:  (null)
number of ops:  27
compiled vars:  !0 = $json, !1 = $data, !2 = $garbledData, !3 = $regex, !4 = $matches, !5 = $firstHex, !6 = $secondHex, !7 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B+%22nickname%22%3A+%22%23FF0000Nick%2300FF00name%22+%7D'
    4     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !1, $9
    5     6        FETCH_DIM_R                                      ~11     !1, 'nickname'
          7        ASSIGN                                                   !2, ~11
   13     8        ASSIGN                                                   !3, '%2F%28%3F%3CfirstHex%3E%5C%23%5BA-F0-9%5D%7B6%7D%29%28%3F%3Cname%3E.%2B%29%28%3F%3CsecondHex%3E%5C%23%5BA-F0-9%5D%7B6%7D%29%2F'
   14     9        INIT_FCALL                                               'preg_match'
         10        SEND_VAR                                                 !3
         11        SEND_VAR                                                 !2
         12        SEND_REF                                                 !4
         13        DO_ICALL                                                 
   16    14        FETCH_DIM_R                                      ~15     !4, 'firstHex'
         15        ASSIGN                                                   !5, ~15
   17    16        FETCH_DIM_R                                      ~17     !4, 'secondHex'
         17        ASSIGN                                                   !6, ~17
   18    18        FETCH_DIM_R                                      ~19     !4, 'name'
         19        ASSIGN                                                   !7, ~19
   20    20        CONCAT                                           ~21     !5, '%0A'
         21        ECHO                                                     ~21
   21    22        CONCAT                                           ~22     !6, '%0A'
         23        ECHO                                                     ~22
   22    24        CONCAT                                           ~23     !7, '%0A'
         25        ECHO                                                     ~23
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.6 ms | 1395 KiB | 17 Q