3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function run() { $file = __FILE__ . '.tmp'; register_shutdown_function(function () use ($file) { @unlink($file); }); file_put_contents($file, '<?php self::foo(); ?>'); require $file; } static function foo() { echo 'Hi!', PHP_EOL; } } (new Test)->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cS4JQ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $0      'Test'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'run'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FcS4JQ%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cS4JQ
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
          1        BEGIN_SILENCE                                    ~1      
          2        INIT_FCALL                                               'unlink'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
          5        END_SILENCE                                              ~1
          6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FcS4JQ%3A6%240

Class Test:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cS4JQ
function name:  run
number of ops:  12
compiled vars:  !0 = $file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, '%2Fin%2FcS4JQ.tmp'
    6     1        INIT_FCALL                                               'register_shutdown_function'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FcS4JQ%3A6%240'
          3        BIND_LEXICAL                                             ~2, !0
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
    7     6        INIT_FCALL                                               'file_put_contents'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 '%3C%3Fphp+self%3A%3Afoo%28%29%3B+%3F%3E'
          9        DO_ICALL                                                 
    8    10        INCLUDE_OR_EVAL                                          !0, REQUIRE
    9    11      > RETURN                                                   null

End of function run

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cS4JQ
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'Hi%21'
          1        ECHO                                                     '%0A'
          2      > RETURN                                                   null

End of function foo

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.6 ms | 1396 KiB | 19 Q