3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = "CN=Carina Costa(42353),OU=Administrativos,OU=Amadora,OU=Utilizadores,DC=hluz,DC=ess,DC=local"; $pattern = '/=([^,]+)/'; $matches = []; preg_match($pattern, $data,$matches); $result = count($matches)? $matches[1]:null; //the match, or NULL var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QRp3q
function name:  (null)
number of ops:  19
compiled vars:  !0 = $data, !1 = $pattern, !2 = $matches, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'CN%3DCarina+Costa%2842353%29%2COU%3DAdministrativos%2COU%3DAmadora%2COU%3DUtilizadores%2CDC%3Dhluz%2CDC%3Dess%2CDC%3Dlocal'
    3     1        ASSIGN                                                   !1, '%2F%3D%28%5B%5E%2C%5D%2B%29%2F'
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !2
          7        DO_ICALL                                                 
    6     8        COUNT                                            ~8      !2
          9      > JMPZ                                                     ~8, ->13
         10    >   FETCH_DIM_R                                      ~9      !2, 1
         11        QM_ASSIGN                                        ~10     ~9
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~10     null
         14    >   ASSIGN                                                   !3, ~10
    7    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.78 ms | 1014 KiB | 16 Q