3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { public $a = [ '~.~e' => '$this->waa($0);' ]; function p($s) { foreach($this->a as $p => $r) { // support deprecated PREG_REPLACE_EVAL if (preg_match('~^(.*)([/\~])([imsxADSUXJu]*)e([imsxADSUXJu]*)$~s', $p, $m)) { $s = preg_replace_callback($m[1].$m[2].$m[3].$m[4], function($m) use ($s, $r){ return eval('return '. preg_replace_callback('~\$(\d)~', function($i) use($m){ return $m[ $i[1] ];}, $r).';'); }, $s); } else $string = preg_replace($p, $r, $s); } return $s; } function waa($t){ return '*'.$t.'*'; } } var_dump((new x)->p('wazup'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c9ITE
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'x'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'p'
          4        SEND_VAL_EX                                              'wazup'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fc9ITE%3A16%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c9ITE
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $m, !1 = $s, !2 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
   17     3        INIT_FCALL                                               'preg_replace_callback'
          4        SEND_VAL                                                 '%7E%5C%24%28%5Cd%29%7E'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fc9ITE%3A17%241'
          6        BIND_LEXICAL                                             ~3, !0
          7        SEND_VAL                                                 ~3
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                         $4      
         10        CONCAT                                           ~5      'return+', $4
         11        CONCAT                                           ~6      ~5, '%3B'
         12        INCLUDE_OR_EVAL                                  $7      ~6, EVAL
         13      > RETURN                                                   $7
   18    14*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fc9ITE%3A16%240

Function %00%7Bclosure%7D%2Fin%2Fc9ITE%3A17%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c9ITE
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $i, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !0, 1
          3        FETCH_DIM_R                                      ~3      !1, ~2
          4      > RETURN                                                   ~3
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fc9ITE%3A17%241

Class x:
Function p:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 35
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 35
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 28
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/c9ITE
function name:  p
number of ops:  38
compiled vars:  !0 = $s, !1 = $r, !2 = $p, !3 = $m, !4 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        FETCH_OBJ_R                                      ~5      'a'
          2      > FE_RESET_R                                       $6      ~5, ->35
          3    > > FE_FETCH_R                                       ~7      $6, !1, ->35
          4    >   ASSIGN                                                   !2, ~7
   14     5        INIT_FCALL                                               'preg_match'
          6        SEND_VAL                                                 '%7E%5E%28.%2A%29%28%5B%2F%5C%7E%5D%29%28%5BimsxADSUXJu%5D%2A%29e%28%5BimsxADSUXJu%5D%2A%29%24%7Es'
          7        SEND_VAR                                                 !2
          8        SEND_REF                                                 !3
          9        DO_ICALL                                         $9      
         10      > JMPZ                                                     $9, ->28
   16    11    >   INIT_FCALL                                               'preg_replace_callback'
         12        FETCH_DIM_R                                      ~10     !3, 1
         13        FETCH_DIM_R                                      ~11     !3, 2
         14        CONCAT                                           ~12     ~10, ~11
         15        FETCH_DIM_R                                      ~13     !3, 3
         16        CONCAT                                           ~14     ~12, ~13
         17        FETCH_DIM_R                                      ~15     !3, 4
         18        CONCAT                                           ~16     ~14, ~15
         19        SEND_VAL                                                 ~16
         20        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fc9ITE%3A16%240'
         21        BIND_LEXICAL                                             ~17, !0
         22        BIND_LEXICAL                                             ~17, !1
   18    23        SEND_VAL                                                 ~17
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $18     
   16    26        ASSIGN                                                   !0, $18
         27      > JMP                                                      ->34
   20    28    >   INIT_FCALL                                               'preg_replace'
         29        SEND_VAR                                                 !2
         30        SEND_VAR                                                 !1
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $20     
         33        ASSIGN                                                   !4, $20
   11    34    > > JMP                                                      ->3
         35    >   FE_FREE                                                  $6
   23    36      > RETURN                                                   !0
   24    37*     > RETURN                                                   null

End of function p

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

End of function waa

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.08 ms | 1404 KiB | 21 Q