3v4l.org

run code in 300+ PHP versions simultaneously
<?php class x { function __construct($x){ $p = '$this->waa($0);'; var_dump( preg_replace_callback('~.~', function($m){ return eval( preg_replace('~\$(\d)~', 'm[$1]', $p) ); }, 'wazaa') ); } function waa($t){ return '*'.$t.'*'; } } new x($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BSEgr
function name:  (null)
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'x'
          1        SEND_VAR_EX                                              !0
          2        DO_FCALL                                      0          
          3        FREE                                                     $1
          4      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FBSEgr%3A9%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BSEgr
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $m, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%7E%5C%24%28%5Cd%29%7E'
          3        SEND_VAL                                                 'm%5B%241%5D'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        INCLUDE_OR_EVAL                                  $3      $2, EVAL
          7      > RETURN                                                   $3
   13     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FBSEgr%3A9%240

Class x:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BSEgr
function name:  __construct
number of ops:  12
compiled vars:  !0 = $x, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN                                                   !1, '%24this-%3Ewaa%28%240%29%3B'
    8     2        INIT_FCALL                                               'var_dump'
    9     3        INIT_FCALL                                               'preg_replace_callback'
          4        SEND_VAL                                                 '%7E.%7E'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FBSEgr%3A9%240'
   13     6        SEND_VAL                                                 ~3
          7        SEND_VAL                                                 'wazaa'
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
   15    11      > RETURN                                                   null

End of function __construct

Function waa:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BSEgr
function name:  waa
number of ops:  5
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     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:
150.45 ms | 1400 KiB | 19 Q