3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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);
based on Wfsi9
Output for 5.3.21 - 7.2.0
Notice: Undefined variable: x in /in/BSEgr on line 20 Notice: Undefined variable: p in /in/BSEgr on line 11 Notice: Undefined variable: p in /in/BSEgr on line 11 Notice: Undefined variable: p in /in/BSEgr on line 11 Notice: Undefined variable: p in /in/BSEgr on line 11 Notice: Undefined variable: p in /in/BSEgr on line 11 string(0) ""