3v4l.org

run code in 500+ PHP versions simultaneously
<?php final class MyTerribleCode { public function demo(): void { $a = 1; (static function () { eval( <<<'PHP' var_dump(get_defined_vars()); var_dump(isset($this)); try { var_dump(self::class); } catch (Error) { var_dump(null); } PHP ); })->bindTo(null, null)(); } } (new MyTerribleCode())->demo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o1rPb
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   NEW                                                  $0      'MyTerribleCode'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'demo'
          3        DO_FCALL                                          0          
          4      > RETURN                                                       1

Class MyTerribleCode:
Function demo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o1rPb
function name:  demo
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                       !0, 1
    9     1        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   21     2        INIT_METHOD_CALL                                             ~2, 'bindTo'
          3        SEND_VAL_EX                                                  null
          4        SEND_VAL_EX                                                  null
          5        DO_FCALL                                          0  $3      
          6        INIT_DYNAMIC_CALL                                            $3
          7        DO_FCALL                                          0          
   22     8      > RETURN                                                       null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/o1rPb
function name:  {closure:MyTerribleCode::demo():9}
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INCLUDE_OR_EVAL                                              'var_dump%28get_defined_vars%28%29%29%3B%0Avar_dump%28isset%28%24this%29%29%3B%0Atry+%7B%0A++++var_dump%28self%3A%3Aclass%29%3B%0A%7D+catch+%28Error%29+%7B%0A++++var_dump%28null%29%3B%0A%7D', EVAL
   21     1      > RETURN                                                       null

End of Dynamic Function 0

End of function demo

End of class MyTerribleCode.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
125.76 ms | 475 KiB | 7 Q