3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { function __construct() { $template = 'asdksjf123'; //$resault= preg_replace("/([a-z]+)/e", "select('\\1');", $template); $self = $this; $resault = preg_replace_callback("/([a-z]+)([\d]+)/", function($matches) use($self) { return $self->select($matches[1]); }, $template); var_dump($resault); } function select($str) { return $str . '#'; } } new test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i0DZK
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $0      'test'
          1        DO_FCALL                                      0          
          2        FREE                                                     $0
          3      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fi0DZK%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i0DZK
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $matches, !1 = $self
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   12     2        INIT_METHOD_CALL                                         !1, 'select'
          3        CHECK_FUNC_ARG                                           
          4        FETCH_DIM_FUNC_ARG                               $2      !0, 1
          5        SEND_FUNC_ARG                                            $2
          6        DO_FCALL                                      0  $3      
          7      > RETURN                                                   $3
   13     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fi0DZK%3A11%240

Class test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i0DZK
function name:  __construct
number of ops:  15
compiled vars:  !0 = $template, !1 = $self, !2 = $resault
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'asdksjf123'
   10     1        FETCH_THIS                                       ~4      
          2        ASSIGN                                                   !1, ~4
   11     3        INIT_FCALL                                               'preg_replace_callback'
          4        SEND_VAL                                                 '%2F%28%5Ba-z%5D%2B%29%28%5B%5Cd%5D%2B%29%2F'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fi0DZK%3A11%240'
          6        BIND_LEXICAL                                             ~6, !1
   13     7        SEND_VAL                                                 ~6
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
   11    10        ASSIGN                                                   !2, $7
   15    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   16    14      > RETURN                                                   null

End of function __construct

Function select:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i0DZK
function name:  select
number of ops:  4
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        CONCAT                                           ~1      !0, '%23'
          2      > RETURN                                                   ~1
   21     3*     > RETURN                                                   null

End of function select

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.01 ms | 1405 KiB | 17 Q