3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = function ($name) { var_dump($name); $result = preg_match('/^(get)([a-zA-Z\d]+)(List)$/', $name, $matches); var_dump($result); var_dump($matches); }; $names = [ 'getOshList', 'getList', 'OshList', 'getOsh', 'getOshlist', ]; foreach ($names as $name) { $test($name); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 9
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/YeGgv
function name:  (null)
number of ops:  11
compiled vars:  !0 = $test, !1 = $names, !2 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FYeGgv%3A3%240'
          1        ASSIGN                                                   !0, ~3
   10     2        ASSIGN                                                   !1, <array>
   18     3      > FE_RESET_R                                       $6      !1, ->9
          4    > > FE_FETCH_R                                               $6, !2, ->9
   19     5    >   INIT_DYNAMIC_CALL                                        !0
          6        SEND_VAR_EX                                              !2
          7        DO_FCALL                                      0          
   18     8      > JMP                                                      ->4
          9    >   FE_FREE                                                  $6
   20    10      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FYeGgv%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YeGgv
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $name, !1 = $result, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    5     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%2F%5E%28get%29%28%5Ba-zA-Z%5Cd%5D%2B%29%28List%29%24%2F'
          6        SEND_VAR                                                 !0
          7        SEND_REF                                                 !2
          8        DO_ICALL                                         $4      
          9        ASSIGN                                                   !1, $4
    6    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
    7    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
    8    16      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FYeGgv%3A3%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.67 ms | 1396 KiB | 17 Q